Skip to content

Commit

Permalink
more tweaking for release
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-m-sullivan committed Oct 16, 2024
1 parent f13c799 commit 4fec59a
Show file tree
Hide file tree
Showing 393 changed files with 3,126 additions and 2,946 deletions.
2 changes: 0 additions & 2 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
# this issue describes similar behavior but suggested fix doesn't work
# https://github.com/ansible/ansible-lint/issues/371
# exclude_paths:
# - roles/master_role_example/
exclude_paths:
- '.github/'
- 'roles/master_role_example/'
- 'changelogs/'
- 'tests/templated_role_example'
parseable: true
Expand Down
2 changes: 0 additions & 2 deletions .ansible-lint-ignore
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
plugins/lookup/controller_object_diff.py yaml[document-end]
plugins/modules/controller_export_diff.py yaml[document-end]
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you feel like getting your hands dirty, feel free to make the change yourself
1. Fork the repo on Github, and then clone it locally.
2. Create a branch named appropriately for the change you are going to make.
3. Make your code change.
4. If you are creating a new role, please add a test for it in our [testing playbook.](https://github.com/redhat-cop/aap_configuration/blob/devel/tests/configure_controller.yml) by adding a new role entry and adding the appropriate yaml file with test data in the controller_configs directory.
4. If you are creating a new role, please add a test for it in our [testing playbook.](https://github.com/redhat-cop/aap_configuration/blob/devel/tests/configure_controller.yml) by adding a new role entry and adding the appropriate yaml file with test data in the aap_configs directory.
5. Add a changelog fragment in `changelogs/fragments` as per <https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs>
6. Push your code change up to your forked repo.
7. Open a Pull Request to merge your changes to this repo. The comment box will be filled in automatically via a template.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_standalone_versioned.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ jobs:
run: ansible-galaxy collection install -r .github/collections/requirements.yml

- name: "Perform playbook tests"
run: ansible-playbook tests/configure_controller.yml -e controller_hostname=localhost:8043 -v -e awx_version=${{ inputs.awx_version }}
run: ansible-playbook tests/configure_controller.yml -e aap_hostname=localhost:8043 -v -e awx_version=${{ inputs.awx_version }}

- name: "Perform export model playbook tests"
run: ansible-playbook tests/configure_controller_export_model.yml -e controller_hostname=localhost:8043 -v -e awx_version=${{ inputs.awx_version }}
run: ansible-playbook tests/configure_controller_export_model.yml -e aap_hostname=localhost:8043 -v -e awx_version=${{ inputs.awx_version }}
...
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
uses: "redhat-cop/ansible_collections_tooling/.github/workflows/pre_commit_and_sanity.yml@main"
with:
collection_namespace: infra
collection_name: controller_configuration
collection_version: 1.0.0
collection_name: aap_configuration
collection_version: 3.0.0-devel
collection_repo: https://github.com/redhat-cop/aap_configuration/
collection_dependencies: awx.awx
...
6 changes: 3 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
============================================
infra.controller_configuration Release Notes
infra.aap_configuration Release Notes
============================================

.. contents:: Topics
Expand Down Expand Up @@ -273,7 +273,7 @@ Minor Changes
- Add no_log everywhere controller_api_plugin is used to avoid to expose sensitive information in case of crashes.
- Add or fix some variables or extra_vars exported from objects like notifications, inventory, inventory_source, hosts, groups, jt or wjt.
- Add roles object to object_diff role and controller_object_diff lookup plugin.
- Fix one query with controller_password to change it and set oauth_token=controller_oauthtoken.
- Fix one query with aap_password to change it and set oauth_token=controller_oauthtoken.
- Fixed typos in README.md.
- Improve template to export settings with filetree_create role. Settings will be in yaml format.
- Renamed the field `update` to `update_project` to avoid colliding with the Python dict update method
Expand All @@ -298,7 +298,7 @@ Minor Changes
Breaking Changes / Porting Guide
--------------------------------

- infra.controller_configuration 2.2.3 is broken, it is aap_utilities release. We are bumping the version to minimize the issues.
- infra.aap_configuration 2.2.3 is broken, it is aap_utilities release. We are bumping the version to minimize the issues.
- rewrote playbooks/controller_configure.yml and removed all other playbooks

Removed Features (previously deprecated)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ Otherwise it will look for the modules only in your base installation. If there
hosts: localhost
connection: local
vars:
controller_validate_certs: true
aap_validate_certs: true
collections:
- awx.awx
```
Define following vars here, or in `controller_configs/controller_auth.yml`
`controller_hostname: ansible-controller-web-svc-test-project.example.com`
Define following vars here, or in `aap_configs/controller_auth.yml`
`aap_hostname: ansible-controller-web-svc-test-project.example.com`

You can also specify authentication by a combination of either:

- `controller_hostname`, `controller_username`, `controller_password`
- `controller_hostname`, `controller_oauthtoken`
- `aap_hostname`, `aap_username`, `aap_password`
- `aap_hostname`, `controller_oauthtoken`

The OAuth2 token is the preferred method. You can obtain the token through the preferred `controller_token` module, or through the
AWX CLI [login](https://docs.ansible.com/automation-controller/latest/html/controllerapi/authentication.html)
Expand Down Expand Up @@ -133,9 +133,9 @@ Controller token module would be invoked with this code:
description: 'Creating token to test controller jobs'
scope: "write"
state: present
controller_host: "{{ controller_hostname }}"
controller_username: "{{ controller_username }}"
controller_password: "{{ controller_password }}"
controller_host: "{{ aap_hostname }}"
aap_username: "{{ aap_username }}"
aap_password: "{{ aap_password }}"
```

Expand Down
4 changes: 2 additions & 2 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ releases:
2.2.4:
changes:
breaking_changes:
- infra.controller_configuration 2.2.3 is broken, it is aap_utilities release.
- infra.aap_configuration 2.2.3 is broken, it is aap_utilities release.
We are bumping the version to minimize the issues.
- rewrote playbooks/controller_configure.yml and removed all other playbooks
minor_changes:
Expand Down Expand Up @@ -412,7 +412,7 @@ releases:
- Add or fix some variables or extra_vars exported from objects like notifications,
inventory, inventory_source, hosts, groups, jt or wjt.
- Add roles object to object_diff role and controller_object_diff lookup plugin.
- Fix one query with controller_password to change it and set oauth_token=controller_oauthtoken.
- Fix one query with aap_password to change it and set oauth_token=controller_oauthtoken.
- Fixed typos in README.md.
- Improve template to export settings with filetree_create role. Settings will
be in yaml format.
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: infra.controller_configuration
title: infra.aap_configuration
trivial_section_name: trivial
use_fqcn: true
...
3 changes: 2 additions & 1 deletion changelogs/fragments/Rewrite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ major_changes:
- Roles from infra.ah_configuration and infra.eda_configuration have migrated into this collection
- Rename of collection to infra.aap_configuration
- Introduction of roles for gateway

bugfixes:
- Controller credentials role now includes request timeout option.
12 changes: 6 additions & 6 deletions docs/CONVERSION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Otherwise it will look for the modules only in your base installation. If there
hosts: localhost
connection: local
vars:
controller_validate_certs: false
aap_validate_certs: false
collections:
- awx.awx
- infra.controller_configuration
- infra.aap_configuration
```
## Variable name changes
Expand Down Expand Up @@ -60,12 +60,12 @@ The Following Variables need to be changed:

|Tower Variable Name|Controller Variable Name|
|:---:|:---:|
|`tower_username`|`controller_username`|
|`tower_password`|`controller_password`|
|`tower_username`|`aap_username`|
|`tower_password`|`aap_password`|
|`tower_oauthtoken`|`controller_oauthtoken`|
|`tower_hostname`|`controller_hostname`|
|`tower_hostname`|`aap_hostname`|
|`tower_config_file`|`controller_config_file`|
|`tower_validate_certs`|`controller_validate_certs`|
|`tower_validate_certs`|`aap_validate_certs`|

### Specific Changes in Roles

Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: infra
name: aap_configuration
version: 1.0.0
version: 3.0.0
description: A collection of roles to manage Ansible Controller
readme: README.md
authors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
tasks:
- name: Include vars from configs directory
ansible.builtin.include_vars:
dir: "{{ controller_configs_dir | default((lookup('env', 'CONTROLLER_CONFIGS_DIR') == '') | ternary('./configs', lookup('env', 'CONTROLLER_CONFIGS_DIR'))) }}"
dir: "{{ aap_configs_dir | default((lookup('env', 'AAP_CONFIGS_DIR') == '') | ternary('./configs', lookup('env', 'AAP_CONFIGS_DIR'))) }}"
ignore_files: [controller_config.yml.template]
extensions: ["yml"]
tags:
- always

- name: Call dispatch role
ansible.builtin.include_role:
name: infra.controller_configuration.dispatch
name: infra.aap_configuration.dispatch
...
94 changes: 0 additions & 94 deletions playbooks/flatten_filetree_create_output.yaml

This file was deleted.

26 changes: 13 additions & 13 deletions playbooks/get_stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
gather_facts: true
vars:
# Using the Tower env names for backwards compatibility
controller_hostname: "{{ lookup('ansible.builtin.env', 'TOWER_HOST') }}"
controller_username: "{{ lookup('ansible.builtin.env', 'TOWER_USERNAME') }}"
controller_password: "{{ lookup('ansible.builtin.env', 'TOWER_PASSWORD') }}"
controller_validate_certs: "{{ lookup('ansible.builtin.env', 'TOWER_VERIFY_SSL') | default(false) }}"
aap_hostname: "{{ lookup('ansible.builtin.env', 'TOWER_HOST') }}"
aap_username: "{{ lookup('ansible.builtin.env', 'TOWER_USERNAME') }}"
aap_password: "{{ lookup('ansible.builtin.env', 'TOWER_PASSWORD') }}"
aap_validate_certs: "{{ lookup('ansible.builtin.env', 'TOWER_VERIFY_SSL') | default(false) }}"

tasks:
- name: Get number of JT
ansible.builtin.uri:
url: "https://{{ controller_hostname }}/api/v2/metrics/?format=json"
url: "https://{{ aap_hostname }}/api/v2/metrics/?format=json"
method: GET
force_basic_auth: true
user: "{{ controller_username }}"
password: "{{ controller_password }}"
user: "{{ aap_username }}"
password: "{{ aap_password }}"
return_content: true
headers:
Content-Type: application/json
Expand All @@ -39,11 +39,11 @@

- name: Get users info
ansible.builtin.uri:
url: "https://{{ controller_hostname }}/api/v2/users/?format=json"
url: "https://{{ aap_hostname }}/api/v2/users/?format=json"
method: GET
force_basic_auth: true
user: "{{ controller_username }}"
password: "{{ controller_password }}"
user: "{{ aap_username }}"
password: "{{ aap_password }}"
return_content: true
headers:
Content-Type: application/json
Expand Down Expand Up @@ -82,11 +82,11 @@

- name: Get subscription info
ansible.builtin.uri:
url: "https://{{ controller_hostname }}/api/v2/settings/all/?format=json"
url: "https://{{ aap_hostname }}/api/v2/settings/all/?format=json"
method: GET
force_basic_auth: true
user: "{{ controller_username }}"
password: "{{ controller_password }}"
user: "{{ aap_username }}"
password: "{{ aap_password }}"
return_content: true
headers:
Content-Type: application/json
Expand Down
14 changes: 7 additions & 7 deletions roles/ansible_config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Currently:
|`ansible_config_mode`|'0644'|no|str|The permissions the resulting ansible config file or directory should have.|
|`ansible_config_owner`|""|no|str|The owner the resulting ansible config file or directory should have.|
|`ansible_config_group`|""|no|str|The group the resulting ansible config file or directory should have.|
|`ah_configuration_working_dir`|"/var/tmp"|no|path|Location to render the ansible config file to.|
|`aap_configuration_working_dir`|"/var/tmp"|no|path|Location to render the ansible config file to.|
|`automation_hub_list`|`[]`|no|list|A list of Automation hubs and galaxies to put in the ansible config, see below for details.|
|`ansible_config_list`|`[{"header":"galaxy","keypairs":[{"key":"ignore_certs","value":"{{ not (platform_validate_certs \| bool) }}"}]}]`|no|list|A set of ansible config settings, a default is set, but can be overridden, see below for details.|
|`ansible_config_list`|`[{"header":"galaxy","keypairs":[{"key":"ignore_certs","value":"{{ not (aap_validate_certs \| bool) }}"}]}]`|no|list|A set of ansible config settings, a default is set, but can be overridden, see below for details.|
|`ah_token`|""|no|Tower Admin User's token on the Automation Hub Server. This should be stored in an Ansible Vault at or elsewhere and called from a parent playbook.||
|`ah_path_prefix`|`galaxy`|no|Tower Admin User's token on the Automation Hub Server. This should be stored in an Ansible Vault at or elsewhere and called from a parent playbook.||

Expand All @@ -28,12 +28,12 @@ Currently:
The following Variables compliment each other.
If Both variables are not set, secure logging defaults to false.
The role defaults to False as normally the ansible config task does not by default include sensitive information, we highly recommend the use of ansible vault for passwords and tokens.
platform_configuration_ansible_config_secure_logging defaults to the value of platform_configuration_secure_logging if it is not explicitly called. This allows for secure logging to be toggled for the entire suite of automation hub configuration roles with a single variable, or for the user to selectively use it.
aap_configuration_ansible_config_secure_logging defaults to the value of aap_configuration_secure_logging if it is not explicitly called. This allows for secure logging to be toggled for the entire suite of automation hub configuration roles with a single variable, or for the user to selectively use it.

|Variable Name|Default Value|Required|Description|
|:---:|:---:|:---:|:---:|
|`platform_configuration_ansible_config_secure_logging`|`False`|no|Whether or not to include the sensitive ansible config role tasks in the log. Set this value to `True` if you will be providing your sensitive values from elsewhere.|
|`platform_configuration_secure_logging`|`False`|no|This variable enables secure logging as well, but is shared across multiple roles, see above.|
|`aap_configuration_ansible_config_secure_logging`|`False`|no|Whether or not to include the sensitive ansible config role tasks in the log. Set this value to `True` if you will be providing your sensitive values from elsewhere.|
|`aap_configuration_secure_logging`|`False`|no|This variable enables secure logging as well, but is shared across multiple roles, see above.|

## Data Structures

Expand Down Expand Up @@ -70,7 +70,7 @@ ansible_config_list:
- header: galaxy
keypairs:
- key: ignore_certs
value: "{{ not (platform_validate_certs | bool) }}"
value: "{{ not (aap_validate_certs | bool) }}"
- key: server_list
value: "{{ automation_hub_list | map(attribute='name') | join(',') }}"

Expand All @@ -92,7 +92,7 @@ automation_hub_list:
connection: local
gather_facts: false
vars:
platform_validate_certs: false
aap_validate_certs: false
# Define following vars here, or in ah_configs/ah_auth.yml
# ah_host: ansible-ah-web-svc-test-project.example.com
# ah_token: changeme
Expand Down
Loading

0 comments on commit 4fec59a

Please sign in to comment.