Skip to content

Commit

Permalink
Merge branch 'redhat-cop:devel' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
Tompage1994 authored Nov 27, 2023
2 parents 590ab28 + a85c4a5 commit a915dcb
Show file tree
Hide file tree
Showing 309 changed files with 6,240 additions and 1,403 deletions.
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exclude_paths:
- '.github/'
- 'roles/master_role_example/'
- 'changelogs/'
- 'tests/templated_role_example'
parseable: true
use_default_rules: true
# https://github.com/ansible/ansible-lint/issues/808
Expand All @@ -21,6 +22,7 @@ skip_list:
- meta-runtime # This collection with the appropriate awx.awx or ansible.controller still works with older ansible.
- role-name[path]
- sanity[cannot-ignore] # We're only ignoring sanity rules when we have to
- var-naming[no-role-prefix]
kinds:
- playbooks: "**/examples/templates/*.{yml,yaml}"
- playbooks: "**/examples/*.{yml,yaml}"
Expand Down
2 changes: 2 additions & 0 deletions .ansible-lint-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
plugins/lookup/controller_object_diff.py yaml[document-end]
plugins/modules/controller_export_diff.py yaml[document-end]
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ labels: bug, new
---

<!--- Verify first that your issue is not already reported on GitHub -->
<!--- If this is a request for help, please use the forum https://forum.ansible.com/tag/infra-config-as-code -->
<!--- Also test if the latest release are affected -->

# Summary
Expand Down
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: false # default is true
contact_links:
- name: Help and Support
url: https://forum.ansible.com/tag/infra-config-as-code
about: We use the ansible forums for Annoucements, Getting Help, and more!
- name: Feature requests
url: https://github.com/redhat-cop/controller_configuration/discussions/categories/ideas
about: Suggest an idea for this project
Expand Down
2 changes: 1 addition & 1 deletion ansible.cfg → .github/files/ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[defaults]
collections_paths=collections
collections_paths=/home/runner/collections
roles_path=roles/
lookup_plugins=plugins/lookup/
3 changes: 2 additions & 1 deletion galaxy.yml.j2 → .github/files/galaxy.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: A collection of roles to manage Ansible Controller
readme: README.md
authors:
- Andrew Huffman
- Jonathan Lozada De La Matta @jlozadad
- Adebisi Oyawale @aoyawale
- Kedar Kulkarni @kedark3
- Tom Page @Tompage1994
- Sean Sullivan @sean-m-sullivan
Expand All @@ -27,4 +27,5 @@ tags:
- collection
- controller_configuration
- automation_platform
- infrastructure
...
10 changes: 5 additions & 5 deletions .github/workflows/ci_standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
matrix:
awx_version:
- devel
- 21.13.0
- 21.12.0
- 21.11.0
# - 20.1.0 Diabled until working
# - 19.5.1 Diabled until working
- 23.3.1
- 23.3.0
- 23.0.0
- 22.7.0
uses: "./.github/workflows/ci_standalone_versioned.yml"
with:
awx_version: ${{ matrix.awx_version }}
gh_ref: ${{ github.event.pull_request.head.sha || github.sha }}
34 changes: 28 additions & 6 deletions .github/workflows/ci_standalone_versioned.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
description: The version to pull of awx
required: true
type: string
gh_ref:
description: The ref in the repository to pull
required: false
default: devel
type: string
env:
# Run docker-compose up in the background
COMPOSE_UP_OPTS: -d
Expand All @@ -17,17 +22,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ inputs.gh_ref }}

- name: "Checkout galaxy_ng"
- name: Checkout AWX
uses: actions/checkout@v2
with:
repository: ansible/awx
path: awx
ref: ${{ inputs.awx_version }}

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.11"

- name: Update apt
run: sudo apt -y update
Expand All @@ -36,14 +43,18 @@ jobs:
run: sudo apt-get install -y libsasl2-dev python3-dev libldap2-dev libssl-dev build-essential

- name: Install docker-compose
run: pip3 install --upgrade docker-compose
run: pip3 install --upgrade docker-compose pyyaml==5.3.1

- name: collect system info
run: whoami; id; pwd; ls -al; uname -a ; df -h .; mount ; cat /etc/issue; docker --version ; ps aux | fgrep -i docker; ls -al /var/run/containerd/containerd.sock

- name: set the awx password in the inventory
run: echo "admin_password='password'" >> awx/tools/docker-compose/inventory

- name: Find and replace dependency
run: sed -i 's,rsyslog-8.2102.0-106.el9 ,https://download.copr.fedorainfracloud.org/results/ansible/Rsyslog/epel-9-x86_64/06076718-rsyslog/rsyslog-8.2102.0-106.el9.x86_64.rpm ,' tools/ansible/roles/dockerfile/templates/Dockerfile.j2
working-directory: awx

- name: build images
working-directory: awx
run: make docker-compose-build
Expand All @@ -56,15 +67,26 @@ jobs:
- name: give some time to spin up
run: sleep 30

- name: Move ansible.cfg to root
run: mv .github/files/ansible.cfg .

- name: Display Versions
run: which python && pip --version && ansible --version

- name: Build and install the collection
uses: redhat-cop/ansible_collections_tooling/actions/build_ansible_collection@main
with:
collection_namespace: infra
collection_name: controller_configuration
collection_version: 2.0.0
collection_repo: https://github.com/redhat-cop/controller_configuration/

- name: "Install Galaxy dependencies"
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
run: ansible-playbook tests/configure_controller.yml -e controller_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
run: ansible-playbook tests/configure_controller_export_model.yml -e controller_hostname=localhost:8043 -v -e awx_version=${{ inputs.awx_version }}
...
31 changes: 20 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,38 @@ jobs:
matrix:
awx_version:
- devel
- 21.13.0
- 21.12.0
- 22.4.0
- 22.3.0
- 21.11.0
# - 20.1.0 Diabled until working
# - 19.5.1 Diabled until working
uses: "./.github/workflows/ci_standalone_versioned.yml"
with:
awx_version: ${{ matrix.awx_version }}
release:
needs:
- ci_standalone
uses: "redhat-cop/ansible_collections_tooling/.github/workflows/release_pipeline.yml@main"
uses: "redhat-cop/ansible_collections_tooling/.github/workflows/release_pipeline_dual.yml@main"
with:
collection_namespace: infra
collection_namespace_2: redhat_cop
collection_name: controller_configuration
# Galaxy Publish
collection_namespace_1: infra
collection_name_1: controller_configuration
publish_url_collection_1: https://galaxy.ansible.com/api/
galaxy_publish_1: true
ah_publish_1: false
# CRC Publish
collection_namespace_2: infra
collection_name_2: controller_configuration
publish_url_collection_2: https://cloud.redhat.com/api/automation-hub/
galaxy_publish_2: false
ah_publish_2: true
collection_version: ${{ github.ref_name }}
collection_repo: https://github.com/redhat-cop/controller_configuration/
quay_username: redhat_cop
collection_dependencies: awx.awx
matrix_message: This Ansible collection allows for easy interaction with an AWX or Ansible Controller server via Ansible roles using the AWX/Controller collection modules.
secrets:
galaxy_api_key: ${{ secrets.ANSIBLE_GALAXY_APIKEY }}
infra_api_key: ${{ secrets.GALAXY_INFRA_KEY }}
token: ${{ secrets.GITHUB_TOKEN }}
collection_api_key_1: ${{ secrets.GALAXY_INFRA_KEY }}
collection_api_key_2: ${{ secrets.CRC_PUBLISH_KEY }}
git_token: ${{ secrets.GITHUB_TOKEN }}
quay_token: ${{ secrets.quay_token }}
matrix_token: ${{ secrets.matrix_token }}
...
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
collections/*
!collections/requirements.yml
galaxy.yml
*.tar.gz
*.pyc
id_rsa*
test
tests/output
.vscode
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v4.4.0
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -14,7 +14,7 @@ repos:
# types:
# - yaml
- repo: 'https://github.com/ansible-community/ansible-lint.git'
rev: v6.14.3
rev: v6.22.0
hooks:
# see discussions here about what arguments are used, and behavior
# https://github.com/ansible/ansible-lint/issues/649
Expand All @@ -30,19 +30,19 @@ repos:
- "ansible-core>=2.13"
- "yamllint>=1.26,<2.0"
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.6.0
rev: v0.11.0
hooks:
- id: markdownlint-cli2
- repo: https://github.com/ambv/black
rev: 23.1.0
rev: 23.11.0
hooks:
- id: black
name: black
entry: black
args: [--config=.black.cfg, --check, --diff]
types: [python]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
name: flake8
Expand Down
104 changes: 102 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,114 @@ infra.controller_configuration Release Notes
.. contents:: Topics


v2.5.2
======

Bugfixes
--------

- Fixed issue with organization creation with instance group. Execute instance and instance_group before organizations.
- dispatch - Fixed the order and behavior to run as a single task with options for organization behavior.
- filetree_create - Fixed the misspelled variable name that caused exported job_templates yaml files containing incorrect name.
- filetree_create and object_diff- Subelement filter is executed before when and it was causing a failure when the list was not defined.

v2.5.1
======

Minor Changes
-------------

- Adds request_timeout to controller_export_diff module, and roles
- licence role now uses a boolean of controller_license.use_looup to determine whether to lookup subscriptions. A lookup is only needed to refresh the available pools, or if it has never been done. See Role Readme for details.

Bugfixes
--------

- Fixed issue with licence role not operating properly, when a controller never had credentials provided for subscription lookup. See Role Readme for proper usuage.
- Fixed issue with organization role not acceppting default environments option correctly.

v2.5.0
======

Minor Changes
-------------

- Added roles option to roles role to allow setting multiple roles in one item rather than repeating entire sections of code
- ansible.cfg removed from root and galaxy.yml added to enable install from source

Bugfixes
--------

- Added more attributes to be expanded and used by the comparison
- Fixed lintering issues

v2.4.1
======

Minor Changes
-------------

- Add option to change async directory, and set the default to null. /tmp/.ansible_async was a workaround while the default was broken previously.
- Change from lookup to query in the object_diff task files
- add organizations tag in a dispatch task which is in charge of applying galaxy credencitals in the organization.
- added the instance_groups filed to the roles role.
- added the possibility to export schedules through the filetree_create role
- filetree_create now allows to export objects for the specified organization
- remove depencency of CONTROLER_USERNAME variable for object_diff role by calling the API with api/me instead of calling the api/users and filtering by username

Bugfixes
--------

- Changes default value for `*_enforce_defaults` to false instead of the truthy value (due to the quotes), 'false'.
- Fix addition of `state: present` when `with_present: true`
- Temporarily fixed an error when installing docker-compose using pip (see https://stackoverflow.com/questions/76708329/docker-compose-no-longer-building-image-attributeerror-cython-sources for more information)
- When exporting job templates it was failing when missing some input information.
- When exporting schedules, the diff_mode was not treated correctly
- When importing the exported notification templates, the types of some values are not as expected.
- When importing the exported settings, fields like `AUTOMATION_ANALYTICS_LAST_GATHER: 2023-07-17T13:22:06.445818Z` caused problems with the multiple `:`.
- fix 'credentials' role ignoring 'update_secrets false' and forcing to default 'true'
- fixed an the users and teams field on the roles role to be correct and not singular.

v2.4.0
======

Minor Changes
-------------

- Added Roles bulk_host_create, bulk_job_launch.
- Added new_name option to the roles applications, credential_types, execution_environments, inventories, projects, users.
- Added new_username option to user role.
- Added option to multiple roles to enforce defaults. This is described in each of the roles readmes and will slowly be rolled out to all applicable roles. This option enforces module/api defaults in order to prevent config drift. This makes it so if an option is NOT specified in a configuration it enforces the default value. It is not enabled by default.
- Added scm_branch option to inventory_sources role.
- Corrected various readmes.
- Credentials role credential type set to mandatory. This would fail in the past if it was not set, this just codifies it.
- If someone wants to have the old behavior, or only update projects with dispatch, the dispatch variable controller_configuration_dispatcher_roles can be overwritten and customized.
- Instances role - changed default of node_type and node_state to omit, as generally these cannot be changed on existing instances unless deploying new instances.
- Inventory role - added input_inventories option for constructed inventories.
- Removed project_update from dispatch. This is because with bringing update_project option in line with the module options, it was running twice both in project and project update. Since both roles use the same variable controller_projects.
- Set the default behavior of project_update to run the update as true, unless the user explicitly sets the variable update_project to overide the default behavior. This is because if the user is specifically calling project_update it should by default update the project.
- Updated workflow job template options to use non depreciated names for options. This should not affect any operations.
- added alias's for applicable roles to use the variables set by the awx cli export.
- added get_stats.yml playbook in the playbook folder to get some basic info on a Tower/Controller instance
- added option for using the export form of default execution environment.
- added option to roles role to support upcoming change to allow lists of teams and users to be used in the module.
- added options to license role to allow use of subcription lookup or pool_id.

Bugfixes
--------

- Fixed defaults for values that are lists.
- Fixed filetree read to error when organization not defined.
- Fixed rrule in schedules to not be mandatory.

v2.3.1
======

Bugfixes
--------

- Added argument_spec for all roles
- Ensures vars get loaded properly by dispatch role
- Fixed issue in filetree_read where arg spec incorrect and caused failure (#550)

v2.3.0
======
Expand All @@ -24,6 +124,7 @@ Minor Changes
- Add new type of objects for object_diff role: applications, execution environments, instance groups, notifications and schedules
- Add no_log to all tasks that populates data to avoid exposing encrypted data
- Add task to add Galaxy credentials and Execution Environments to Organization.
- Added argument_spec for all roles
- Set the variables to assign_galaxy_credentials_to_org and assign_default_ee_to_org to false in the task to run all roles at dispatch role.
- avoid to create orgs during drop_diff
- fixed an extra blank line in schedules readme that was breaking the table
Expand All @@ -37,7 +138,6 @@ Breaking Changes / Porting Guide
Bugfixes
--------

- Added argument_spec for all roles
- Fixed name of task for inventory source update
- Fixed variable definitions in readmes
- Removed master_role_example as no longer required (this wasn't a functional role)
Expand Down
Loading

0 comments on commit a915dcb

Please sign in to comment.