Skip to content

Commit

Permalink
redhat_cop to infra conversion (#93)
Browse files Browse the repository at this point in the history
* update

* update

* update tests and fix ci

* update lint

* update readme

* update requirements

* update linting

* update references from redhat_cop to infra
  • Loading branch information
sean-m-sullivan authored Mar 13, 2023
1 parent 8699a76 commit 16a4f8a
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 31 deletions.
10 changes: 5 additions & 5 deletions .github/tests/ee_builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
hosts: localhost
gather_facts: false
collections:
- redhat_cop.ee_utilities
- redhat_cop.controller_configuration
- infra.ee_utilities
- infra.controller_configuration
vars:
# For ansible.cfg generation
# For controller configuration definition
Expand All @@ -27,8 +27,8 @@
collections:
- name: awx.awx
version: 21.9.0
- name: redhat_cop.controller_configuration
- name: redhat_cop.ah_configuration
- name: infra.controller_configuration
- name: infra.ah_configuration
prepend:
- RUN whoami
- RUN cat /etc/os-release
Expand All @@ -39,5 +39,5 @@
ee_base_image: 2registry.redhat.io/ansible-automation-platform-23/ee-supported-rhel8:latest
ee_builder_image: 2registry.redhat.io/ansible-automation-platform-23/ansible-builder-rhel8:latest
roles:
- redhat_cop.ee_utilities.ee_builder
- infra.ee_utilities.ee_builder
...
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ Click the `Content` button to see the list of content included in this collectio

## Installing this collection

You can install the redhat_cop ee_utilities collection with the Ansible Galaxy CLI:
You can install the infra.ee_utilities collection with the Ansible Galaxy CLI:

ansible-galaxy collection install redhat_cop.ee_utilities
ansible-galaxy collection install infra.ee_utilities

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

<!-- markdownlint-disable MD046 -->
```yaml
---
collections:
- name: redhat_cop.ee_utilities
- name: infra.ee_utilities
# If you need a specific version of the collection, you can specify like this:
# version: ...
```
Expand Down
4 changes: 4 additions & 0 deletions changelogs/fragments/changed_when_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
minor_changes:
- Added changed_when false to built in commands that gather information.
...
8 changes: 4 additions & 4 deletions examples/ee_builder_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
hosts: localhost
gather_facts: false
collections:
- redhat_cop.ee_utilities
- infra.ee_utilities
vars:
ee_builder_dir_clean: true
ah_host: ahnosso.node
Expand All @@ -24,13 +24,13 @@
collections:
- name: awx.awx
version: 12.0.0
- name: redhat_cop.controller_configuration
- name: redhat_cop.ah_configuration
- name: infra.controller_configuration
- name: infra.ah_configuration
prepend:
- RUN whoami
- RUN cat /etc/os-release
append:
- RUN echo This is a post-install command!
roles:
- redhat_cop.ee_utilities.ee_builder
- infra.ee_utilities.ee_builder
...
10 changes: 5 additions & 5 deletions examples/ee_venv_migrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
hosts: tower
gather_facts: false
collections:
- redhat_cop.ee_utilities
- infra.ee_utilities
vars:
venv_migrate_default_ee_url: registry.redhat.io/ansible-automation-platform-23/ee-minimal-rhel8:latest
ee_collections:
- name: awx.awx
- name: redhat_cop.controller_configuration
- name: redhat_cop.ah_configuration
- name: infra.controller_configuration
- name: infra.ah_configuration
tasks:
- name: Include venv_migrate role
ansible.builtin.include_role:
name: redhat_cop.ee_utilities.virtualenv_migrate
name: infra.ee_utilities.virtualenv_migrate

- name: Display ee_list
ansible.builtin.debug:
Expand All @@ -30,7 +30,7 @@

- name: Create EE
ansible.builtin.include_role:
name: redhat_cop.ee_utilities.ee_builder
name: infra.ee_utilities.ee_builder

- name: Export python virtual enviroment list to file # noqa template-instead-of-copy
ansible.builtin.copy:
Expand Down
14 changes: 7 additions & 7 deletions roles/ee_builder/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# redhat_cop.ee_utilities.ee_builder
# infra.ee_utilities.ee_builder

Ansible role use to build execution environments. This role invokes ansible builder and depends on certain variables or files being provided.

Expand Down Expand Up @@ -131,7 +131,7 @@ ansible-playbook playbook.yml
hosts: localhost
gather_facts: false
collections:
- redhat_cop.ee_utilities
- infra.ee_utilities
vars:
ee_registry_dest: ahnosso.node
ee_registry_username: admin
Expand All @@ -150,15 +150,15 @@ ansible-playbook playbook.yml
- name: awx.awx
type: url
source: https://galaxy.ansible.com/download/awx-awx-21.11.0.tar.gz
- name: redhat_cop.controller_configuration
- name: redhat_cop.ah_configuration
- name: infra.controller_configuration
- name: infra.ah_configuration
prepend:
- RUN whoami
- RUN cat /etc/os-release
append:
- RUN echo This is a post-install command!
roles:
- redhat_cop.ee_utilities.ee_builder
- infra.ee_utilities.ee_builder
```

This is an example for building using automated pipelines like Gitlab or Azure Devops where the build container and other dependencies used for building the final artifact are destroyed after the pipeline is finished
Expand Down Expand Up @@ -205,8 +205,8 @@ This is an example for building using automated pipelines like Gitlab or Azure D
- name: awx.awx
type: url
source: https://galaxy.ansible.com/download/awx-awx-21.11.0.tar.gz
- name: redhat_cop.controller_configuration
- name: redhat_cop.ah_configuration
- name: infra.controller_configuration
- name: infra.ah_configuration
prepend:
- RUN whoami
- RUN cat /etc/os-release
Expand Down
14 changes: 7 additions & 7 deletions roles/virtualenv_migrate/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# redhat_cop.ee_utilities.virtualenv_migrate
# infra.ee_utilities.virtualenv_migrate

Use this role to create a list of python requirements from custom virtualenvs present in your AAP 1.2 cluster, after comparing those with requirements in Default Execution Environment.
This role is based on the `awx-manage` utility and needs an AAP1.2 tower node to gather requirements from and localhost to pull EE and compare those requirements.
Expand Down Expand Up @@ -41,7 +41,7 @@ podman on localhost
tasks:
- name: Include venv role
include_role:
name: redhat_cop.ee_utilities.virtualenv_migrate
name: infra.ee_utilities.virtualenv_migrate
```
## Example Playbook Using both roles together
Expand All @@ -53,17 +53,17 @@ podman on localhost
hosts: tower
gather_facts: false
collections:
- redhat_cop.ee_utilities
- infra.ee_utilities
vars:
venv_migrate_default_ee_url: registry.redhat.io/ansible-automation-platform-23/ee-minimal-rhel8:latest
ee_collections:
- name: awx.awx
- name: redhat_cop.controller_configuration
- name: redhat_cop.ah_configuration
- name: infra.controller_configuration
- name: infra.ah_configuration
tasks:
- name: Include venv_migrate role
include_role:
name: redhat_cop.ee_utilities.virtualenv_migrate
name: infra.ee_utilities.virtualenv_migrate

- name: ee_list
ansible.builtin.debug:
Expand All @@ -82,7 +82,7 @@ podman on localhost

- name: Create EE
include_role:
name: redhat_cop.ee_utilities.ee_builder
name: infra.ee_utilities.ee_builder

- name: Export python virtual enviroment list to file
copy:
Expand Down

0 comments on commit 16a4f8a

Please sign in to comment.