mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 14:27:42 -02:30
Move to fileglob loop for yml requirement locations
This commit is contained in:
@@ -161,22 +161,17 @@
|
|||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: detect roles/requirements.(yml/yaml)
|
|
||||||
stat:
|
|
||||||
path: "{{project_path|quote}}/roles/requirements{{ item.ext }}"
|
|
||||||
with_items: "{{ yaml_exts }}"
|
|
||||||
register: doesRequirementsExist
|
|
||||||
|
|
||||||
- name: fetch galaxy roles from requirements.(yml/yaml)
|
- name: fetch galaxy roles from requirements.(yml/yaml)
|
||||||
command: >
|
command: >
|
||||||
ansible-galaxy role install -r {{ item.stat.path }}
|
ansible-galaxy role install -r {{ item }}
|
||||||
--roles-path {{projects_root}}/.__awx_cache/{{local_path}}/stage/requirements_roles
|
--roles-path {{projects_root}}/.__awx_cache/{{local_path}}/stage/requirements_roles
|
||||||
{{ ' -' + 'v' * ansible_verbosity if ansible_verbosity else '' }}
|
{{ ' -' + 'v' * ansible_verbosity if ansible_verbosity else '' }}
|
||||||
args:
|
args:
|
||||||
chdir: "{{project_path|quote}}"
|
chdir: "{{project_path|quote}}"
|
||||||
register: galaxy_result
|
register: galaxy_result
|
||||||
with_items: "{{ doesRequirementsExist.results }}"
|
with_fileglob:
|
||||||
when: item.stat.exists
|
- "{{project_path|quote}}/roles/requirements.yaml"
|
||||||
|
- "{{project_path|quote}}/roles/requirements.yml"
|
||||||
changed_when: "'was installed successfully' in galaxy_result.stdout"
|
changed_when: "'was installed successfully' in galaxy_result.stdout"
|
||||||
environment:
|
environment:
|
||||||
ANSIBLE_FORCE_COLOR: false
|
ANSIBLE_FORCE_COLOR: false
|
||||||
@@ -187,22 +182,19 @@
|
|||||||
- install_roles
|
- install_roles
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: detect collections/requirements.(yml/yaml)
|
|
||||||
stat:
|
|
||||||
path: "{{project_path|quote}}/collections/requirements{{ item.ext }}"
|
|
||||||
with_items: "{{ yaml_exts }}"
|
|
||||||
register: doesCollectionRequirementsExist
|
|
||||||
|
|
||||||
- name: fetch galaxy collections from collections/requirements.(yml/yaml)
|
- name: fetch galaxy collections from collections/requirements.(yml/yaml)
|
||||||
command: >
|
command: >
|
||||||
ansible-galaxy collection install -r {{ item.stat.path }}
|
ansible-galaxy collection install -r {{ item }}
|
||||||
--collections-path {{projects_root}}/.__awx_cache/{{local_path}}/stage/requirements_collections
|
--collections-path {{projects_root}}/.__awx_cache/{{local_path}}/stage/requirements_collections
|
||||||
{{ ' -' + 'v' * ansible_verbosity if ansible_verbosity else '' }}
|
{{ ' -' + 'v' * ansible_verbosity if ansible_verbosity else '' }}
|
||||||
args:
|
args:
|
||||||
chdir: "{{project_path|quote}}"
|
chdir: "{{project_path|quote}}"
|
||||||
register: galaxy_collection_result
|
register: galaxy_collection_result
|
||||||
with_items: "{{ doesCollectionRequirementsExist.results }}"
|
with_fileglob:
|
||||||
when: item.stat.exists
|
- "{{project_path|quote}}/collections/requirements.yaml"
|
||||||
|
- "{{project_path|quote}}/collections/requirements.yml"
|
||||||
|
- "{{project_path|quote}}/requirements.yaml"
|
||||||
|
- "{{project_path|quote}}/requirements.yml"
|
||||||
changed_when: "'Installing ' in galaxy_collection_result.stdout"
|
changed_when: "'Installing ' in galaxy_collection_result.stdout"
|
||||||
environment:
|
environment:
|
||||||
ANSIBLE_FORCE_COLOR: false
|
ANSIBLE_FORCE_COLOR: false
|
||||||
|
|||||||
Reference in New Issue
Block a user