ansible-collection-hardening/roles/os_hardening/tasks/main.yml
Colin Adler 8cbeeff501
Use include_tasks for os_hardening/main.yml (#451)
When `import_tasks` is used, the task `Fetch OS dependent variables`
always runs, even when excluded by an upstream tag.

When `Fetch OS dependent variables` runs while excluded via tags, it
will always fail with the following.

```
fatal: [alpha]: FAILED! => {"msg": "No file was found when using first_found. Use errors='ignore' to allow this task to be skipped if no files are found"}
```

This brings os_hardening's main.yml in line with ssh_hardening's
main.yml, which doesn't have this issue.

Signed-off-by: Colin Adler <colin@coder.com>
2021-06-23 11:28:08 +02:00

3 lines
71 B
YAML

---
- include_tasks: hardening.yml
when: os_hardening_enabled | bool