From 62af6912cddcb353051716533efe5b3c31335a6b Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Wed, 15 Feb 2023 21:54:20 +0100 Subject: [PATCH] replace when by tag specific --- roles/deploy-web/tasks/configure.yml | 11 +++++------ roles/deploy-web/tasks/deconfigure.yml | 11 ++++------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/roles/deploy-web/tasks/configure.yml b/roles/deploy-web/tasks/configure.yml index d2f0150..9ba3466 100644 --- a/roles/deploy-web/tasks/configure.yml +++ b/roles/deploy-web/tasks/configure.yml @@ -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" ] diff --git a/roles/deploy-web/tasks/deconfigure.yml b/roles/deploy-web/tasks/deconfigure.yml index d993d79..037c8d1 100644 --- a/roles/deploy-web/tasks/deconfigure.yml +++ b/roles/deploy-web/tasks/deconfigure.yml @@ -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