From c3d720cbd4196600e0267193266cb98c01d876ea Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 15 May 2018 01:20:51 -0400 Subject: [PATCH] Fix checkout of role requirements. 'omit' is only special as a module argument, it cannot be used in this way. Hence, just have two conditional tasks. --- awx/playbooks/project_update.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/awx/playbooks/project_update.yml b/awx/playbooks/project_update.yml index d9067bac45..cefbdef1bb 100644 --- a/awx/playbooks/project_update.yml +++ b/awx/playbooks/project_update.yml @@ -139,8 +139,17 @@ register: doesRequirementsExist - name: fetch galaxy roles from requirements.yml - command: ansible-galaxy install -r requirements.yml -p {{project_path|quote}}/roles/ {{ scm_result is defined|ternary('--force',omit) }} + command: ansible-galaxy install -r requirements.yml -p {{project_path|quote}}/roles/ args: chdir: "{{project_path|quote}}/roles" - when: doesRequirementsExist.stat.exists + register: galaxy_result + when: doesRequirementsExist.stat.exists and scm_result is undefined + changed_when: "'was installed successfully' in galaxy_result.stdout" + + - name: fetch galaxy roles from requirements.yml (forced update) + command: ansible-galaxy install -r requirements.yml -p {{project_path|quote}}/roles/ --force + args: + chdir: "{{project_path|quote}}/roles" + when: doesRequirementsExist.stat.exists and scm_result is defined + when: scm_full_checkout|bool