2019-11-30 21:43:23 +03:00
---
2019-09-17 22:48:00 +03:00
- hosts : localhost
gather_facts : false
connection : local
vars :
2019-10-01 20:45:07 +03:00
collection_package : awx
collection_namespace : awx
collection_version : 0.0 .1 # not for updating, pass in extra_vars
2019-09-17 22:48:00 +03:00
tasks :
2019-11-30 21:43:23 +03:00
- name : Do file content replacements for non-default namespace or package name
block :
2019-09-18 15:43:36 +03:00
2020-03-04 21:53:06 +03:00
- name : Change module doc_fragments to support desired namespace and package names
2019-11-30 21:43:23 +03:00
replace :
2020-03-04 21:53:06 +03:00
path : "{{ item }}"
2019-11-30 21:43:23 +03:00
regexp: '^extends_documentation_fragment : awx.awx.auth$'
replace: 'extends_documentation_fragment : {{ collection_namespace }}.{{ collection_package }}.auth'
2020-03-04 21:53:06 +03:00
with_fileglob : "{{ playbook_dir }}/plugins/modules/tower_*.py"
2020-02-20 23:05:58 +03:00
loop_control :
2020-03-04 21:53:06 +03:00
label : "{{ item | basename }}"
2019-10-09 21:02:30 +03:00
2020-03-04 21:53:06 +03:00
- name : Change inventory file to support desired namespace and package names
2019-11-30 21:43:23 +03:00
replace :
path : "{{ playbook_dir }}/plugins/inventory/tower.py"
regexp : "^ NAME = 'awx.awx.tower' # REPLACE$"
replace : " NAME = '{{ collection_namespace }}.{{ collection_package }}.tower' # REPLACE"
when :
- (collection_package != 'awx') or (collection_namespace != 'awx')
2019-09-18 15:43:36 +03:00
2019-11-30 21:43:23 +03:00
- name : Template the galaxy.yml file
2020-03-04 21:53:06 +03:00
template :
src : "{{ playbook_dir }}/galaxy.yml.j2"
dest : "{{ playbook_dir }}/galaxy.yml"
force : true