|
|
@ -1,4 +1,4 @@
|
|
|
|
- name: initialize collection structure
|
|
|
|
- name: initialize dev collection structure
|
|
|
|
command: ansible-galaxy collection init {{ item }} --init-path "{{ galaxy_dir }}/dev/ansible_collections" {{ galaxy_verbosity }}
|
|
|
|
command: ansible-galaxy collection init {{ item }} --init-path "{{ galaxy_dir }}/dev/ansible_collections" {{ galaxy_verbosity }}
|
|
|
|
loop:
|
|
|
|
loop:
|
|
|
|
- 'dev.collection1'
|
|
|
|
- 'dev.collection1'
|
|
|
@ -8,6 +8,13 @@
|
|
|
|
- 'dev.collection5'
|
|
|
|
- 'dev.collection5'
|
|
|
|
- 'dev.collection6'
|
|
|
|
- 'dev.collection6'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: initialize prod collection structure
|
|
|
|
|
|
|
|
command: ansible-galaxy collection init {{ item }} --init-path "{{ galaxy_dir }}/prod/ansible_collections" {{ galaxy_verbosity }}
|
|
|
|
|
|
|
|
loop:
|
|
|
|
|
|
|
|
- 'prod.collection1'
|
|
|
|
|
|
|
|
- 'prod.collection2'
|
|
|
|
|
|
|
|
- 'prod.collection3'
|
|
|
|
|
|
|
|
|
|
|
|
- name: replace the default version of the collections
|
|
|
|
- name: replace the default version of the collections
|
|
|
|
lineinfile:
|
|
|
|
lineinfile:
|
|
|
|
path: "{{ galaxy_dir }}/dev/ansible_collections/dev/{{ item.name }}/galaxy.yml"
|
|
|
|
path: "{{ galaxy_dir }}/dev/ansible_collections/dev/{{ item.name }}/galaxy.yml"
|
|
|
@ -82,6 +89,12 @@
|
|
|
|
environment:
|
|
|
|
environment:
|
|
|
|
ANSIBLE_COLLECTIONS_PATH: "{{ galaxy_dir }}/dev:{{ galaxy_dir }}/prod"
|
|
|
|
ANSIBLE_COLLECTIONS_PATH: "{{ galaxy_dir }}/dev:{{ galaxy_dir }}/prod"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
|
|
|
|
that:
|
|
|
|
|
|
|
|
- yaml_result[galaxy_dir ~ '/dev/ansible_collections'] != yaml_result[galaxy_dir ~ '/prod/ansible_collections']
|
|
|
|
|
|
|
|
vars:
|
|
|
|
|
|
|
|
yaml_result: '{{ list_result_yaml.stdout | from_yaml }}'
|
|
|
|
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
that:
|
|
|
|
- "item.value | length == 6"
|
|
|
|
- "item.value | length == 6"
|
|
|
@ -91,6 +104,7 @@
|
|
|
|
- "item.value['dev.collection5'].version == '*'"
|
|
|
|
- "item.value['dev.collection5'].version == '*'"
|
|
|
|
- "item.value['dev.collection6'].version == '*'"
|
|
|
|
- "item.value['dev.collection6'].version == '*'"
|
|
|
|
with_dict: "{{ list_result_yaml.stdout | from_yaml }}"
|
|
|
|
with_dict: "{{ list_result_yaml.stdout | from_yaml }}"
|
|
|
|
|
|
|
|
when: "'dev' in item.key"
|
|
|
|
|
|
|
|
|
|
|
|
- name: list collections in json format
|
|
|
|
- name: list collections in json format
|
|
|
|
command: ansible-galaxy collection list --format json
|
|
|
|
command: ansible-galaxy collection list --format json
|
|
|
@ -107,6 +121,7 @@
|
|
|
|
- "item.value['dev.collection5'].version == '*'"
|
|
|
|
- "item.value['dev.collection5'].version == '*'"
|
|
|
|
- "item.value['dev.collection6'].version == '*'"
|
|
|
|
- "item.value['dev.collection6'].version == '*'"
|
|
|
|
with_dict: "{{ list_result_json.stdout | from_json }}"
|
|
|
|
with_dict: "{{ list_result_json.stdout | from_json }}"
|
|
|
|
|
|
|
|
when: "'dev' in item.key"
|
|
|
|
|
|
|
|
|
|
|
|
- name: list single collection in json format
|
|
|
|
- name: list single collection in json format
|
|
|
|
command: "ansible-galaxy collection list {{ item.key }} --format json"
|
|
|
|
command: "ansible-galaxy collection list {{ item.key }} --format json"
|
|
|
|