Rework some of our package tooling

This commit is contained in:
Caleb Boylan
2020-04-30 14:22:02 -07:00
committed by AlanCoding
parent 6a9423626c
commit 7478a2aa5e
8 changed files with 115 additions and 113 deletions

View File

@@ -0,0 +1,37 @@
- name: Set the collection version in the tower_api.py file
replace:
path: "{{ collection_path }}/plugins/module_utils/tower_api.py"
regexp: '^ _COLLECTION_VERSION =.*'
replace: ' _COLLECTION_VERSION = "{{ collection_version }}"'
- name: Set the collection type in the tower_api.py file
replace:
path: "{{ collection_path }}/plugins/module_utils/tower_api.py"
regexp: '^ _COLLECTION_TYPE =.*'
replace: ' _COLLECTION_TYPE = "{{ collection_namespace }}"'
- name: Do file content replacements for non-default namespace or package name
block:
- name: Change module doc_fragments to support desired namespace and package names
replace:
path: "{{ item }}"
regexp: '^extends_documentation_fragment: awx.awx.auth$'
replace: 'extends_documentation_fragment: {{ collection_namespace }}.{{ collection_package }}.auth'
with_fileglob: "{{ collection_path }}/plugins/modules/tower_*.py"
loop_control:
label: "{{ item | basename }}"
- name: Change inventory file to support desired namespace and package names
replace:
path: "{{ collection_path }}/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')
- name: Template the galaxy.yml file
template:
src: "{{ collection_path }}/tools/roles/template_galaxy/templates/galaxy.yml.j2"
dest: "{{ collection_path }}/galaxy.yml"
force: true

View File

@@ -0,0 +1,26 @@
authors:
- AWX Project Contributors <awx-project@googlegroups.com>
dependencies: {}
description: Ansible content that interacts with the AWX or Ansible Tower API.
documentation: https://github.com/ansible/awx/blob/devel/awx_collection/README.md
homepage: https://www.ansible.com/
issues: https://github.com/ansible/awx/issues?q=is%3Aissue+label%3Acomponent%3Aawx_collection
license:
- GPL-3.0-only
name: {{ collection_package }}
namespace: {{ collection_namespace }}
readme: README.md
repository: https://github.com/ansible/awx
tags:
- cloud
- infrastructure
- awx
- ansible
- automation
version: {{ collection_version }}
build_ignore:
- tools
- setup.cfg
- galaxy.yml.j2
- template_galaxy.yml
- '*.tar.gz'