diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0561df271186..e22b7869e18b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,8 @@ env: DEV_DOCKER_OWNER: ${{ github.repository_owner }} COMPOSE_TAG: ${{ github.base_ref || github.ref_name || 'devel' }} UPSTREAM_REPOSITORY_ID: 91594105 + COLLECTION_NAMESPACE: ${{ github.repository == 'ansible/tower' && 'ansible' || 'awx' }} + COLLECTION_PACKAGE: ${{ github.repository == 'ansible/tower' && 'controller' || 'awx' }} on: pull_request: push: @@ -245,6 +247,13 @@ jobs: DEV_DOCKER_TAG_BASE: local HEADLESS: yes + - name: Convert awx-operator playbooks to ansible.controller FQCN + if: github.repository == 'ansible/tower' + working-directory: awx-operator + run: | + find molecule/ -type f \( -name '*.yml' -o -name '*.yaml' \) \ + -exec sed -i 's/awx\.awx/ansible.controller/g' {} + + - name: Run test deployment with awx-operator working-directory: awx-operator id: awx_operator_test @@ -271,6 +280,7 @@ jobs: AWX_TEST_VERSION: ci AWX_EE_TEST_IMAGE: quay.io/ansible/awx-ee:latest STORE_DEBUG_OUTPUT: true + CONTROLLER_OPTIONAL_API_URLPATTERN_PREFIX: /api/ - name: Collect awx-operator logs on timeout # Only run on timeout; normal failures should use molecule's built-in log collection. @@ -311,20 +321,28 @@ jobs: - stable-2.17 # - devel steps: + - name: Verify FQCN conversion was applied + if: github.repository == 'ansible/tower' + uses: actions/checkout@v4 + with: + persist-credentials: false + show-progress: false + + - name: Check for unconverted references + if: github.repository == 'ansible/tower' + run: | + if grep -rq 'awx\.awx' awx_collection/; then + echo "::error::Found unconverted awx.awx references. Run: ./awx_collection/tools/replace_fqcn.sh" + grep -rn 'awx\.awx' awx_collection/ + exit 1 + fi + - name: Perform sanity testing uses: ansible-community/ansible-test-gh-action@release/v1 with: ansible-core-version: ${{ matrix.ansible }} codecov-token: ${{ secrets.CODECOV_TOKEN }} collection-root: awx_collection - pre-test-cmd: >- - ansible-playbook - -i localhost, - tools/template_galaxy.yml - -e collection_package=awx - -e collection_namespace=awx - -e collection_version=1.0.0 - -e '{"awx_template_version": false}' testing-type: sanity - name: Upload awx jUnit test reports to the unified dashboard @@ -394,11 +412,13 @@ jobs: echo 'username = admin' >> ~/.tower_cli.cfg echo 'password = password' >> ~/.tower_cli.cfg echo 'verify_ssl = false' >> ~/.tower_cli.cfg + echo 'api_prefix = /api/' >> ~/.tower_cli.cfg TARGETS="$(ls awx_collection/tests/integration/targets | grep '${{ matrix.target-regex.regex }}' | tr '\n' ' ')" export PYTHONPATH="$(python -c 'import site; print(":".join(site.getsitepackages()))')${PYTHONPATH:+:$PYTHONPATH}" - make COLLECTION_VERSION=100.100.100-git COLLECTION_TEST_TARGET="--requirements $TARGETS" test_collection_integration + make COLLECTION_VERSION=100.100.100 COLLECTION_TEST_TARGET="--requirements $TARGETS" test_collection_integration env: ANSIBLE_TEST_PREFER_PODMAN: 1 + CONTROLLER_OPTIONAL_API_URLPATTERN_PREFIX: /api/ - name: Upload test coverage to Codecov if: >- @@ -426,7 +446,7 @@ jobs: if: always() with: name: coverage-${{ matrix.target-regex.name }} - path: ~/.ansible/collections/ansible_collections/awx/awx/tests/output/coverage/ + path: ~/.ansible/collections/ansible_collections/${{ env.COLLECTION_NAMESPACE }}/${{ env.COLLECTION_PACKAGE }}/tests/output/coverage/ retention-days: 1 - uses: ./.github/actions/upload_awx_devel_logs @@ -468,10 +488,10 @@ jobs: - name: Combine coverage run: | - make COLLECTION_VERSION=100.100.100-git install_collection - mkdir -p ~/.ansible/collections/ansible_collections/awx/awx/tests/output/coverage - cp -rv coverage/* ~/.ansible/collections/ansible_collections/awx/awx/tests/output/coverage/ - cd ~/.ansible/collections/ansible_collections/awx/awx + make COLLECTION_VERSION=100.100.100 install_collection + mkdir -p ~/.ansible/collections/ansible_collections/${{ env.COLLECTION_NAMESPACE }}/${{ env.COLLECTION_PACKAGE }}/tests/output/coverage + cp -rv coverage/* ~/.ansible/collections/ansible_collections/${{ env.COLLECTION_NAMESPACE }}/${{ env.COLLECTION_PACKAGE }}/tests/output/coverage/ + cd ~/.ansible/collections/ansible_collections/${{ env.COLLECTION_NAMESPACE }}/${{ env.COLLECTION_PACKAGE }} hash -r # Rehash to pick up newly installed scripts PATH="$(python -c 'import sys; import os; print(os.path.dirname(sys.executable))'):$PATH" ansible-test coverage combine --requirements PATH="$(python -c 'import sys; import os; print(os.path.dirname(sys.executable))'):$PATH" ansible-test coverage html @@ -487,4 +507,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: awx-collection-integration-coverage-html - path: ~/.ansible/collections/ansible_collections/awx/awx/tests/output/reports/coverage + path: ~/.ansible/collections/ansible_collections/${{ env.COLLECTION_NAMESPACE }}/${{ env.COLLECTION_PACKAGE }}/tests/output/reports/coverage diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml index ba723c07f975..339096436a6d 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -3,6 +3,8 @@ name: Promote Release env: LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting + COLLECTION_NAMESPACE: ${{ github.repository == 'ansible/tower' && 'ansible' || 'awx' }} + COLLECTION_PACKAGE: ${{ github.repository == 'ansible/tower' && 'controller' || 'awx' }} on: release: @@ -17,7 +19,7 @@ permissions: jobs: promote: - if: endsWith(github.repository, '/awx') + if: github.repository_owner == 'ansible' runs-on: ubuntu-latest timeout-minutes: 90 steps: @@ -42,42 +44,24 @@ jobs: run: | python${{ env.py_version }} -m pip install wheel twine setuptools-scm - - name: Set official collection namespace - run: echo collection_namespace=awx >> $GITHUB_ENV - if: ${{ github.repository_owner == 'ansible' }} - - - name: Set unofficial collection namespace - run: echo collection_namespace=${{ github.repository_owner }} >> $GITHUB_ENV - if: ${{ github.repository_owner != 'ansible' }} - - name: Build collection and publish to galaxy env: - COLLECTION_NAMESPACE: ${{ env.collection_namespace }} COLLECTION_VERSION: ${{ env.TAG_NAME }} - COLLECTION_TEMPLATE_VERSION: true run: | sudo apt-get install jq make build_collection - count=$(curl -s https://galaxy.ansible.com/api/v3/plugin/ansible/search/collection-versions/\?namespace\=${COLLECTION_NAMESPACE}\&name\=awx\&version\=${COLLECTION_VERSION} | jq .meta.count) + count=$(curl -s https://galaxy.ansible.com/api/v3/plugin/ansible/search/collection-versions/\?namespace\=${COLLECTION_NAMESPACE}\&name\=${COLLECTION_PACKAGE}\&version\=${COLLECTION_VERSION} | jq .meta.count) if [[ "$count" == "1" ]]; then echo "Galaxy release already done"; elif [[ "$count" == "0" ]]; then ansible-galaxy collection publish \ --token=${{ secrets.GALAXY_TOKEN }} \ - awx_collection_build/${COLLECTION_NAMESPACE}-awx-${COLLECTION_VERSION}.tar.gz; + awx_collection_build/${COLLECTION_NAMESPACE}-${COLLECTION_PACKAGE}-${COLLECTION_VERSION}.tar.gz; else echo "Unexpected count from galaxy search: $count"; exit 1; fi - - name: Set official pypi info - run: echo pypi_repo=pypi >> $GITHUB_ENV - if: ${{ github.repository_owner == 'ansible' }} - - - name: Set unofficial pypi info - run: echo pypi_repo=testpypi >> $GITHUB_ENV - if: ${{ github.repository_owner != 'ansible' }} - - name: Build awxkit and upload to pypi env: SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.TAG_NAME }} @@ -85,7 +69,7 @@ jobs: git reset --hard cd awxkit && python3 setup.py sdist bdist_wheel twine upload \ - -r ${{ env.pypi_repo }} \ + -r pypi \ -u ${{ secrets.PYPI_USERNAME }} \ -p ${{ secrets.PYPI_PASSWORD }} \ dist/* diff --git a/Makefile b/Makefile index d4630f6515ae..082150401ee8 100644 --- a/Makefile +++ b/Makefile @@ -29,11 +29,10 @@ PARALLEL_TESTS ?= -n auto COLLECTION_TEST_TARGET ?= # Python version for ansible-test (must be 3.11, 3.12, or 3.13) ANSIBLE_TEST_PYTHON_VERSION ?= 3.13 -# args for collection install -COLLECTION_PACKAGE ?= awx -COLLECTION_NAMESPACE ?= awx -COLLECTION_INSTALL = $(HOME)/.ansible/collections/ansible_collections/$(COLLECTION_NAMESPACE)/$(COLLECTION_PACKAGE) -COLLECTION_TEMPLATE_VERSION ?= false +# args for collection install - read namespace and name from galaxy.yml +COLLECTION_NAMESPACE ?= $(shell grep '^namespace:' awx_collection/galaxy.yml | awk '{print $$2}') +COLLECTION_PACKAGE ?= $(shell grep '^name:' awx_collection/galaxy.yml | awk '{print $$2}') +COLLECTION_INSTALL = ~/.ansible/collections/ansible_collections/$(COLLECTION_NAMESPACE)/$(COLLECTION_PACKAGE) # NOTE: This defaults the container image version to the branch that's active COMPOSE_TAG ?= $(GIT_BRANCH) @@ -433,10 +432,7 @@ symlink_collection: awx_collection_build: $(shell find awx_collection -type f) $(ANSIBLE_PLAYBOOK) -i localhost, awx_collection/tools/template_galaxy.yml \ - -e collection_package=$(COLLECTION_PACKAGE) \ - -e collection_namespace=$(COLLECTION_NAMESPACE) \ - -e collection_version=$(COLLECTION_VERSION) \ - -e '{"awx_template_version": $(COLLECTION_TEMPLATE_VERSION)}' + -e collection_version=$(COLLECTION_VERSION) ansible-galaxy collection build awx_collection_build --force --output-path=awx_collection_build build_collection: awx_collection_build diff --git a/awx_collection/README.md b/awx_collection/README.md index cba0db69b908..5a3fa16aabf6 100644 --- a/awx_collection/README.md +++ b/awx_collection/README.md @@ -1,17 +1,5 @@ # AWX Ansible Collection -[comment]: # (*******************************************************) -[comment]: # (* *) -[comment]: # (* WARNING *) -[comment]: # (* *) -[comment]: # (* This file is templated and not to be *) -[comment]: # (* edited directly! Instead modify: *) -[comment]: # (* tools/roles/template_galaxy/templates/README.md.j2 *) -[comment]: # (* *) -[comment]: # (* Changes to the base README.md file are refreshed *) -[comment]: # (* upon build of the collection *) -[comment]: # (*******************************************************) - This Ansible collection allows for easy interaction with an AWX server via Ansible playbooks. This source for this collection lives in the `awx_collection` folder inside of the @@ -32,7 +20,7 @@ Installing the `tar.gz` involves no special instructions. ## Running Non-deprecated modules in this collection have no Python requirements, but -may require the AWX CLI +may require the official [AWX CLI](https://pypi.org/project/awxkit/) in the future. The `DOCUMENTATION` for each module will report this. You can specify authentication by host, username, and password. @@ -42,6 +30,7 @@ These can be specified via (from highest to lowest precedence): - direct module parameters - environment variables (most useful when running against localhost) - a config file path specified by the `tower_config_file` parameter + - a config file at `./tower_cli.cfg`, i.e. in the current directory - a config file at `~/.tower_cli.cfg` - a config file at `/etc/tower/tower_cli.cfg` @@ -55,9 +44,17 @@ username = foo password = bar ``` +or like this: + +``` +host: https://localhost:8043 +verify_ssl: true +oauth_token: +``` + ## Release and Upgrade Notes -Notable releases of the `awx.awx` collection: +Notable releases of the Galaxy vendored collection: - 7.0.0 is intended to be identical to the content prior to the migration, aside from changes necessary to function as a collection. - 11.0.0 has no non-deprecated modules that depend on the deprecated `tower-cli` [PyPI](https://pypi.org/project/ansible-tower-cli/). diff --git a/awx_collection/galaxy.yml b/awx_collection/galaxy.yml index 624752e568ed..5da7934cb239 100644 --- a/awx_collection/galaxy.yml +++ b/awx_collection/galaxy.yml @@ -1,14 +1,3 @@ -# (********************************************************) -# (* *) -# (* WARNING *) -# (* *) -# (* This file is managed by Ansible and not to be *) -# (* edited directly! Instead modify: *) -# (* tools/roles/template_galaxy/templates/galaxy.yml.j2 *) -# (* *) -# (* Changes to the base galaxy.yml file are refreshed *) -# (* upon build of the collection *) -# (********************************************************) --- authors: - AWX Project Contributors @@ -33,6 +22,4 @@ version: 0.0.1-devel build_ignore: - tools - setup.cfg - - galaxy.yml.j2 - - template_galaxy.yml - '*.tar.gz' diff --git a/awx_collection/plugins/doc_fragments/auth_plugin.py b/awx_collection/plugins/doc_fragments/auth_plugin.py index 44ad326eda22..60edb8433678 100644 --- a/awx_collection/plugins/doc_fragments/auth_plugin.py +++ b/awx_collection/plugins/doc_fragments/auth_plugin.py @@ -76,6 +76,13 @@ class ModuleDocFragment(object): why: Support for AAP variables alternatives: 'AAP_REQUEST_TIMEOUT' aliases: [ aap_request_timeout ] + api_prefix: + description: + - Override the API URL prefix for this request. + - Defaults to /api/ for AWX or /api/controller/ for Automation Controller. + type: str + env: + - name: CONTROLLER_OPTIONAL_API_URLPATTERN_PREFIX notes: - If no I(config_file) is provided we will attempt to use the tower-cli library defaults to find your host information. diff --git a/awx_collection/plugins/lookup/controller_api.py b/awx_collection/plugins/lookup/controller_api.py index d1b213f12bfe..32768cc198f2 100644 --- a/awx_collection/plugins/lookup/controller_api.py +++ b/awx_collection/plugins/lookup/controller_api.py @@ -79,7 +79,7 @@ - name: Report the usernames of all users with admin privs debug: - msg: "Admin users: {{ query('awx.awx.controller_api', 'users', query_params={ 'is_superuser': true }) | map(attribute='username') | join(', ') }}" + msg: "Admins: {{ query('awx.awx.controller_api', 'users', query_params={ 'is_superuser': true }) | map(attribute='username') | join(', ') }}" - name: debug all organizations in a loop # use query to return a list debug: @@ -89,14 +89,14 @@ label: "{{ item['name'] }}" - name: Make sure user 'john' is an org admin of the default org if the user exists - role: + awx.awx.role: organization: Default role: admin user: john when: "lookup('awx.awx.controller_api', 'users', query_params={ 'username': 'john' }) | length == 1" - name: Create an inventory group with all 'foo' hosts - group: + awx.awx.group: name: "Foo Group" inventory: "Demo Inventory" hosts: >- diff --git a/awx_collection/plugins/module_utils/controller_api.py b/awx_collection/plugins/module_utils/controller_api.py index c559156116e1..5d2af1d6b47c 100644 --- a/awx_collection/plugins/module_utils/controller_api.py +++ b/awx_collection/plugins/module_utils/controller_api.py @@ -92,12 +92,14 @@ class ControllerModule(AnsibleModule): 'password': 'controller_password', 'verify_ssl': 'validate_certs', 'request_timeout': 'request_timeout', + 'api_prefix': 'api_prefix', } host = '127.0.0.1' username = None password = None verify_ssl = True request_timeout = 10 + api_prefix = None authenticated = False config_name = 'tower_cli.cfg' version_checked = False @@ -308,13 +310,22 @@ class ControllerAPIModule(ControllerModule): # TODO: Move the collection version check into controller_module.py # This gets set by the make process so whatever is in here is irrelevant _COLLECTION_VERSION = "0.0.1-devel" - _COLLECTION_TYPE = "awx" - # This maps the collections type (awx/tower) to the values returned by the API + # The FQCN is the canonical identifier for this collection. + # On upstream (awx) this is "awx.awx"; on downstream (tower) the + # replace_fqcn.sh script converts it to "ansible.controller". + # _COLLECTION_TYPE is derived from the FQCN automatically. + _COLLECTION_FQCN = "awx.awx" + # This maps the collections type (awx/controller) to the values returned by the API # Those values can be found in awx/api/generics.py line 204 collection_to_version = { 'awx': 'AWX', 'controller': 'Red Hat Ansible Automation Platform', } + + @property + def _COLLECTION_TYPE(self): + return self._COLLECTION_FQCN.split('.')[1] + session = None IDENTITY_FIELDS = {'users': 'username', 'workflow_job_template_nodes': 'identifier', 'instances': 'hostname'} ENCRYPTED_STRING = "$encrypted$" @@ -630,6 +641,8 @@ def make_request(self, method, endpoint, *args, **kwargs): def api_path(self, app_key=None): + if self.api_prefix: + return self.api_prefix default_api_path = "/api/" if self._COLLECTION_TYPE != "awx" or app_key is not None: if app_key is None: diff --git a/awx_collection/plugins/modules/ad_hoc_command.py b/awx_collection/plugins/modules/ad_hoc_command.py index 10d1c7e3520a..cc7bc9803430 100644 --- a/awx_collection/plugins/modules/ad_hoc_command.py +++ b/awx_collection/plugins/modules/ad_hoc_command.py @@ -96,7 +96,7 @@ EXAMPLES = ''' - name: Launch an Ad Hoc Command waiting for it to finish - ad_hoc_command: + awx.awx.ad_hoc_command: inventory: Demo Inventory credential: Demo Credential module_name: command diff --git a/awx_collection/plugins/modules/ad_hoc_command_cancel.py b/awx_collection/plugins/modules/ad_hoc_command_cancel.py index 12cdaeaaf949..56d47a8ad0c7 100644 --- a/awx_collection/plugins/modules/ad_hoc_command_cancel.py +++ b/awx_collection/plugins/modules/ad_hoc_command_cancel.py @@ -48,7 +48,7 @@ EXAMPLES = ''' - name: Cancel command - ad_hoc_command_cancel: + awx.awx.ad_hoc_command_cancel: command_id: command.id ''' diff --git a/awx_collection/plugins/modules/ad_hoc_command_wait.py b/awx_collection/plugins/modules/ad_hoc_command_wait.py index cedc4aa932f6..510a9705aa94 100644 --- a/awx_collection/plugins/modules/ad_hoc_command_wait.py +++ b/awx_collection/plugins/modules/ad_hoc_command_wait.py @@ -41,14 +41,14 @@ EXAMPLES = ''' - name: Launch an ad hoc command - ad_hoc_command: + awx.awx.ad_hoc_command: inventory: "Demo Inventory" credential: "Demo Credential" wait: false register: command - name: Wait for ad joc command max 120s - ad_hoc_command_wait: + awx.awx.ad_hoc_command_wait: command_id: "{{ command.id }}" timeout: 120 ''' diff --git a/awx_collection/plugins/modules/bulk_host_create.py b/awx_collection/plugins/modules/bulk_host_create.py index dcd32bf44e7f..76593ad2c541 100644 --- a/awx_collection/plugins/modules/bulk_host_create.py +++ b/awx_collection/plugins/modules/bulk_host_create.py @@ -56,7 +56,7 @@ EXAMPLES = ''' - name: Bulk host create - bulk_host_create: + awx.awx.bulk_host_create: inventory: 1 hosts: - name: foobar.org diff --git a/awx_collection/plugins/modules/bulk_host_delete.py b/awx_collection/plugins/modules/bulk_host_delete.py index 12468e6028ff..4b63d75a6aa0 100644 --- a/awx_collection/plugins/modules/bulk_host_delete.py +++ b/awx_collection/plugins/modules/bulk_host_delete.py @@ -29,7 +29,7 @@ EXAMPLES = ''' - name: Bulk host delete - bulk_host_delete: + awx.awx.bulk_host_delete: hosts: - 1 - 2 diff --git a/awx_collection/plugins/modules/bulk_job_launch.py b/awx_collection/plugins/modules/bulk_job_launch.py index 00fa338dde4c..4e9db185e6f3 100644 --- a/awx_collection/plugins/modules/bulk_job_launch.py +++ b/awx_collection/plugins/modules/bulk_job_launch.py @@ -175,7 +175,7 @@ EXAMPLES = ''' - name: Launch bulk jobs - bulk_job_launch: + awx.awx.bulk_job_launch: name: My Bulk Job Launch jobs: - unified_job_template: 7 @@ -196,7 +196,7 @@ inventory: Demo Inventory - name: Launch bulk jobs with lookup plugin - bulk_job_launch: + awx.awx.bulk_job_launch: name: My Bulk Job Launch jobs: - unified_job_template: 7 diff --git a/awx_collection/plugins/modules/controller_meta.py b/awx_collection/plugins/modules/controller_meta.py index d0812c9753f3..55dc463dce53 100644 --- a/awx_collection/plugins/modules/controller_meta.py +++ b/awx_collection/plugins/modules/controller_meta.py @@ -49,7 +49,7 @@ EXAMPLES = ''' -- controller_meta: +- awx.awx.controller_meta: register: result - name: Show details about the collection @@ -66,9 +66,9 @@ def main(): module = ControllerAPIModule(argument_spec={}) - namespace = {'awx': 'awx', 'controller': 'ansible'}.get(module._COLLECTION_TYPE, 'unknown') - namespace_name = '{0}.{1}'.format(namespace, module._COLLECTION_TYPE) - module.exit_json(prefix=namespace_name, name=module._COLLECTION_TYPE, namespace=namespace, version=module._COLLECTION_VERSION) + fqcn = module._COLLECTION_FQCN + namespace, name = fqcn.split('.') + module.exit_json(prefix=fqcn, name=name, namespace=namespace, version=module._COLLECTION_VERSION) if __name__ == '__main__': diff --git a/awx_collection/plugins/modules/credential.py b/awx_collection/plugins/modules/credential.py index b7ed60301554..22ebd1d20ebf 100644 --- a/awx_collection/plugins/modules/credential.py +++ b/awx_collection/plugins/modules/credential.py @@ -121,7 +121,7 @@ EXAMPLES = ''' - name: Add machine credential - credential: + awx.awx.credential: name: Team Name description: Team Description organization: test-org @@ -130,7 +130,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Create a valid SCM credential from a private_key file - credential: + awx.awx.credential: name: SCM Credential organization: Default state: present @@ -147,7 +147,7 @@ register: aws_ssh_key - name: Add Credential - credential: + awx.awx.credential: name: Workshop Credential credential_type: Machine organization: Default @@ -157,7 +157,7 @@ delegate_to: localhost - name: Add Credential with Custom Credential Type - credential: + awx.awx.credential: name: Workshop Credential credential_type: MyCloudCredential organization: Default @@ -166,7 +166,7 @@ controller_host: https://localhost - name: Create a Vault credential (example for notes) - credential: + awx.awx.credential: name: Example password credential_type: Vault organization: Default @@ -175,7 +175,7 @@ vault_id: 'My ID' - name: Bad password update (will replace vault_id) - credential: + awx.awx.credential: name: Example password credential_type: Vault organization: Default @@ -183,14 +183,14 @@ vault_password: 'new_password' - name: Another bad password update (will replace vault_id) - credential: + awx.awx.credential: name: Example password credential_type: Vault organization: Default vault_password: 'new_password' - name: A safe way to update a password and keep vault_id - credential: + awx.awx.credential: name: Example password credential_type: Vault organization: Default @@ -199,7 +199,7 @@ vault_id: 'My ID' - name: Copy Credential - credential: + awx.awx.credential: name: Copy password copy_from: Example password credential_type: Vault diff --git a/awx_collection/plugins/modules/credential_input_source.py b/awx_collection/plugins/modules/credential_input_source.py index 3cc0cc24578f..e22fe4a9967f 100644 --- a/awx_collection/plugins/modules/credential_input_source.py +++ b/awx_collection/plugins/modules/credential_input_source.py @@ -58,7 +58,7 @@ EXAMPLES = ''' - name: Use CyberArk Lookup credential as password source - credential_input_source: + awx.awx.credential_input_source: input_field_name: password target_credential: new_cred source_credential: cyberark_lookup diff --git a/awx_collection/plugins/modules/credential_type.py b/awx_collection/plugins/modules/credential_type.py index 189313486ae8..e2cd04ff8940 100644 --- a/awx_collection/plugins/modules/credential_type.py +++ b/awx_collection/plugins/modules/credential_type.py @@ -66,7 +66,7 @@ EXAMPLES = ''' -- credential_type: +- awx.awx.credential_type: name: Nexus description: Credentials type for Nexus kind: cloud @@ -75,7 +75,7 @@ state: present validate_certs: false -- credential_type: +- awx.awx.credential_type: name: Nexus state: absent ''' diff --git a/awx_collection/plugins/modules/execution_environment.py b/awx_collection/plugins/modules/execution_environment.py index 38c5ecb516d2..b1e1847f150b 100644 --- a/awx_collection/plugins/modules/execution_environment.py +++ b/awx_collection/plugins/modules/execution_environment.py @@ -64,7 +64,7 @@ EXAMPLES = ''' - name: Add EE to the controller instance - execution_environment: + awx.awx.execution_environment: name: "My EE" image: quay.io/ansible/awx-ee ''' diff --git a/awx_collection/plugins/modules/export.py b/awx_collection/plugins/modules/export.py index 4acd7db20d45..5d6fc44d0c7b 100644 --- a/awx_collection/plugins/modules/export.py +++ b/awx_collection/plugins/modules/export.py @@ -100,20 +100,20 @@ EXAMPLES = ''' - name: Export all assets - export: + awx.awx.export: all: true - name: Export all inventories - export: + awx.awx.export: inventory: 'all' - name: Export a job template named "My Template" and all Credentials - export: + awx.awx.export: job_templates: "My Template" credentials: 'all' - name: Export a list of inventories - export: + awx.awx.export: inventory: ['My Inventory 1', 'My Inventory 2'] ''' diff --git a/awx_collection/plugins/modules/group.py b/awx_collection/plugins/modules/group.py index a746f646d4e6..4df3e5c9d86d 100644 --- a/awx_collection/plugins/modules/group.py +++ b/awx_collection/plugins/modules/group.py @@ -79,7 +79,7 @@ EXAMPLES = ''' - name: Add group - group: + awx.awx.group: name: localhost description: "Local Host Group" inventory: "Local Inventory" @@ -87,7 +87,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Add group - group: + awx.awx.group: name: Cities description: "Local Host Group" inventory: Default Inventory diff --git a/awx_collection/plugins/modules/host.py b/awx_collection/plugins/modules/host.py index 9b8760b88fe1..026f622e801a 100644 --- a/awx_collection/plugins/modules/host.py +++ b/awx_collection/plugins/modules/host.py @@ -59,7 +59,7 @@ EXAMPLES = ''' - name: Add host - host: + awx.awx.host: name: localhost description: "Local Host Group" inventory: "Local Inventory" diff --git a/awx_collection/plugins/modules/import.py b/awx_collection/plugins/modules/import.py index ad53a91dd77d..e828af1f1f81 100644 --- a/awx_collection/plugins/modules/import.py +++ b/awx_collection/plugins/modules/import.py @@ -35,16 +35,16 @@ EXAMPLES = ''' - name: Export all assets - export: + awx.awx.export: all: true register: export_output - name: Import all assets from our export - import: + awx.awx.import: assets: "{{ export_output.assets }}" - name: Load data from a json file created by a command like awx export --organization Default - import: + awx.awx.import: assets: "{{ lookup('file', 'org.json') | from_json() }}" ''' diff --git a/awx_collection/plugins/modules/inventory.py b/awx_collection/plugins/modules/inventory.py index 67ebe93f0683..2227371016b8 100644 --- a/awx_collection/plugins/modules/inventory.py +++ b/awx_collection/plugins/modules/inventory.py @@ -86,7 +86,7 @@ EXAMPLES = ''' - name: Add inventory - inventory: + awx.awx.inventory: name: "Foo Inventory" description: "Our Foo Cloud Servers" organization: "Bar Org" @@ -94,7 +94,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Copy inventory - inventory: + awx.awx.inventory: name: Copy Foo Inventory copy_from: Default Inventory description: "Our Foo Cloud Servers" @@ -105,7 +105,7 @@ # of kind "constructed" and then editing the automatically generated inventory # source for that inventory. - name: Add constructed inventory with two existing input inventories - inventory: + awx.awx.inventory: name: My Constructed Inventory organization: Default kind: constructed @@ -114,7 +114,7 @@ - "East Datacenter" - name: Edit the constructed inventory source - inventory_source: + awx.awx.inventory_source: # The constructed inventory source will always be in the format: # "Auto-created source for: " name: "Auto-created source for: My Constructed Inventory" diff --git a/awx_collection/plugins/modules/inventory_source.py b/awx_collection/plugins/modules/inventory_source.py index 16a05b093e99..8413f3d87ff3 100644 --- a/awx_collection/plugins/modules/inventory_source.py +++ b/awx_collection/plugins/modules/inventory_source.py @@ -145,7 +145,7 @@ EXAMPLES = ''' - name: Add an inventory source - inventory_source: + awx.awx.inventory_source: name: "source-inventory" description: Source for inventory inventory: previously-created-inventory diff --git a/awx_collection/plugins/modules/inventory_source_update.py b/awx_collection/plugins/modules/inventory_source_update.py index 6e90e1ccf78f..ba1d3fc1e33b 100644 --- a/awx_collection/plugins/modules/inventory_source_update.py +++ b/awx_collection/plugins/modules/inventory_source_update.py @@ -58,13 +58,13 @@ EXAMPLES = ''' - name: Update a single inventory source - inventory_source_update: + awx.awx.inventory_source_update: name: "Example Inventory Source" inventory: "My Inventory" organization: Default - name: Update all inventory sources - inventory_source_update: + awx.awx.inventory_source_update: name: "{{ item }}" inventory: "My Other Inventory" loop: "{{ query('awx.awx.controller_api', 'inventory_sources', query_params={ 'inventory': 30 }, return_ids=True ) }}" diff --git a/awx_collection/plugins/modules/job_cancel.py b/awx_collection/plugins/modules/job_cancel.py index a987b7bec513..8ac579f8606a 100644 --- a/awx_collection/plugins/modules/job_cancel.py +++ b/awx_collection/plugins/modules/job_cancel.py @@ -36,7 +36,7 @@ EXAMPLES = ''' - name: Cancel job - job_cancel: + awx.awx.job_cancel: job_id: job.id ''' diff --git a/awx_collection/plugins/modules/job_launch.py b/awx_collection/plugins/modules/job_launch.py index 19500b73a5b9..2fb8daa50a05 100644 --- a/awx_collection/plugins/modules/job_launch.py +++ b/awx_collection/plugins/modules/job_launch.py @@ -134,12 +134,12 @@ EXAMPLES = ''' - name: Launch a job - job_launch: + awx.awx.job_launch: job_template: "My Job Template" register: job - name: Launch a job template with extra_vars on remote controller instance - job_launch: + awx.awx.job_launch: job_template: "My Job Template" extra_vars: var1: "My First Variable" @@ -148,7 +148,7 @@ job_type: run - name: Launch a job with inventory and credential - job_launch: + awx.awx.job_launch: job_template: "My Job Template" inventory: "My Inventory" credentials: @@ -156,7 +156,7 @@ - "suplementary cred" register: job - name: Wait for job max 120s - job_wait: + awx.awx.job_wait: job_id: "{{ job.id }}" timeout: 120 ''' diff --git a/awx_collection/plugins/modules/job_list.py b/awx_collection/plugins/modules/job_list.py index 95f9ea6f37f2..161abf896e6b 100644 --- a/awx_collection/plugins/modules/job_list.py +++ b/awx_collection/plugins/modules/job_list.py @@ -45,7 +45,7 @@ EXAMPLES = ''' - name: List running jobs for the testing.yml playbook - job_list: + awx.awx.job_list: status: running query: {"playbook": "testing.yml"} controller_config_file: "~/tower_cli.cfg" diff --git a/awx_collection/plugins/modules/job_template.py b/awx_collection/plugins/modules/job_template.py index 3ba9883f296c..7bbea9c94e27 100644 --- a/awx_collection/plugins/modules/job_template.py +++ b/awx_collection/plugins/modules/job_template.py @@ -327,7 +327,7 @@ EXAMPLES = ''' - name: Create Ping job template - job_template: + awx.awx.job_template: name: "Ping" job_type: "run" organization: "Default" @@ -343,20 +343,20 @@ survey_spec: "{{ lookup('file', 'my_survey.json') }}" - name: Add start notification to Job Template - job_template: + awx.awx.job_template: name: "Ping" notification_templates_started: - Notification1 - Notification2 - name: Remove Notification1 start notification from Job Template - job_template: + awx.awx.job_template: name: "Ping" notification_templates_started: - Notification2 - name: Copy Job Template - job_template: + awx.awx.job_template: name: copy job template copy_from: test job template job_type: "run" diff --git a/awx_collection/plugins/modules/job_wait.py b/awx_collection/plugins/modules/job_wait.py index b7f71eeda289..18861a20bf7d 100644 --- a/awx_collection/plugins/modules/job_wait.py +++ b/awx_collection/plugins/modules/job_wait.py @@ -48,12 +48,12 @@ EXAMPLES = ''' - name: Launch a job - job_launch: + awx.awx.job_launch: job_template: "My Job Template" register: job - name: Wait for job max 120s - job_wait: + awx.awx.job_wait: job_id: "{{ job.id }}" timeout: 120 ''' diff --git a/awx_collection/plugins/modules/label.py b/awx_collection/plugins/modules/label.py index 230f9f470e7f..1c7d94a03398 100644 --- a/awx_collection/plugins/modules/label.py +++ b/awx_collection/plugins/modules/label.py @@ -48,7 +48,7 @@ EXAMPLES = ''' - name: Add label to organization - label: + awx.awx.label: name: Custom Label organization: My Organization ''' diff --git a/awx_collection/plugins/modules/license.py b/awx_collection/plugins/modules/license.py index 69341e5bb31a..bc36d8a9178e 100644 --- a/awx_collection/plugins/modules/license.py +++ b/awx_collection/plugins/modules/license.py @@ -49,20 +49,20 @@ EXAMPLES = ''' - name: Set the license using a file - license: + awx.awx.license: manifest: "/tmp/my_manifest.zip" - name: Use the subscriptions module to fetch subscriptions from Red Hat or Red Hat Satellite - subscriptions: + awx.awx.subscriptions: username: "my_satellite_username" password: "my_satellite_password" - name: Attach to a subscription (requires fetching subscriptions at least once before) - license: + awx.awx.license: subscription_id: 123456 - name: Remove license - license: + awx.awx.license: state: absent ''' diff --git a/awx_collection/plugins/modules/notification_template.py b/awx_collection/plugins/modules/notification_template.py index cc0c28317fef..9a7a752b37fb 100644 --- a/awx_collection/plugins/modules/notification_template.py +++ b/awx_collection/plugins/modules/notification_template.py @@ -106,7 +106,7 @@ EXAMPLES = ''' - name: Add Slack notification with custom messages - notification_template: + awx.awx.notification_template: name: slack notification organization: Default notification_type: slack @@ -125,7 +125,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Add webhook notification - notification_template: + awx.awx.notification_template: name: webhook notification notification_type: webhook notification_configuration: @@ -136,7 +136,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Add email notification - notification_template: + awx.awx.notification_template: name: email notification notification_type: email notification_configuration: @@ -153,7 +153,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Add twilio notification - notification_template: + awx.awx.notification_template: name: twilio notification notification_type: twilio notification_configuration: @@ -166,7 +166,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Add PagerDuty notification - notification_template: + awx.awx.notification_template: name: pagerduty notification notification_type: pagerduty notification_configuration: @@ -178,7 +178,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Add IRC notification - notification_template: + awx.awx.notification_template: name: irc notification notification_type: irc notification_configuration: @@ -193,13 +193,13 @@ controller_config_file: "~/tower_cli.cfg" - name: Delete notification - notification_template: + awx.awx.notification_template: name: old notification state: absent controller_config_file: "~/tower_cli.cfg" - name: Copy webhook notification - notification_template: + awx.awx.notification_template: name: foo notification copy_from: email notification organization: Foo diff --git a/awx_collection/plugins/modules/organization.py b/awx_collection/plugins/modules/organization.py index 38b7c3dc0daa..138fe4a67847 100644 --- a/awx_collection/plugins/modules/organization.py +++ b/awx_collection/plugins/modules/organization.py @@ -90,21 +90,21 @@ EXAMPLES = ''' - name: Create organization - organization: + awx.awx.organization: name: "Foo" description: "Foo bar organization" state: present controller_config_file: "~/tower_cli.cfg" - name: Create organization using 'foo-venv' as default Python virtualenv - organization: + awx.awx.organization: name: "Foo" description: "Foo bar organization using foo-venv" state: present controller_config_file: "~/tower_cli.cfg" - name: Create organization that pulls content from galaxy.ansible.com - organization: + awx.awx.organization: name: "Foo" state: present galaxy_credentials: diff --git a/awx_collection/plugins/modules/project.py b/awx_collection/plugins/modules/project.py index ed0d475b1481..e303e919986c 100644 --- a/awx_collection/plugins/modules/project.py +++ b/awx_collection/plugins/modules/project.py @@ -172,7 +172,7 @@ EXAMPLES = ''' - name: Add project - project: + awx.awx.project: name: "Foo" description: "Foo bar project" organization: "test" @@ -180,7 +180,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Add Project with cache timeout - project: + awx.awx.project: name: "Foo" description: "Foo bar project" organization: "test" @@ -190,7 +190,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Copy project - project: + awx.awx.project: name: copy copy_from: test description: Foo copy project diff --git a/awx_collection/plugins/modules/project_update.py b/awx_collection/plugins/modules/project_update.py index 64d81ffc5424..7a6be04420e3 100644 --- a/awx_collection/plugins/modules/project_update.py +++ b/awx_collection/plugins/modules/project_update.py @@ -67,12 +67,12 @@ EXAMPLES = ''' - name: Launch a project with a timeout of 10 seconds - project_update: + awx.awx.project_update: project: "Networking Project" timeout: 10 - name: Launch a Project with extra_vars without waiting - project_update: + awx.awx.project_update: project: "Networking Project" wait: false ''' diff --git a/awx_collection/plugins/modules/role.py b/awx_collection/plugins/modules/role.py index 32f1124ed987..dfcb14d7a99a 100644 --- a/awx_collection/plugins/modules/role.py +++ b/awx_collection/plugins/modules/role.py @@ -152,14 +152,14 @@ EXAMPLES = ''' - name: Add jdoe to the member role of My Team - role: + awx.awx.role: user: jdoe target_team: "My Team" role: member state: present - name: Add Joe to multiple job templates and a workflow - role: + awx.awx.role: user: joe role: execute workflows: diff --git a/awx_collection/plugins/modules/role_definition.py b/awx_collection/plugins/modules/role_definition.py index e226be99a508..b1545ed369b8 100644 --- a/awx_collection/plugins/modules/role_definition.py +++ b/awx_collection/plugins/modules/role_definition.py @@ -53,7 +53,7 @@ EXAMPLES = ''' - name: Create Role Definition - role_definition: + awx.awx.role_definition: name: test_view_jt permissions: - awx.view_jobtemplate diff --git a/awx_collection/plugins/modules/role_team_assignment.py b/awx_collection/plugins/modules/role_team_assignment.py index a9d8c62b6626..01c87f158025 100644 --- a/awx_collection/plugins/modules/role_team_assignment.py +++ b/awx_collection/plugins/modules/role_team_assignment.py @@ -59,7 +59,7 @@ EXAMPLES = ''' - name: Give Team A JT permissions - role_team_assignment: + awx.awx.role_team_assignment: role_definition: launch JT object_id: 1 team: Team A diff --git a/awx_collection/plugins/modules/role_user_assignment.py b/awx_collection/plugins/modules/role_user_assignment.py index 222db14dfcac..1e34798736e2 100644 --- a/awx_collection/plugins/modules/role_user_assignment.py +++ b/awx_collection/plugins/modules/role_user_assignment.py @@ -59,7 +59,7 @@ EXAMPLES = ''' - name: Give Bob JT permissions - role_user_assignment: + awx.awx.role_user_assignment: role_definition: launch JT object_id: 1 user: bob diff --git a/awx_collection/plugins/modules/schedule.py b/awx_collection/plugins/modules/schedule.py index 2d651805a75c..549089f669d8 100644 --- a/awx_collection/plugins/modules/schedule.py +++ b/awx_collection/plugins/modules/schedule.py @@ -154,7 +154,7 @@ EXAMPLES = ''' - name: Build a schedule for Demo Job Template - schedule: + awx.awx.schedule: name: "{{ sched1 }}" state: present unified_job_template: "Demo Job Template" @@ -162,7 +162,7 @@ register: result - name: Build the same schedule using the rrule plugin - schedule: + awx.awx.schedule: name: "{{ sched1 }}" state: present unified_job_template: "Demo Job Template" @@ -170,7 +170,7 @@ register: result - name: Build a complex schedule for every day except sunday using the rruleset plugin - schedule: + awx.awx.schedule: name: "{{ sched1 }}" state: present unified_job_template: "Demo Job Template" @@ -185,7 +185,7 @@ include: false - name: Delete 'my_schedule' schedule for my_workflow - schedule: + awx.awx.schedule: name: "my_schedule" state: absent unified_job_template: my_workflow diff --git a/awx_collection/plugins/modules/settings.py b/awx_collection/plugins/modules/settings.py index 7314257463b2..ebf0cc873228 100644 --- a/awx_collection/plugins/modules/settings.py +++ b/awx_collection/plugins/modules/settings.py @@ -42,13 +42,13 @@ EXAMPLES = ''' - name: Set the value of AWX_ISOLATION_BASE_PATH - settings: + awx.awx.settings: name: AWX_ISOLATION_BASE_PATH value: "/tmp" register: testing_settings - name: Set the value of AWX_ISOLATION_SHOW_PATHS - settings: + awx.awx.settings: name: "AWX_ISOLATION_SHOW_PATHS" value: "'/var/lib/awx/projects/', '/tmp'" register: testing_settings diff --git a/awx_collection/plugins/modules/subscriptions.py b/awx_collection/plugins/modules/subscriptions.py index 1834d893df66..66bc0ef2e567 100644 --- a/awx_collection/plugins/modules/subscriptions.py +++ b/awx_collection/plugins/modules/subscriptions.py @@ -61,12 +61,12 @@ EXAMPLES = ''' - name: Get subscriptions - subscriptions: + awx.awx.subscriptions: client_id: "c6bd7594-d776-46e5-8156-6d17af147479" client_secret: "MO9QUvoOZ5fc5JQKXoTch1AsTLI7nFsZ" - name: Get subscriptions with a filter - subscriptions: + awx.awx.subscriptions: client_id: "c6bd7594-d776-46e5-8156-6d17af147479" client_secret: "MO9QUvoOZ5fc5JQKXoTch1AsTLI7nFsZ" filters: diff --git a/awx_collection/plugins/modules/team.py b/awx_collection/plugins/modules/team.py index 6507e8ac0e42..34ade7a9a88a 100644 --- a/awx_collection/plugins/modules/team.py +++ b/awx_collection/plugins/modules/team.py @@ -51,7 +51,7 @@ EXAMPLES = ''' - name: Create team - team: + awx.awx.team: name: Team Name description: Team Description organization: test-org diff --git a/awx_collection/plugins/modules/user.py b/awx_collection/plugins/modules/user.py index 8988e80047a8..2caecd2f8cb8 100644 --- a/awx_collection/plugins/modules/user.py +++ b/awx_collection/plugins/modules/user.py @@ -78,7 +78,7 @@ EXAMPLES = ''' - name: Add user - user: + awx.awx.user: username: jdoe password: foobarbaz email: jdoe@example.org @@ -88,7 +88,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Add user as a system administrator - user: + awx.awx.user: username: jdoe password: foobarbaz email: jdoe@example.org @@ -97,7 +97,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Add user as a system auditor - user: + awx.awx.user: username: jdoe password: foobarbaz email: jdoe@example.org @@ -106,7 +106,7 @@ controller_config_file: "~/tower_cli.cfg" - name: Add user as a member of an organization (permissions on the organization are required) - user: + awx.awx.user: username: jdoe password: foobarbaz email: jdoe@example.org @@ -114,7 +114,7 @@ state: present - name: Delete user - user: + awx.awx.user: username: jdoe email: jdoe@example.org state: absent diff --git a/awx_collection/plugins/modules/workflow_approval.py b/awx_collection/plugins/modules/workflow_approval.py index e9385491804a..ec8ae68121ce 100644 --- a/awx_collection/plugins/modules/workflow_approval.py +++ b/awx_collection/plugins/modules/workflow_approval.py @@ -58,7 +58,7 @@ EXAMPLES = """ - name: Create a workflow approval node - workflow_job_template_node: + awx.awx.workflow_job_template_node: identifier: approval_test approval_node: name: approval_jt_name @@ -66,13 +66,13 @@ workflow: "Test Workflow" - name: Launch the workflow with a timeout of 10 seconds - workflow_launch: + awx.awx.workflow_launch: workflow_template: "Test Workflow" wait: false register: workflow - name: Wait for approval node to activate and approve - workflow_approval: + awx.awx.workflow_approval: workflow_job_id: "{{ workflow.id }}" name: approval_jt_name interval: 10 diff --git a/awx_collection/plugins/modules/workflow_job_template.py b/awx_collection/plugins/modules/workflow_job_template.py index 8d3792e0ac51..0a9c40983c14 100644 --- a/awx_collection/plugins/modules/workflow_job_template.py +++ b/awx_collection/plugins/modules/workflow_job_template.py @@ -439,7 +439,7 @@ EXAMPLES = ''' - name: Create a workflow job template - workflow_job_template: + awx.awx.workflow_job_template: name: example-workflow description: created by Ansible Playbook organization: Default @@ -504,7 +504,7 @@ register: result - name: Copy a workflow job template - workflow_job_template: + awx.awx.workflow_job_template: name: copy-workflow copy_from: example-workflow organization: Foo diff --git a/awx_collection/plugins/modules/workflow_job_template_node.py b/awx_collection/plugins/modules/workflow_job_template_node.py index ea9df6d92fe6..a5fa8c1efac4 100644 --- a/awx_collection/plugins/modules/workflow_job_template_node.py +++ b/awx_collection/plugins/modules/workflow_job_template_node.py @@ -187,7 +187,7 @@ EXAMPLES = ''' - name: Create a node, follows workflow_job_template example - workflow_job_template_node: + awx.awx.workflow_job_template_node: identifier: my-first-node workflow: example-workflow unified_job_template: jt-for-node-use @@ -196,7 +196,7 @@ foo_key: bar_value - name: Create parent node for prior node - workflow_job_template_node: + awx.awx.workflow_job_template_node: identifier: my-root-node workflow: example-workflow unified_job_template: jt-for-node-use @@ -207,20 +207,20 @@ - name: Create workflow with 2 Job Templates and an approval node in between block: - name: Create a workflow job template - tower_workflow_job_template: + awx.awx.workflow_job_template: name: my-workflow-job-template ask_scm_branch_on_launch: true organization: Default - name: Create 1st node - tower_workflow_job_template_node: + awx.awx.workflow_job_template_node: identifier: my-first-node workflow_job_template: my-workflow-job-template unified_job_template: some_job_template organization: Default - name: Create 2nd approval node - tower_workflow_job_template_node: + awx.awx.workflow_job_template_node: identifier: my-second-approval-node workflow_job_template: my-workflow-job-template organization: Default @@ -230,14 +230,14 @@ timeout: 3600 - name: Create 3rd node - tower_workflow_job_template_node: + awx.awx.workflow_job_template_node: identifier: my-third-node workflow_job_template: my-workflow-job-template unified_job_template: some_other_job_template organization: Default - name: Link 1st node to 2nd Approval node - tower_workflow_job_template_node: + awx.awx.workflow_job_template_node: identifier: my-first-node workflow_job_template: my-workflow-job-template organization: Default @@ -245,7 +245,7 @@ - my-second-approval-node - name: Link 2nd Approval Node 3rd node - tower_workflow_job_template_node: + awx.awx.workflow_job_template_node: identifier: my-second-approval-node workflow_job_template: my-workflow-job-template organization: Default diff --git a/awx_collection/plugins/modules/workflow_launch.py b/awx_collection/plugins/modules/workflow_launch.py index 76a724633f61..b1802f64ed91 100644 --- a/awx_collection/plugins/modules/workflow_launch.py +++ b/awx_collection/plugins/modules/workflow_launch.py @@ -87,12 +87,12 @@ EXAMPLES = ''' - name: Launch a workflow with a timeout of 10 seconds - workflow_launch: + awx.awx.workflow_launch: workflow_template: "Test Workflow" timeout: 10 - name: Launch a Workflow with extra_vars without waiting - workflow_launch: + awx.awx.workflow_launch: workflow_template: "Test workflow" extra_vars: var1: My First Variable diff --git a/awx_collection/plugins/modules/workflow_node_wait.py b/awx_collection/plugins/modules/workflow_node_wait.py index e133cb6cf944..33b652a0dde2 100644 --- a/awx_collection/plugins/modules/workflow_node_wait.py +++ b/awx_collection/plugins/modules/workflow_node_wait.py @@ -52,13 +52,13 @@ EXAMPLES = """ - name: Launch a workflow with a timeout of 10 seconds - workflow_launch: + awx.awx.workflow_launch: workflow_template: "Test Workflow" wait: false register: workflow - name: Wait for a workflow node to finish - workflow_node_wait: + awx.awx.workflow_node_wait: workflow_job_id: "{{ workflow.id }}" name: Approval Data Step timeout: 120 diff --git a/awx_collection/test/awx/conftest.py b/awx_collection/test/awx/conftest.py index 371ae6601421..93c0ef91b645 100644 --- a/awx_collection/test/awx/conftest.py +++ b/awx_collection/test/awx/conftest.py @@ -189,7 +189,11 @@ def _parse_and_handle_module_result(module_stdout): @pytest.fixture -def run_module(request, collection_import, mocker): +def run_module(request, collection_import, mocker, monkeypatch): + # Force /api/ prefix so modules don't try /api/controller/ against the + # standalone AWX test server which only serves /api/. + monkeypatch.setenv('CONTROLLER_OPTIONAL_API_URLPATTERN_PREFIX', '/api/') + def rf(module_name, module_params, request_user): def new_request(self, method, url, **kwargs): diff --git a/awx_collection/test/awx/test_build_url.py b/awx_collection/test/awx/test_build_url.py index 262c8f01b1c6..c4b686bac631 100644 --- a/awx_collection/test/awx/test_build_url.py +++ b/awx_collection/test/awx/test_build_url.py @@ -45,7 +45,7 @@ def test_controller_api_build_url(collection_import, collection_type, env_prefix, controller_host, app_key, endpoint, expected): controller_api_class = collection_import('plugins.module_utils.controller_api').ControllerAPIModule controller_api = controller_api_class(argument_spec={}, direct_params=dict(controller_host=controller_host)) - controller_api._COLLECTION_TYPE = collection_type + controller_api._COLLECTION_FQCN = {"awx": "awx.awx", "controller": "ansible.controller"}[collection_type] if env_prefix: with mock.patch.dict(os.environ, {"CONTROLLER_OPTIONAL_API_URLPATTERN_PREFIX": env_prefix}): request_url = controller_api.build_url(endpoint, app_key=app_key).geturl() diff --git a/awx_collection/test/awx/test_module_utils.py b/awx_collection/test/awx/test_module_utils.py index cbdc172a3542..e0b87077025d 100644 --- a/awx_collection/test/awx/test_module_utils.py +++ b/awx_collection/test/awx/test_module_utils.py @@ -69,9 +69,9 @@ def test_version_warning(collection_import, silence_warning): with mock.patch('ansible.module_utils.urls.Request.open', new=mock_awx_ping_response): my_module = ControllerAPIModule(argument_spec=dict()) my_module._COLLECTION_VERSION = "2.0.0" - my_module._COLLECTION_TYPE = "awx" + my_module._COLLECTION_FQCN = "awx" + ".awx" # avoid FQCN replacement by script my_module.get_endpoint('ping') - silence_warning.assert_called_once_with( + silence_warning.assert_any_call( 'You are running collection version {0} but connecting to {1} version {2}'.format(my_module._COLLECTION_VERSION, awx_name, ping_version) ) @@ -85,7 +85,7 @@ def test_version_warning_strictness_awx(collection_import, silence_warning): with mock.patch('ansible.module_utils.urls.Request.open', new=mock_awx_ping_response): my_module = ControllerAPIModule(argument_spec=dict()) my_module._COLLECTION_VERSION = "1.0.0" - my_module._COLLECTION_TYPE = "awx" + my_module._COLLECTION_FQCN = "awx" + ".awx" # avoid FQCN replacement by script my_module.get_endpoint('ping') silence_warning.assert_not_called() @@ -94,7 +94,7 @@ def test_version_warning_strictness_awx(collection_import, silence_warning): with mock.patch('ansible.module_utils.urls.Request.open', new=mock_awx_ping_response): my_module = ControllerAPIModule(argument_spec=dict()) my_module._COLLECTION_VERSION = "1.2.0" - my_module._COLLECTION_TYPE = "awx" + my_module._COLLECTION_FQCN = "awx" + ".awx" # avoid FQCN replacement by script my_module.get_endpoint('ping') silence_warning.assert_not_called() @@ -108,7 +108,7 @@ def test_version_warning_strictness_controller(collection_import, silence_warnin with mock.patch('ansible.module_utils.urls.Request.open', new=mock_controller_ping_response): my_module = ControllerAPIModule(argument_spec=dict()) my_module._COLLECTION_VERSION = "1.2.0" - my_module._COLLECTION_TYPE = "controller" + my_module._COLLECTION_FQCN = "ansible.controller" my_module.get_endpoint('ping') silence_warning.assert_not_called() @@ -117,7 +117,7 @@ def test_version_warning_strictness_controller(collection_import, silence_warnin with mock.patch('ansible.module_utils.urls.Request.open', new=mock_controller_ping_response): my_module = ControllerAPIModule(argument_spec=dict()) my_module._COLLECTION_VERSION = "1.0.0" - my_module._COLLECTION_TYPE = "controller" + my_module._COLLECTION_FQCN = "ansible.controller" my_module.get_endpoint('ping') silence_warning.assert_called_once_with( 'You are running collection version {0} but connecting to {1} version {2}'.format(my_module._COLLECTION_VERSION, controller_name, ping_version) @@ -132,7 +132,7 @@ def test_type_warning(collection_import, silence_warning): with mock.patch('ansible.module_utils.urls.Request.open', new=mock_awx_ping_response): my_module = ControllerAPIModule(argument_spec={}) my_module._COLLECTION_VERSION = ping_version - my_module._COLLECTION_TYPE = "controller" + my_module._COLLECTION_FQCN = "ansible.controller" my_module.get_endpoint('ping') silence_warning.assert_called_once_with( 'You are using the {0} version of this collection but connecting to {1}'.format(my_module._COLLECTION_TYPE, awx_name) @@ -166,13 +166,13 @@ def test_no_templated_values(collection_import): checked into source. """ ControllerAPIModule = collection_import('plugins.module_utils.controller_api').ControllerAPIModule - assert ControllerAPIModule._COLLECTION_VERSION == "0.0.1-devel", ( - 'The collection version is templated when the collection is built ' 'and the code should retain the placeholder of "0.0.1-devel".' - ) + assert ( + ControllerAPIModule._COLLECTION_VERSION == "0.0.1-devel" + ), 'The collection version is templated when the collection is built and the code should retain the placeholder of "0.0.1-devel".' InventoryModule = collection_import('plugins.inventory.controller').InventoryModule - assert InventoryModule.NAME == 'awx.awx.controller', ( - 'The inventory plugin FQCN is templated when the collection is built ' 'and the code should retain the default of awx.awx.' - ) + assert ( + InventoryModule.NAME == 'awx.awx.controller' + ), 'The inventory plugin FQCN is templated when the collection is built and the code should retain the default of ansible.controller.' def test_conflicting_name_and_id(run_module, admin_user): diff --git a/awx_collection/tests/sanity/ignore-2.14.txt b/awx_collection/tests/sanity/ignore-2.14.txt index 19512ea0c162..6ecdd59e1cbb 100644 --- a/awx_collection/tests/sanity/ignore-2.14.txt +++ b/awx_collection/tests/sanity/ignore-2.14.txt @@ -1 +1,2 @@ plugins/modules/export.py validate-modules:nonexistent-parameter-documented # needs awxkit to construct argspec +tools/replace_fqcn.sh shebang diff --git a/awx_collection/tests/sanity/ignore-2.15.txt b/awx_collection/tests/sanity/ignore-2.15.txt index 19512ea0c162..6ecdd59e1cbb 100644 --- a/awx_collection/tests/sanity/ignore-2.15.txt +++ b/awx_collection/tests/sanity/ignore-2.15.txt @@ -1 +1,2 @@ plugins/modules/export.py validate-modules:nonexistent-parameter-documented # needs awxkit to construct argspec +tools/replace_fqcn.sh shebang diff --git a/awx_collection/tests/sanity/ignore-2.16.txt b/awx_collection/tests/sanity/ignore-2.16.txt index 19512ea0c162..6ecdd59e1cbb 100644 --- a/awx_collection/tests/sanity/ignore-2.16.txt +++ b/awx_collection/tests/sanity/ignore-2.16.txt @@ -1 +1,2 @@ plugins/modules/export.py validate-modules:nonexistent-parameter-documented # needs awxkit to construct argspec +tools/replace_fqcn.sh shebang diff --git a/awx_collection/tests/sanity/ignore-2.17.txt b/awx_collection/tests/sanity/ignore-2.17.txt index 19512ea0c162..6ecdd59e1cbb 100644 --- a/awx_collection/tests/sanity/ignore-2.17.txt +++ b/awx_collection/tests/sanity/ignore-2.17.txt @@ -1 +1,2 @@ plugins/modules/export.py validate-modules:nonexistent-parameter-documented # needs awxkit to construct argspec +tools/replace_fqcn.sh shebang diff --git a/awx_collection/tools/replace_fqcn.sh b/awx_collection/tools/replace_fqcn.sh new file mode 100755 index 000000000000..18fc8bd54812 --- /dev/null +++ b/awx_collection/tools/replace_fqcn.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Replace the awx-dot-awx FQCN with ansible.controller across the collection. +# +# This script is run once at the start of every major release branch to +# convert the collection from awx-dot-awx to ansible.controller. The result +# should be committed into the release branch. +# +# Usage: +# ./awx_collection/tools/replace_fqcn.sh [collection_root] +# +# If collection_root is not provided, defaults to the awx_collection/ +# directory relative to this script. + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +COLLECTION_ROOT="${1:-$(dirname "$SCRIPT_DIR")}" + +echo "Replacing FQCN in: $COLLECTION_ROOT" + +# Replace namespace and name in galaxy.yml +if [ -f "$COLLECTION_ROOT/galaxy.yml" ]; then + sed -i 's/^namespace: awx$/namespace: ansible/' "$COLLECTION_ROOT/galaxy.yml" + sed -i 's/^name: awx$/name: controller/' "$COLLECTION_ROOT/galaxy.yml" +fi + +# Replace all FQCN references across the entire collection +# This also converts _COLLECTION_FQCN in controller_api.py, which +# drives _COLLECTION_TYPE and api_path() automatically. +find "$COLLECTION_ROOT" -type f \( -name '*.py' -o -name '*.yml' -o -name '*.yaml' -o -name '*.md' -o -name '*.j2' \) \ + -exec sed -i 's/awx\.awx/ansible.controller/g' {} + + +echo "Done." diff --git a/awx_collection/tools/roles/template_galaxy/tasks/main.yml b/awx_collection/tools/roles/template_galaxy/tasks/main.yml index 16b7c29c3732..4c58a90c3ae7 100644 --- a/awx_collection/tools/roles/template_galaxy/tasks/main.yml +++ b/awx_collection/tools/roles/template_galaxy/tasks/main.yml @@ -3,7 +3,6 @@ assert: that: - collection_version is defined and collection_version | length > 0 - - collection_package is defined and collection_package | length > 0 - collection_path is defined and collection_path | length > 0 - name: Set the collection version in the controller_api.py file @@ -11,72 +10,9 @@ path: "{{ collection_path }}/plugins/module_utils/controller_api.py" regexp: '^ _COLLECTION_VERSION = "0.0.1-devel"' replace: ' _COLLECTION_VERSION = "{{ collection_version }}"' - when: - - "awx_template_version | default(True)" -- name: Set the collection type in the controller_api.py file +- name: Set the collection version in galaxy.yml replace: - path: "{{ collection_path }}/plugins/module_utils/controller_api.py" - regexp: '^ _COLLECTION_TYPE = "awx"' - replace: ' _COLLECTION_TYPE = "{{ collection_package }}"' - -- 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([a-zA-Z0-9_]*)$' - replace: 'extends_documentation_fragment: {{ collection_namespace }}.{{ collection_package }}.auth\1' - with_fileglob: - - "{{ collection_path }}/plugins/inventory/*.py" - - "{{ collection_path }}/plugins/lookup/*.py" - - "{{ collection_path }}/plugins/modules/*.py" - loop_control: - label: "{{ item | basename }}" - - - name: Change inventory file to support desired namespace and package names - replace: - path: "{{ collection_path }}/plugins/inventory/controller.py" - regexp: "^ NAME = 'awx.awx.controller' # REPLACE$" - replace: " NAME = '{{ collection_namespace }}.{{ collection_package }}.controller' # REPLACE" - - - name: Change runtime.yml redirect destinations - replace: - path: "{{ collection_path }}/meta/runtime.yml" - regexp: "awx.awx." - replace: "{{ collection_namespace }}.{{ collection_package }}." - - - name: get list of test files - find: - paths: "{{ collection_path }}/tests/integration/targets/" - recurse: true - register: test_files - - - name: Change lookup plugin fqcn usage in tests - replace: - path: "{{ item.path }}" - regexp: 'awx.awx' - replace: '{{ collection_namespace }}.{{ collection_package }}' - loop: "{{ test_files.files }}" - - - name: Get sanity tests to work with non-default name - lineinfile: - path: "{{ collection_path }}/tests/sanity/ignore-2.10.txt" - state: absent - regexp: ' pylint:wrong-collection-deprecated-version-tag$' - - 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 - -- name: Template the README.md file - template: - src: "{{ collection_path }}/tools/roles/template_galaxy/templates/README.md.j2" - dest: "{{ collection_path }}/README.md" - force: true + path: "{{ collection_path }}/galaxy.yml" + regexp: '^version: 0\.0\.1-devel$' + replace: 'version: {{ collection_version }}' diff --git a/awx_collection/tools/roles/template_galaxy/templates/README.md.j2 b/awx_collection/tools/roles/template_galaxy/templates/README.md.j2 deleted file mode 100644 index bffd3eefabe0..000000000000 --- a/awx_collection/tools/roles/template_galaxy/templates/README.md.j2 +++ /dev/null @@ -1,163 +0,0 @@ -# {% if collection_package | lower() == 'awx' %}AWX{% else %}Tower{% endif %} Ansible Collection - -[comment]: # (*******************************************************) -[comment]: # (* *) -[comment]: # (* WARNING *) -[comment]: # (* *) -[comment]: # (* This file is templated and not to be *) -[comment]: # (* edited directly! Instead modify: *) -[comment]: # (* tools/roles/template_galaxy/templates/README.md.j2 *) -[comment]: # (* *) -[comment]: # (* Changes to the base README.md file are refreshed *) -[comment]: # (* upon build of the collection *) -[comment]: # (*******************************************************) - -This Ansible collection allows for easy interaction with an {% if collection_package | lower() == 'awx' %}AWX{% else %}Red Hat Ansible Automation Platform{% endif %} server via Ansible playbooks. - -This source for this collection lives in the `awx_collection` folder inside of the -AWX GitHub repository. -The previous home for this collection was inside the folder [lib/ansible/modules/web_infrastructure/ansible_tower](https://github.com/ansible/ansible/tree/stable-2.9/lib/ansible/modules/web_infrastructure/ansible_tower) in the Ansible repo, -as well as other places for the inventory plugin, module utils, and -doc fragment. - -## Building and Installing - -{% if collection_package | lower() == 'awx' %} -This collection templates the `galaxy.yml` file it uses. -Run `make build_collection` from the root folder of the AWX source tree. -This will create the `tar.gz` file inside the `awx_collection` folder -with the current AWX version, for example: `awx_collection/awx-awx-9.2.0.tar.gz`. - -Installing the `tar.gz` involves no special instructions. - -{% else %} -This collection should be installed from [Content Hub](https://cloud.redhat.com/ansible/automation-hub/ansible/tower/) - -{% endif %} -## Running - -Non-deprecated modules in this collection have no Python requirements, but -may require the official [AWX CLI](https://pypi.org/project/awxkit/) -in the future. The `DOCUMENTATION` for each module will report this. - -You can specify authentication by host, username, and password. - -These can be specified via (from highest to lowest precedence): - - - direct module parameters - - environment variables (most useful when running against localhost) - - a config file path specified by the `tower_config_file` parameter - - a config file at `./tower_cli.cfg`, i.e. in the current directory - - a config file at `~/.tower_cli.cfg` - - a config file at `/etc/tower/tower_cli.cfg` - -Config file syntax looks like this: - -``` -[general] -host = https://localhost:8043 -verify_ssl = true -username = foo -password = bar -``` - -or like this: - -``` -host: https://localhost:8043 -verify_ssl: true -oauth_token: - -``` - -## Release and Upgrade Notes - -Notable releases of the `{{ collection_namespace }}.{{ collection_package }}` collection: - -{% if collection_package | lower() == "awx" %} - - 7.0.0 is intended to be identical to the content prior to the migration, aside from changes necessary to function as a collection. - - 11.0.0 has no non-deprecated modules that depend on the deprecated `tower-cli` [PyPI](https://pypi.org/project/ansible-tower-cli/). - - 19.2.1 large renaming purged "tower" names (like options and module names), adding redirects for old names - - 21.11.0 "tower" modules deprecated and symlinks removed. - - 25.0.0 "token" and "application" modules have been removed as oauth is no longer supported, use basic auth instead - - X.X.X added support of named URLs to all modules. Anywhere that previously accepted name or id can also support named URLs - - 0.0.1-devel is the version you should see if installing from source, which is intended for development and expected to be unstable. -{% else %} - - 3.7.0 initial release - - 4.0.0 ansible.tower renamed to ansible.controller - - tower_ prefix is dropped from the module names, e.g. tower_inventory becomes inventory - - 4.7.0 "token" module has been removed as oauth is no longer supported, use basic auth instead -{% endif %} - -The following notes are changes that may require changes to playbooks: - - - The `credential` module no longer allows `kind` as a parameter; additionally, `inputs` must now be used with a variety of key/value parameters to go with it (e.g., `become_method`) - - The `job_wait` module no longer allows `min_interval`/ `max_interval` parameters; use `interval` instead - - The `notification_template` requires various notification configuration information to be listed as a dictionary under the `notification_configuration` parameter (e.g., `use_ssl`) - - In the `inventory_source` module, the `source_project` (when provided) lookup defaults to the specified organization in the same way the inventory is looked up - - The module `tower_notification` was renamed `tower_notification_template`. In `ansible >= 2.10` there is a seamless redirect. Ansible 2.9 does not respect the redirect. - - When a project is created, it will wait for the update/sync to finish by default; this can be turned off with the `wait` parameter, if desired. - - Creating a "scan" type job template is no longer supported. - - Specifying a custom certificate via the `TOWER_CERTIFICATE` environment variable no longer works. - - Type changes of variable fields: - - - `extra_vars` in the `tower_job_launch` module worked with a `list` previously, but now only works with a `dict` type - - `extra_vars` in the `tower_workflow_job_template` module worked with a `string` previously but now expects a `dict` - - When the `extra_vars` parameter is used with the `tower_job_launch` module, the launch will fail unless `ask_extra_vars` or `survey_enabled` is explicitly set to `True` on the Job Template - - The `variables` parameter in the `tower_group`, `tower_host` and `tower_inventory` modules now expects a `dict` type and no longer supports the use of `@` syntax for a file - - - - Type changes of other types of fields: - - - `inputs` or `injectors` in the `tower_credential_type` module worked with a string previously but now expects a `dict` - - `schema` in the `tower_workflow_job_template` module worked with a `string` previously but not expects a `list` of `dict`s - - - `tower_group` used to also service inventory sources, but this functionality has been removed from this module; use `tower_inventory_source` instead. - - Specified `tower_config` file used to handle `k=v` pairs on a single line; this is no longer supported. Please use a file formatted as `yaml`, `json` or `ini` only. - - Some return values (e.g., `credential_type`) have been removed. Use of `id` is recommended. - - `tower_job_template` no longer supports the deprecated `extra_vars_path` parameter, please use `extra_vars` with the lookup plugin to replace this functionality. - - The `notification_configuration` parameter of `tower_notification_template` has changed from a string to a dict. Please use the `lookup` plugin to read an existing file into a dict. - - `tower_credential` no longer supports passing a file name to `ssh_key_data`. - - The HipChat `notification_type` has been removed and can no longer be created using the `tower_notification_template` module. - - Lookup plugins now always return a list, and if you want a scalar value use `lookup` as opposed to `query` - -{% if collection_package | lower() == "awx" %} -## Running Unit Tests - -Tests to verify compatibility with the most recent AWX code are in `awx_collection/test/awx`. -These can be ran via the `make test_collection` command in the development container. - -To run tests outside of the development container, or to run against -Ansible source, set up a dedicated virtual environment: - -``` -mkvirtualenv my_new_venv -# may need to replace psycopg3 with psycopg3-binary in requirements/requirements.txt -pip install -r requirements/requirements.txt -r requirements/requirements_dev.txt -r requirements/requirements_git.txt -make clean-api -pip install -e -pip install -e . -pip install -e awxkit -py.test awx_collection/test/awx/ -``` - -## Running Integration Tests - -The integration tests require a virtualenv with `ansible >= 2.9` and `awxkit`. -The collection must first be installed, which can be done using `make install_collection`. -You also need a configuration file, as described in the [Running](https://github.com/ansible/awx/blob/devel/awx_collection/README.md#running) section. - -How to run the tests: - -``` -# ansible-test must be run from the directory in which the collection is installed -cd ~/.ansible/collections/ansible_collections/awx/awx/ -ansible-test integration -``` -{% endif %} - -## Licensing - -All content in this folder is licensed under the same license as Ansible, -which is the same as the license that applied before the split into an -independent collection. diff --git a/awx_collection/tools/roles/template_galaxy/templates/galaxy.yml.j2 b/awx_collection/tools/roles/template_galaxy/templates/galaxy.yml.j2 deleted file mode 100644 index 5290dc72174f..000000000000 --- a/awx_collection/tools/roles/template_galaxy/templates/galaxy.yml.j2 +++ /dev/null @@ -1,38 +0,0 @@ -# (********************************************************) -# (* *) -# (* WARNING *) -# (* *) -# (* This file is managed by Ansible and not to be *) -# (* edited directly! Instead modify: *) -# (* tools/roles/template_galaxy/templates/galaxy.yml.j2 *) -# (* *) -# (* Changes to the base galaxy.yml file are refreshed *) -# (* upon build of the collection *) -# (********************************************************) ---- -authors: - - AWX Project Contributors -dependencies: {} -description: Ansible content that interacts with the AWX or Automation Platform Controller 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-or-later -name: {{ collection_package }} -namespace: {{ collection_namespace }} -readme: README.md -repository: https://github.com/ansible/awx -tags: - - cloud - - infrastructure - - awx - - ansible - - automation -version: {{ collection_version_override | default(collection_version) }} -build_ignore: - - tools - - setup.cfg - - galaxy.yml.j2 - - template_galaxy.yml - - '*.tar.gz' diff --git a/awx_collection/tools/template_galaxy.yml b/awx_collection/tools/template_galaxy.yml index d2e88faccdef..4615ef09435c 100644 --- a/awx_collection/tools/template_galaxy.yml +++ b/awx_collection/tools/template_galaxy.yml @@ -4,8 +4,6 @@ gather_facts: false connection: local vars: - collection_package: awx - collection_namespace: awx collection_version: 0.0.1 # not for updating, pass in extra_vars collection_source: "{{ playbook_dir }}/../" collection_path: "{{ playbook_dir }}/../../awx_collection_build" @@ -22,19 +20,4 @@ roles: - template_galaxy - tasks: - - name: Make substitutions in source to sync with templates - set_fact: - collection_version_override: 0.0.1-devel - - - name: Template the galaxy.yml source file (should be commited with your changes) - template: - src: "{{ collection_source }}/tools/roles/template_galaxy/templates/galaxy.yml.j2" - dest: "{{ collection_source }}/galaxy.yml" - force: true - - - name: Template the README.md source file (should be commited with your changes) - template: - src: "{{ collection_source }}/tools/roles/template_galaxy/templates/README.md.j2" - dest: "{{ collection_source }}/README.md" - force: true + tasks: []