replace when by tag specific

This commit is contained in:
Valentin CZERYBA 2023-02-15 21:54:20 +01:00
parent 18da14f2de
commit 62af6912cd
2 changed files with 9 additions and 13 deletions

View File

@ -9,7 +9,6 @@
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
when: script is not defined
- name: Template virtualhost
template:
@ -20,7 +19,7 @@
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
when: script is not defined or script == "blacklist"
tags: [ "configure_blacklist" ]
- name: Copy blacklist
copy:
@ -33,17 +32,17 @@
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
tags: [ "restore" ]
tags: [ "restore_blacklist" ]
- name: Deploy stats script
import_tasks: stats.yml
when: script is not defined or script == "stats"
tags: [ "configure_stats" ]
- name: Configure blacklist script
import_tasks: blacklist.yml
when: script is not defined or script == "blacklist"
tags: [ "configure_blacklist" ]
- name: Configure supervision script
import_tasks: supervision.yml
when: script is not defined or script == "supervision"
tags: [ "configure_supervision" ]

View File

@ -2,23 +2,21 @@
fetch:
src: /etc/sentinel/blacklist
dest: blacklist
when: script is not defined or script == "blacklist"
tags: [ "backup" ]
tags: [ "backup_balcklist" ]
- name: Deconfigure stats script
import_tasks: deconfigure_stats.yml
when: script is not defined or script == "stats"
tags: [ "deconfigure_stats" ]
- name: Deconfigure blacklist script
import_tasks: deconfigure_blacklist.yml
when: script is not defined or script == "blacklist"
tags: [ "deconfigure_blacklist" ]
- name: Deconfigure supervision script
import_tasks: deconfigure_supervision.yml
when: script is not defined or script == "supervision"
tags: [ "deconfigure_supervision" ]
- name: Remove sentinel directory
file:
@ -31,4 +29,3 @@
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
when: script is not defined