florianutz / ubuntu2004_cis

Ubuntu CIS Hardening Ansible Role
MIT License
108 stars 67 forks source link

1.1.10 Reporting OK even if it's supposed to fail #37

Closed kielboy8 closed 2 years ago

kielboy8 commented 2 years ago

Describe the bug 1.1.10 reporting ok even if shell command reports no output in tasks/section1.yml line 317

To Reproduce Steps to reproduce the behavior:

(I'm running this in localhost)

  1. Run sudo ansible-playbook site.yml --tags="rule_1.1.10"

Expected behavior

TASK [ubuntu2004_cis : SCORED | 1.1.10 | PATCH | Ensure separate partition exists for /var] would fail if there is no "on /var " that exists in mount

But it didn't fail.

Software (please complete the following information):

Additional context The same goes for rule_1.1.11

kielboy8 commented 2 years ago

Fix:

Replace changed_when: false and failed_when: false to changed_when: not var_mounted.stdout and failed_when: not var_mounted.stdout respectively