ansible-roles/minifirewall/tasks/install.yml
Jérémy Lecour 8920ff1ee4 Add "always_run: yes" where it's pertinent
There is also the "check_mode: no", but commented,
for when we switch to Ansible 2.2
2017-01-31 11:45:35 +01:00

34 lines
916 B
YAML

---
- name: clone git repository
git:
repo: "{{ minifirewall_git_url}}"
dest: "{{ minifirewall_checkout_path }}"
clone: yes
# WARN: these tasks copy the file if there are not already there
# They don't update files.
- name: is init script present?
stat:
path: /etc/init.d/minifirewall
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
register: init_minifirewall
- name: init script is copied
command: "cp {{ minifirewall_checkout_path }}/minifirewall /etc/init.d/minifirewall"
when: not init_minifirewall.stat.exists
- name: is configuration present?
stat:
path: /etc/default/minifirewall
#check_mode: no (for migration to Ansible 2.2)
always_run: yes
register: default_minifirewall
- name: configuration is copied
command: "cp {{ minifirewall_checkout_path }}/minifirewall.conf /etc/default/minifirewall"
when: not default_minifirewall.stat.exists