Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "Renaming to platform variables"" #934

Merged
merged 6 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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 }}
...
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: 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this take a list?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not without changing it all I believe

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to make that change to fix the workflows

Copy link
Collaborator Author

@Tompage1994 Tompage1994 Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I see what you're referring to now... (not clear in the GH ui). It does take a space separated list

Suggested change
collection_dependencies: awx.awx
collection_dependencies: awx.awx ansible.eda ansible.hub

We would also need ansible.platform but that doesn't seem to be on galaxy so that may not be too helpful

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sean-m-sullivan I think you're involved with the ansible.platform collection... is it going to be on galaxy? (or am I missing it?)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, we might need to change the workflow stuff but we can work on that later

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not AFAIK, I was involved in the initial push of it, but have not been more recently, but it it is my understanding it will not be public.

...
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
...
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
Loading
Loading