ansible-roles/minifirewall/tasks/activate.yml
Jérémy Lecour 2ed77c60f0 Improve Ansible syntax
replace « x | changed » by « x is changed »
add explicit « bool » filter
use « length » filter instead of string comparison
2021-05-09 23:06:42 +02:00

30 lines
769 B
YAML

---
- name: check if /etc/init.d/alert5 exists
stat:
path: /etc/init.d/alert5
register: initd_alert5
- name: Uncomment minifirewall start line
replace:
dest: /etc/init.d/alert5
regexp: '^#/etc/init.d/minifirewall start'
replace: '/etc/init.d/minifirewall start'
when:
- initd_alert5.stat.exists
- minifirewall_autostart | bool
- name: check if /usr/share/scripts/alert5 exists
stat:
path: /usr/share/scripts/alert5.sh
register: usr_share_scripts_alert5
- name: Uncomment minifirewall start line
replace:
dest: /usr/share/scripts/alert5.sh
regexp: '^#/etc/init.d/minifirewall start'
replace: '/etc/init.d/minifirewall start'
when:
- usr_share_scripts_alert5.stat.exists
- minifirewall_autostart | bool