mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-10 11:50:18 +01:00
prevent non-existent file from breaking play
fixes: failed: [127.0.0.1] => {"failed": true, "item": "", "rc": 257} msg: Destination /etc/sysconfig/iptables does not exist ! create=yes allows it to not fail on non-existent file, but because regex={{ httpd_port }} doesn't match anything, nothing is done (no file is created)
This commit is contained in:
parent
8714a5cbc2
commit
b55f4d1759
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@
|
||||||
- libselinux-python
|
- libselinux-python
|
||||||
|
|
||||||
- name: insert iptables rule for httpd
|
- name: insert iptables rule for httpd
|
||||||
lineinfile: dest=/etc/sysconfig/iptables state=present regexp="{{ httpd_port }}" insertafter="^:OUTPUT "
|
lineinfile: dest=/etc/sysconfig/iptables create=yes state=present regexp="{{ httpd_port }}" insertafter="^:OUTPUT "
|
||||||
line="-A INPUT -p tcp --dport {{ httpd_port }} -j ACCEPT"
|
line="-A INPUT -p tcp --dport {{ httpd_port }} -j ACCEPT"
|
||||||
notify: restart iptables
|
notify: restart iptables
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue