From d62994ec02890a2855281c599b5ad6000cf19aaa Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Thu, 20 Feb 2020 15:05:58 -0500 Subject: [PATCH] Update metadata for the AWX collection --- Makefile | 19 +++++++++++++------ awx_collection/README.md | 13 +------------ awx_collection/galaxy.yml.j2 | 18 +++++++++++------- awx_collection/template_galaxy.yml | 4 +++- 4 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 40510c5e6f..069a6ff748 100644 --- a/Makefile +++ b/Makefile @@ -416,18 +416,25 @@ test_collection_all: prepare_collection_venv test_collection flake8_collection test_collection_sanity: rm -rf sanity - mkdir -p sanity/ansible_collections/awx - cp -Ra awx_collection sanity/ansible_collections/awx/awx # symlinks do not work - cd sanity/ansible_collections/awx/awx && git init && git add . # requires both this file structure and a git repo, so there you go - cd sanity/ansible_collections/awx/awx && ansible-test sanity + mkdir -p sanity/ansible_collections/$(COLLECTION_NAMESPACE) + cp -Ra awx_collection sanity/ansible_collections/$(COLLECTION_NAMESPACE)/awx # symlinks do not work + cd sanity/ansible_collections/$(COLLECTION_NAMESPACE)/awx && git init && git add . # requires both this file structure and a git repo, so there you go + cd sanity/ansible_collections/$(COLLECTION_NAMESPACE)/awx && ansible-test sanity + +# WARNING: symlinking a collection is fundamentally unstable +# this is for rapid development iteration with playbooks, do not use with other test targets +symlink_collection: + rm -rf ~/.ansible/collections/ansible_collections/$(COLLECTION_NAMESPACE) + mkdir -p ~/.ansible/collections/ansible_collections/$(COLLECTION_NAMESPACE) + ln -s $(shell pwd)/awx_collection ~/.ansible/collections/ansible_collections/$(COLLECTION_NAMESPACE)/awx build_collection: ansible-playbook -i localhost, awx_collection/template_galaxy.yml -e collection_package=$(COLLECTION_PACKAGE) -e collection_namespace=$(COLLECTION_NAMESPACE) -e collection_version=$(VERSION) ansible-galaxy collection build awx_collection --force --output-path=awx_collection install_collection: build_collection - rm -rf ~/.ansible/collections/ansible_collections/awx/awx - ansible-galaxy collection install awx_collection/awx-awx-$(VERSION).tar.gz + rm -rf ~/.ansible/collections/ansible_collections/$(COLLECTION_NAMESPACE)/awx + ansible-galaxy collection install awx_collection/$(COLLECTION_NAMESPACE)-awx-$(VERSION).tar.gz test_unit: @if [ "$(VENV_BASE)" ]; then \ diff --git a/awx_collection/README.md b/awx_collection/README.md index ae6d466e5e..a9a3c06374 100644 --- a/awx_collection/README.md +++ b/awx_collection/README.md @@ -27,10 +27,7 @@ The following notes are changes that may require changes to playbooks. To use this collection, the "old" tower-cli needs to be installed in the virtual environment where the collection runs. -You can install it from either: - - - https://github.com/ansible/tower-cli/ - - https://pypi.org/project/ansible-tower-cli/ +You can install it from [PyPI](https://pypi.org/project/ansible-tower-cli/). To use this collection in AWX, you should create a custom virtual environment to install the requirement into. NOTE: running locally, you will also need @@ -77,14 +74,6 @@ The build target `make build_collection` will template out a `galaxy.yml` file with automatic detection of the current AWX version. Then it builds the collection with the `ansible-galaxy` CLI. -## Roadmap - -Major future development items on the agenda include: - - - Removing tower-cli as a dependency - - Renaming the modules, for example `tower_organization` to just `organization` - and giving a deprecation period for the switch - ## Licensing All content in this folder is licensed under the same license as Ansible, diff --git a/awx_collection/galaxy.yml.j2 b/awx_collection/galaxy.yml.j2 index a04aeb7b67..87bdc97ae6 100644 --- a/awx_collection/galaxy.yml.j2 +++ b/awx_collection/galaxy.yml.j2 @@ -1,18 +1,22 @@ authors: -- Wayne Witzel III (@wwitzel3) -- Chris Meyers +- AWX Project Contributors dependencies: {} -description: Ansible modules that interact with the AWX API. -documentation: https://docs.ansible.com/ansible/latest/modules/list_of_web_infrastructure_modules.html#ansible-tower -homepage: https://ansible.com -issues: https://github.com/ansible/awx/issues +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: [] +tags: +- cloud +- infrastructure +- awx +- ansible +- automation version: {{ collection_version }} build_ignore: - setup.cfg diff --git a/awx_collection/template_galaxy.yml b/awx_collection/template_galaxy.yml index 8b22b915e9..adf302aa14 100644 --- a/awx_collection/template_galaxy.yml +++ b/awx_collection/template_galaxy.yml @@ -21,7 +21,9 @@ path: "{{ item.path }}" regexp: '^extends_documentation_fragment: awx.awx.auth$' replace: 'extends_documentation_fragment: {{ collection_namespace }}.{{ collection_package }}.auth' - with_items: "{{ module_files.files }}" + loop: "{{ module_files.files }}" + loop_control: + label: "{{ item.path[ playbook_dir | length :] }}" - name: Change files to support desired namespace and package names replace: