Skip to content

Commit

Permalink
Revert "Revert "Renaming to platform variables"" (#934)
Browse files Browse the repository at this point in the history
* Revert "Revert "Renaming to platform variables" (#932)"

This reverts commit 4a380f3.

* Update Rewrite.yml

* more tweaking for release

* Undo changes to changelog

* Update CHANGELOG.rst

* Update .github/workflows/pre-commit.yml

---------

Co-authored-by: Sean Sullivan <[email protected]>
  • Loading branch information
Tompage1994 and sean-m-sullivan authored Oct 16, 2024
1 parent 4a380f3 commit dc1d494
Show file tree
Hide file tree
Showing 506 changed files with 4,113 additions and 5,738 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
2 changes: 1 addition & 1 deletion .github/files/ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[defaults]
collections_paths=/home/runner/collections
collections_path=/home/runner/collections
roles_path=roles/
lookup_plugins=plugins/lookup/
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 }}
...
6 changes: 3 additions & 3 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: 2.10.0
collection_name: aap_configuration
collection_version: 3.0.0-devel
collection_repo: https://github.com/redhat-cop/aap_configuration/
collection_dependencies: awx.awx
collection_dependencies: awx.awx ansible.eda ansible.hub
...
4 changes: 2 additions & 2 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 @@ -284,7 +284,7 @@ Minor Changes
Bugfixes
--------

- Enable the ability to define simple_workflow_nodes on workflow_job_templates without the need to set the `state` on a workflow_job_template (https://github.com/redhat-cop/aap_configuration/issues/297).
- Enable the ability to define simple_workflow_nodes on workflow_job_templates without the need to set the `state` on a workflow_job_template (https://github.com/redhat-cop/controller_configuration/issues/297).

v2.2.4
======
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
2 changes: 1 addition & 1 deletion changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ releases:
changes:
bugfixes:
- Enable the ability to define simple_workflow_nodes on workflow_job_templates
without the need to set the `state` on a workflow_job_template (https://github.com/redhat-cop/aap_configuration/issues/297).
without the need to set the `state` on a workflow_job_template (https://github.com/redhat-cop/controller_configuration/issues/297).
minor_changes:
- Add max_forks, max_concurrent_jobs as options to instance_groups role
- Add no_log everywhere controller_api_plugin is used to avoid to expose sensitive
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
...
9 changes: 9 additions & 0 deletions changelogs/fragments/Rewrite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
breaking_changes:
- Major overhaul to all code completed, variables have changed, role names have changed, please see the tranition guide for more details.
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.
3 changes: 0 additions & 3 deletions changelogs/fragments/filetree_node_schedule_survey.yml

This file was deleted.

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
1 change: 1 addition & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ build_ignore:
- release.yml
- .github
- '*.tar.gz'
- tests/*
license:
- GPL-3.0-or-later
tags:
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
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 (ah_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.
ah_configuration_ansible_config_secure_logging defaults to the value of ah_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|
|:---:|:---:|:---:|:---:|
|`ah_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.|
|`ah_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 (ah_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:
ah_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 dc1d494

Please sign in to comment.