From 934646a0f68e1ba71b77b7f8cc214bea4ce92e47 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 22 Mar 2024 06:06:43 -0500 Subject: [PATCH] Address first_found skip bug (#15017) * Address first_found skip bug * Don't attempt installing project root requirements.yml as v2 collection format --- awx/playbooks/project_update.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/awx/playbooks/project_update.yml b/awx/playbooks/project_update.yml index 4dce724496..26a4891c14 100644 --- a/awx/playbooks/project_update.yml +++ b/awx/playbooks/project_update.yml @@ -221,8 +221,10 @@ vars: req_file: "{{ lookup('ansible.builtin.first_found', req_candidates, skip=True) }}" req_candidates: - - "{{ project_path | quote }}/roles/requirements.yml" - - "{{ project_path | quote }}/roles/requirements.yaml" + files: + - "{{ project_path | quote }}/roles/requirements.yml" + - "{{ project_path | quote }}/roles/requirements.yaml" + skip: True changed_when: "'was installed successfully' in galaxy_result.stdout" when: - roles_enabled | bool @@ -237,10 +239,10 @@ vars: req_file: "{{ lookup('ansible.builtin.first_found', req_candidates, skip=True) }}" req_candidates: - - "{{ project_path | quote }}/collections/requirements.yml" - - "{{ project_path | quote }}/collections/requirements.yaml" - - "{{ project_path | quote }}/requirements.yml" - - "{{ project_path | quote }}/requirements.yaml" + files: + - "{{ project_path | quote }}/collections/requirements.yml" + - "{{ project_path | quote }}/collections/requirements.yaml" + skip: True changed_when: "'Nothing to do.' not in galaxy_collection_result.stdout" when: - "ansible_version.full is version_compare('2.9', '>=')" @@ -249,6 +251,7 @@ tags: - install_collections + # requirements.yml in project root can be either "old" (roles only) or "new" (collections+roles) format - name: Fetch galaxy roles and collections from requirements.(yml/yaml) ansible.builtin.command: cmd: "ansible-galaxy install -r {{ req_file }} {{ verbosity }}" @@ -256,8 +259,10 @@ vars: req_file: "{{ lookup('ansible.builtin.first_found', req_candidates, skip=True) }}" req_candidates: - - "{{ project_path | quote }}/requirements.yaml" - - "{{ project_path | quote }}/requirements.yml" + files: + - "{{ project_path | quote }}/requirements.yaml" + - "{{ project_path | quote }}/requirements.yml" + skip: True changed_when: "'Nothing to do.' not in galaxy_combined_result.stdout" when: - "ansible_version.full is version_compare('2.10', '>=')"