Skip to content

Commit

Permalink
Merge pull request #18 from sean-m-sullivan/find_replace
Browse files Browse the repository at this point in the history
Test Find and replace
  • Loading branch information
sean-m-sullivan committed Aug 24, 2023
2 parents d0e912f + 1581363 commit de1522c
Show file tree
Hide file tree
Showing 73 changed files with 190 additions and 168 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_standalone_versioned.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
- name: "Perform collection repository tests"
run: ansible-playbook tests/playbooks/testing_collections_repos.yml -v -e galaxy_ng_version=${{ inputs.galaxy_ng_version }}
run: ansible-playbook tests/playbooks/testing_collections_repos.yml -vvv -e galaxy_ng_version=${{ inputs.galaxy_ng_version }}

- name: "Perform playbook namespace tests"
run: ansible-playbook tests/playbooks/testing_playbook_ee_namespace.yml -v -e galaxy_ng_version=${{ inputs.galaxy_ng_version }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
- stable-4.4
- stable-4.5
- stable-4.6
- stable-4.7
- master
# - master disabled until build issue resolved
uses: "./.github/workflows/ci_standalone_versioned.yml"
with:
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
====================================
ansible.automation_hub Release Notes
galaxy.galaxy Release Notes
====================================

.. contents:: Topics
Expand Down Expand Up @@ -50,7 +50,7 @@ Breaking Changes / Porting Guide
New Modules
-----------

- ansible.automation_hub.ah_role - Manage a role of group permissions
- galaxy.galaxy.ah_role - Manage a role of group permissions

v1.0.1
======
Expand Down Expand Up @@ -199,7 +199,7 @@ Breaking Changes / Porting Guide
New Modules
-----------

- ansible.automation_hub.ah_ee_registry - Manage private automation hub execution environment remote registries.
- galaxy.galaxy.ah_ee_registry - Manage private automation hub execution environment remote registries.

v0.6.1
======
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ Click the `Content` button to see the list of content included in this collectio

## Installing this collection

You can install the ansible automation_hub collection with the Ansible Galaxy CLI:
You can install the galaxy galaxy collection with the Ansible Galaxy CLI:

```bash
ansible-galaxy collection install ansible.automation_hub
ansible-galaxy collection install galaxy.galaxy
```

You can also include it in a `requirements.yml` file and install it with `ansible-galaxy collection install -r requirements.yml`, using the format:

```yaml
---
collections:
- name: ansible.automation_hub
- name: galaxy.galaxy
# If you need a specific version of the collection, you can specify like this:
# version: ...
```
Expand Down
2 changes: 1 addition & 1 deletion changelogs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sections:
- Bugfixes
- - known_issues
- Known Issues
title: ansible.automation_hub
title: galaxy.galaxy
trivial_section_name: trivial
use_fqcn: true
...
1 change: 1 addition & 0 deletions changelogs/fragments/collection_repos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
major_changes:
- Added collection_repository and collection_repository_sync roles and modules to manage collection repositories. This will only work in Galaxy 4.7 or AAP 2.4.
- Fix collection repository roles and modules update options and role options to behave correctly.
...
1 change: 1 addition & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ build_ignore:
- galaxy.yml.j2
- template_galaxy.yml
- '*.tar.gz'
- test
...
20 changes: 10 additions & 10 deletions playbooks/testing_playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
connection: local
gather_facts: false
collections:
- ansible.automation_hub
- galaxy.galaxy
pre_tasks:
- name: Include vars from ah_configs directory
ansible.builtin.include_vars:
Expand All @@ -21,7 +21,7 @@

tasks:
- name: Authenticate and get an API token
ansible.automation_hub.ah_token:
galaxy.galaxy.ah_token:
ah_host: "{{ ah_hostname }}"
ah_username: "{{ ah_username }}"
ah_password: "{{ ah_password }}"
Expand All @@ -43,7 +43,7 @@
# ah_auto_approve: true

- name: Remove collection
ansible.automation_hub.ah_collection:
galaxy.galaxy.ah_collection:
namespace: community_test
name: test
version: 1.0.1
Expand All @@ -54,19 +54,19 @@
validate_certs: "{{ ah_validate_certs }}"

- name: Configure community repo
ansible.automation_hub.ah_repository:
galaxy.galaxy.ah_repository:
name: community
url: https://galaxy.ansible.com/api/
requirements:
- name: ansible.automation_hub
- name: galaxy.galaxy
- name: infra.controller_configuration
ah_host: "{{ ah_hostname }}"
ah_token: "{{ ah_token }}"
ah_path_prefix: "{{ ah_path_prefix }}"
validate_certs: "{{ ah_validate_certs }}"

- name: Configure community repo from file
ansible.automation_hub.ah_repository:
galaxy.galaxy.ah_repository:
name: community
url: https://galaxy.ansible.com/api/
requirements_file: files/collection_requirement_file.yml
Expand All @@ -76,7 +76,7 @@
validate_certs: "{{ ah_validate_certs }}"

- name: Sync community repo
ansible.automation_hub.ah_repository_sync:
galaxy.galaxy.ah_repository_sync:
name: community
wait: true
ah_host: "{{ ah_hostname }}"
Expand All @@ -85,7 +85,7 @@
validate_certs: "{{ ah_validate_certs }}"

- name: Configure rh-certified repo
ansible.automation_hub.ah_repository:
galaxy.galaxy.ah_repository:
name: rh-certified
url: https://cloud.redhat.com/api/automation-hub/
auth_url: https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
Expand All @@ -96,7 +96,7 @@
validate_certs: "{{ ah_validate_certs }}"

- name: Add EE Registry
ansible.automation_hub.ah_ee_registry:
galaxy.galaxy.ah_ee_registry:
name: myreg
url: https://registry.redhat.io
ah_host: "{{ ah_hostname }}"
Expand All @@ -106,7 +106,7 @@
validate_certs: "{{ ah_validate_certs }}"

- name: Deauthenticate
ansible.automation_hub.ah_token:
galaxy.galaxy.ah_token:
ah_host: "{{ ah_hostname }}"
ah_token: "{{ ah_token }}"
ah_path_prefix: "{{ ah_path_prefix }}"
Expand Down
10 changes: 5 additions & 5 deletions plugins/lookup/ah_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
- If a list view returns more an max_objects an exception will be raised
type: integer
default: 1000
extends_documentation_fragment: ansible.automation_hub.auth_plugin
extends_documentation_fragment: galaxy.galaxy.auth_plugin
notes:
- If the query is not filtered properly this can cause a performance impact.
- Two options take multiple terms. 'ee_images' and 'collection'. See the _terms choices above or the examples below for more details.
Expand All @@ -80,20 +80,20 @@
EXAMPLES = """
- name: Report the usernames of all users
debug:
msg: "Users: {{ query('ansible.automation_hub.ah_api', 'users', return_all=true) | map(attribute='username') | list }}"
msg: "Users: {{ query('galaxy.galaxy.ah_api', 'users', return_all=true) | map(attribute='username') | list }}"
- name: List all collection namespaces by the devops team
debug:
msg: "{{ lookup('ansible.automation_hub.ah_api', 'namespaces', host='https://ah.example.com', username='ansible',
msg: "{{ lookup('galaxy.galaxy.ah_api', 'namespaces', host='https://ah.example.com', username='ansible',
password='Passw0rd123', verify_ssl=false, query_params={'company': 'Devops'}) }}"
- name: Get the list of tags for my_ee
set_fact:
my_ee_tags: "{{ lookup('ansible.automation_hub.ah_api', 'ee_images', 'my_ee') | map(attribute='tags') | list | flatten }}"
my_ee_tags: "{{ lookup('galaxy.galaxy.ah_api', 'ee_images', 'my_ee') | map(attribute='tags') | list | flatten }}"
- name: Get the list of versions for a collection in the published repo
set_fact:
collection_versions: "{{ lookup('ansible.automation_hub.ah_api', 'collection', 'published', 'fake_namespace',
collection_versions: "{{ lookup('galaxy.galaxy.ah_api', 'collection', 'published', 'fake_namespace',
'collection_name').all_versions | map(attribute='version') | list }}"
"""

Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/ah_approval.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
required: True
type: str
extends_documentation_fragment: ansible.automation_hub.auth
extends_documentation_fragment: galaxy.galaxy.auth
"""


EXAMPLES = """
- name: Approve namespace.collection_name:v1.0.0
ansible.automation_hub.ah_approval:
galaxy.galaxy.ah_approval:
namespace: namespace
name: collection_name
version: v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/ah_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@


EXAMPLES = """
- name: Build ansible.automation_hub:v1.0.0
ansible.automation_hub.ah_build:
- name: Build galaxy.galaxy:v1.0.0
galaxy.galaxy.ah_build:
path: /home/ansible/ah_configuration
force: true
output_path: /var/tmp
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/ah_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,20 @@
default: "present"
type: str
extends_documentation_fragment: ansible.automation_hub.auth
extends_documentation_fragment: galaxy.galaxy.auth
"""


EXAMPLES = """
- name: Upload collection to automation hub
ansible.automation_hub.ah_collection:
galaxy.galaxy.ah_collection:
namespace: awx
name: awx
path: /var/tmp/collections/awx-awx-15.0.0.tar.gz
- name: Remove collection
ansible.automation_hub.ah_collection:
galaxy.galaxy.ah_collection:
namespace: test_collection
name: test
version: 4.1.2
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/ah_collection_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
default: True
type: bool
extends_documentation_fragment: ansible.automation_hub.auth
extends_documentation_fragment: galaxy.galaxy.auth
"""


EXAMPLES = """
- name: Upload collection to automation hub
ansible.automation_hub.ah_collection_upload:
galaxy.galaxy.ah_collection_upload:
path: /var/tmp/collections/awx_awx-15.0.0.tar.gz
- name: Upload collection to automation hub from galaxy
ansible.automation_hub.ah_collection_upload:
galaxy.galaxy.ah_collection_upload:
path: https://galaxy.ansible.com/download/theforeman-foreman-3.2.0.tar.gz
"""
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/ah_ee_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
notes:
- Supports C(check_mode).
- Only works with private automation hub v4.3.2 or later.
extends_documentation_fragment: ansible.automation_hub.auth_ui
extends_documentation_fragment: galaxy.galaxy.auth_ui
"""

EXAMPLES = r"""
- name: Ensure the image has the additional tags
ansible.automation_hub.ah_ee_image:
galaxy.galaxy.ah_ee_image:
name: ansible-automation-platform-20-early-access/ee-supported-rhel8:2.0.0-15
state: present
tags:
Expand All @@ -68,7 +68,7 @@
ah_password: Sup3r53cr3t
- name: Replace all the image tags
ansible.automation_hub.ah_ee_image:
galaxy.galaxy.ah_ee_image:
name: ansible-automation-platform-20-early-access/ee-supported-rhel8:2.0.0-15
state: present
append: false
Expand All @@ -80,7 +80,7 @@
ah_password: Sup3r53cr3t
- name: Ensure the image does not exist
ansible.automation_hub.ah_ee_image:
galaxy.galaxy.ah_ee_image:
name: ansible-automation-platform-20-early-access/ee-supported-rhel8:2.0
state: absent
ah_host: hub.example.com
Expand Down
14 changes: 7 additions & 7 deletions plugins/modules/ah_ee_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
why: The endpoint has been removed and is not supported in AAP 2.3 onwards
alternative: None
removed_in: 3.0.0
removed_from_collection: ansible.automation_hub
removed_from_collection: galaxy.galaxy
options:
name:
description:
Expand Down Expand Up @@ -71,20 +71,20 @@
- When the module creates a namespace, the private automation hub web UI does not display that new namespace.
You must first create a repository in the namespace, with C(podman push) for example, for the web UI to show the namespace.
- When the module grants access to a group, the permissions associated to that group apply.
extends_documentation_fragment: ansible.automation_hub.auth_ui
extends_documentation_fragment: galaxy.galaxy.auth_ui
"""

EXAMPLES = r"""
- name: Ensure the namespace exists
ansible.automation_hub.ah_ee_namespace:
galaxy.galaxy.ah_ee_namespace:
name: ansible-automation-platform-20-early-access
state: present
ah_host: hub.example.com
ah_username: admin
ah_password: Sup3r53cr3t
- name: Ensure the namespace has a new name
ansible.automation_hub.ah_ee_namespace:
galaxy.galaxy.ah_ee_namespace:
name: ansible-automation-platform-20-early-access
new_name: custom-ee-01
state: present
Expand All @@ -93,15 +93,15 @@
ah_password: Sup3r53cr3t
- name: Ensure the namespace is removed
ansible.automation_hub.ah_ee_namespace:
galaxy.galaxy.ah_ee_namespace:
name: custom-ee-01
state: absent
ah_host: hub.example.com
ah_username: admin
ah_password: Sup3r53cr3t
- name: Ensure only the operators group can manage the namespace
ansible.automation_hub.ah_ee_namespace:
galaxy.galaxy.ah_ee_namespace:
name: ansible-automation-platform-20-early-access
state: present
groups:
Expand All @@ -112,7 +112,7 @@
ah_password: Sup3r53cr3t
- name: Ensure the managers group can also manage the namespace
ansible.automation_hub.ah_ee_namespace:
galaxy.galaxy.ah_ee_namespace:
name: ansible-automation-platform-20-early-access
state: present
groups:
Expand Down
Loading

0 comments on commit de1522c

Please sign in to comment.