From b83baa4c26c032714863bd3162b706c9048b811a Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 17 Jun 2020 00:11:50 +0100 Subject: [PATCH] Ansible: prevent showing changed status when not changed --- tools/ansible/deploy/after-update-code.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/ansible/deploy/after-update-code.yml b/tools/ansible/deploy/after-update-code.yml index d9584f8..69dcfdf 100644 --- a/tools/ansible/deploy/after-update-code.yml +++ b/tools/ansible/deploy/after-update-code.yml @@ -13,16 +13,21 @@ command: '{{ release_drush_path }} updatedb -y' args: chdir: '{{ release_web_path }}' + register: update_database_result + changed_when: "'No pending updates' not in update_database_result.stderr" - name: Import configuration command: '{{ release_drush_path }} config-import -y' args: chdir: '{{ release_web_path }}' + register: config_import_result + changed_when: "'There are no changes to import' not in config_import_result.stderr" - name: Rebuild cache command: '{{ release_drush_path }} cache-rebuild' args: chdir: '{{ release_web_path }}' + changed_when: false - name: Generate front-end assets command: | @@ -51,3 +56,4 @@ command: '{{ release_drush_path }} cache-rebuild' args: chdir: '{{ release_web_path }}' + changed_when: false