geerlingguy / ansible-role-firewall

Ansible Role - iptables Firewall configuration.
https://galaxy.ansible.com/geerlingguy/firewall/
MIT License
524 stars 217 forks source link

Error on Debian on first check_mode run #95

Closed Al-thi closed 1 year ago

Al-thi commented 1 year ago

Hello,

This role fails on Debian when playing the following tasks in check_mode on a fresh server :

- name: Configure the firewall service.
  service:
    name: firewall
    state: "{{ firewall_state }}"
    enabled: "{{ firewall_enabled_at_boot }}"

with the following error message :

fatal: [xxx]: FAILED! => {"changed": false, "msg": "Could not find the requested service firewall: host"}

because the firewall service unit file is not installed and therefore the service step fails.

I suggest adding the following line to this task to ignore check_mode errors :

  ignore_errors: "{{ ansible_check_mode }}"
Al-thi commented 1 year ago

I also had to ignore errors in the handler, for the same reasons.

stale[bot] commented 1 year ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 1 year ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

hkcomori commented 6 months ago

No chance for this issue to be fixed?