awx/awx_collection/template_galaxy.yml
2019-10-01 13:45:07 -04:00

29 lines
998 B
YAML

- hosts: localhost
gather_facts: false
connection: local
vars:
collection_package: awx
collection_namespace: awx
collection_version: 0.0.1 # not for updating, pass in extra_vars
tasks:
- name: Do file content replacements for non-default namespace or package name
block:
- name: Find all module files
find:
paths: "{{ playbook_dir }}/plugins/modules"
patterns: "*.py"
register: module_files
- name: Change files to support desired namespace and package names
replace:
path: "{{ item.path }}"
regexp: '^extends_documentation_fragment: awx.awx.auth$'
replace: 'extends_documentation_fragment: {{ collection_namespace }}.{{ collection_package }}.auth'
with_items: "{{ module_files.files }}"
when:
- (collection_package != 'awx') or (collection_namespace != 'awx')
- name: Template the galaxy.yml file
template: src={{ playbook_dir }}/galaxy.yml.j2 dest={{ playbook_dir }}/galaxy.yml