mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Address first_found skip bug (#15017)
* Address first_found skip bug * Don't attempt installing project root requirements.yml as v2 collection format
This commit is contained in:
@@ -221,8 +221,10 @@
|
|||||||
vars:
|
vars:
|
||||||
req_file: "{{ lookup('ansible.builtin.first_found', req_candidates, skip=True) }}"
|
req_file: "{{ lookup('ansible.builtin.first_found', req_candidates, skip=True) }}"
|
||||||
req_candidates:
|
req_candidates:
|
||||||
- "{{ project_path | quote }}/roles/requirements.yml"
|
files:
|
||||||
- "{{ project_path | quote }}/roles/requirements.yaml"
|
- "{{ project_path | quote }}/roles/requirements.yml"
|
||||||
|
- "{{ project_path | quote }}/roles/requirements.yaml"
|
||||||
|
skip: True
|
||||||
changed_when: "'was installed successfully' in galaxy_result.stdout"
|
changed_when: "'was installed successfully' in galaxy_result.stdout"
|
||||||
when:
|
when:
|
||||||
- roles_enabled | bool
|
- roles_enabled | bool
|
||||||
@@ -237,10 +239,10 @@
|
|||||||
vars:
|
vars:
|
||||||
req_file: "{{ lookup('ansible.builtin.first_found', req_candidates, skip=True) }}"
|
req_file: "{{ lookup('ansible.builtin.first_found', req_candidates, skip=True) }}"
|
||||||
req_candidates:
|
req_candidates:
|
||||||
- "{{ project_path | quote }}/collections/requirements.yml"
|
files:
|
||||||
- "{{ project_path | quote }}/collections/requirements.yaml"
|
- "{{ project_path | quote }}/collections/requirements.yml"
|
||||||
- "{{ project_path | quote }}/requirements.yml"
|
- "{{ project_path | quote }}/collections/requirements.yaml"
|
||||||
- "{{ project_path | quote }}/requirements.yaml"
|
skip: True
|
||||||
changed_when: "'Nothing to do.' not in galaxy_collection_result.stdout"
|
changed_when: "'Nothing to do.' not in galaxy_collection_result.stdout"
|
||||||
when:
|
when:
|
||||||
- "ansible_version.full is version_compare('2.9', '>=')"
|
- "ansible_version.full is version_compare('2.9', '>=')"
|
||||||
@@ -249,6 +251,7 @@
|
|||||||
tags:
|
tags:
|
||||||
- install_collections
|
- 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)
|
- name: Fetch galaxy roles and collections from requirements.(yml/yaml)
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: "ansible-galaxy install -r {{ req_file }} {{ verbosity }}"
|
cmd: "ansible-galaxy install -r {{ req_file }} {{ verbosity }}"
|
||||||
@@ -256,8 +259,10 @@
|
|||||||
vars:
|
vars:
|
||||||
req_file: "{{ lookup('ansible.builtin.first_found', req_candidates, skip=True) }}"
|
req_file: "{{ lookup('ansible.builtin.first_found', req_candidates, skip=True) }}"
|
||||||
req_candidates:
|
req_candidates:
|
||||||
- "{{ project_path | quote }}/requirements.yaml"
|
files:
|
||||||
- "{{ project_path | quote }}/requirements.yml"
|
- "{{ project_path | quote }}/requirements.yaml"
|
||||||
|
- "{{ project_path | quote }}/requirements.yml"
|
||||||
|
skip: True
|
||||||
changed_when: "'Nothing to do.' not in galaxy_combined_result.stdout"
|
changed_when: "'Nothing to do.' not in galaxy_combined_result.stdout"
|
||||||
when:
|
when:
|
||||||
- "ansible_version.full is version_compare('2.10', '>=')"
|
- "ansible_version.full is version_compare('2.10', '>=')"
|
||||||
|
|||||||
Reference in New Issue
Block a user