Skip to content

[3.3.4] - conditional check fails when ufw service is not installed #134

@donarkaz

Description

@donarkaz

When trying to apply control 3.3.4 in the conditional to check whether 'ufw' is present before restarting the service, the condition will never be able to be assessed as the error is in stderr rather than in stdout. It was constantly failing:

  • name: 3.3.4 Ensure suspicious packets are logged | restart ufw after changes in /etc/ufw/sysctl.conf
    service:
    name: ufw
    state: restarted
    when:
    - UFWEnable
    - "'not found' not in ufw_check.stdout"

... thus the last line above should be replaced with the following line, after which it happily skips the control and completes without issues:
- "'not found' not in ufw_check.stderr"

... and some more proof:

image

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions