From ea56897fe3f377d957a0e4fe5e97225364afe7ed Mon Sep 17 00:00:00 2001 From: bluikko <14869000+bluikko@users.noreply.github.com> Date: Mon, 14 Dec 2020 08:42:30 +0700 Subject: [PATCH] Real changed_when for galaxy installs Instead of always claiming nothing changed, set changed when something was installed. --- ansible/playbooks/init-rocky-ansible-host.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ansible/playbooks/init-rocky-ansible-host.yml b/ansible/playbooks/init-rocky-ansible-host.yml index b6972d0..5559fca 100644 --- a/ansible/playbooks/init-rocky-ansible-host.yml +++ b/ansible/playbooks/init-rocky-ansible-host.yml @@ -31,7 +31,8 @@ {{ ( force_purge | bool ) | ternary('--force','') }} --role-file {{ installation_prefix }}roles/requirements.yml --roles-path {{ installation_prefix }}{{ roles_installation_dir }} - changed_when: false + register: galaxy_install_role + changed_when: '"Installing " in galaxy_install_role.stdout' - name: Install needed collections command: > @@ -39,7 +40,8 @@ {{ ( force_purge | bool ) | ternary('--force-with-deps','') }} -r {{ installation_prefix }}roles/requirements.yml -p {{ installation_prefix }}{{ collection_installation_dir }} - changed_when: false + register: galaxy_install_collection + changed_when: '"Installing " in galaxy_install_collection.stdout' - name: cleanup old ssh known_hosts - remove file: