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 Mar 27, 2023
2 parents ac5e529 + 251b328 commit 590ab28
Show file tree
Hide file tree
Showing 414 changed files with 6,249 additions and 1,031 deletions.
4 changes: 4 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ skip_list:
# Skipping fqcn[action] because this collection supports using either the awx.awx or ansible.controller collection
# so a FQCN cannot be used in module names
- fqcn[action]
- fqcn[keyword]
- 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
kinds:
- playbooks: "**/examples/templates/*.{yml,yaml}"
- playbooks: "**/examples/*.{yml,yaml}"
Expand Down
10 changes: 5 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Python's pre-commit tool can be installed, and hooks installed, to cleanup white

1. Create a local virtual environment for controller_configurations (suggested, its your system!)
2. Use pip to install pre-commit in your environment of choice: `pip install pre-commit`
3. Install pre-commit hooks with `pre-commit install --install-hooks -c .github/workflow-config/.pre-commit-config.yml`
3. Install pre-commit hooks with `pre-commit install --install-hooks -c .pre-commit-config.yaml`
4. With hooks installed, they will be run automatically when you call `git commit`, blocking commit if any hooks fail.
5. [Optional] If you want to ignore hook failures and commit anyway, use `git commit -n`
6. [Optional] Run pre-commit checks at any time with `pre-commit run --all -c .github/workflow-config/.pre-commit-config.yml`.
6. [Optional] Run pre-commit checks at any time with `pre-commit run --all -c .pre-commit-config.yaml`.

Please see pre-commit documentation for further explanation: [Pre-commit](https://pre-commit.com/)

Expand All @@ -29,14 +29,14 @@ 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/controller_configuration/blob/devel/examples/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/controller_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.
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.
8. All Pull Requests will be subject to Ansible and Yaml Linting checks. Please make sure that your code complies and fix any warnings that arise. These are Checks that appear at the bottom of your Pull Request.
9. All Pull requests are subject to Testing against being used in controller. As above there is a check at the bottom of your pull request for this named integration.

See [Using Pull Requests](https://help.github.com/articles/using-pull-requests/) got more information on how to use GitHub PRs.
See [Using Pull Requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) got more information on how to use GitHub PRs.

For an in depth guide on how to contribute see [this article](https://opensource.com/article/19/7/create-pull-request-github)

Expand All @@ -57,6 +57,6 @@ As with all Ansible projects, we have a [Code of Conduct].
[ansible announce](https://groups.google.com/forum/#!forum/ansible-announce)
[ansible communication](https://docs.ansible.com/ansible/latest/community/communication.html)
[code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
[creating your fork on github](https://guides.github.com/activities/forking/)
[creating your fork on github](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
[discussions](https://github.com/redhat-cop/controller_configuration/discussions)
[supported ansible versions](https://docs.ansible.com/ansible-core/devel/reference_appendices/release_and_maintenance.html#ansible-core-release-cycle)
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ contact_links:
- name: Discussions
url: https://github.com/redhat-cop/controller_configuration/discussions
about: Any kind of questions should go on the forum.
- name: Matrix room
url: https://matrix.to/#/#aap_config_as_code:ansible.com
about: Matrix room for questions and discussion.
- name: Ansible Code of Conduct
url: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html
about: Be nice to other members of the community. Behave.

This file was deleted.

5 changes: 0 additions & 5 deletions .github/tests/configs/instances.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/tests/templates/tasks/manage_execution_environments.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflow-config/kube/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# Find the latest tag here: https://github.com/ansible/awx-operator/releases
- github.com/ansible/awx-operator/config/default?ref=1.0.0
- github.com/ansible/awx-operator/config/default?ref=1.1.3
- awx.yaml

# Set the image tags to match the git version from above
images:
- name: quay.io/ansible/awx-operator
newTag: 1.0.0
newTag: 1.1.3

# Specify a custom namespace in which to install AWX
namespace: default
Expand Down
4 changes: 2 additions & 2 deletions .github/workflow-config/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# Find the latest tag here: https://github.com/ansible/awx-operator/releases
- github.com/ansible/awx-operator/config/default?ref=1.0.0
- github.com/ansible/awx-operator/config/default?ref=1.1.3

# Set the image tags to match the git version from above
images:
- name: quay.io/ansible/awx-operator
newTag: 1.0.0
newTag: 1.1.3

# Specify a custom namespace in which to install AWX
namespace: default
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/ci_standalone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Test collection with AWX matrix
on:
push:
branches:
- '*_'
- devel
tags:
- '*_' # ending underscore for trying things
- 'v[0-9]+.[0-9]+.[0-9]+' # final version
- 'v[0-9]+.[0-9]+.[0-9]+[abrc]+[0-9]+' # alpha, beta, release candidate (rc)
- 'v[0-9]+.[0-9]+.[0-9]+.dev[0-9]+' # development versions
pull_request:

jobs:
ci_standalone:
strategy:
fail-fast: false
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
uses: "./.github/workflows/ci_standalone_versioned.yml"
with:
awx_version: ${{ matrix.awx_version }}
70 changes: 70 additions & 0 deletions .github/workflows/ci_standalone_versioned.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
name: Test collection with AWX

on:
workflow_call:
inputs:
awx_version:
description: The version to pull of awx
required: true
type: string
env:
# Run docker-compose up in the background
COMPOSE_UP_OPTS: -d

jobs:
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

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

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

- name: Update apt
run: sudo apt -y update

- name: Install requirements
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

- 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: build images
working-directory: awx
run: make docker-compose-build

- name: build stack
working-directory: awx
run: make docker-compose up
continue-on-error: true

- name: give some time to spin up
run: sleep 30

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

- 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

- name: "Perform export model playbook tests"
run: ansible-playbook tests/configure_controller_export_model.yml -e controller_hostname=localhost:8043 -v
...
33 changes: 14 additions & 19 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,26 @@ name: pre-commit tests


on:
pull_request:
push:
branches:
- '*_' # ending underscore for trying things
- devel
tags:
- '*_' # ending underscore for trying things
- 'v[0-9]+.[0-9]+.[0-9]+' # final version
- 'v[0-9]+.[0-9]+.[0-9]+[abrc]+[0-9]+' # alpha, beta, release candidate (rc)
- 'v[0-9]+.[0-9]+.[0-9]+.dev[0-9]+' # development versions
pull_request:
schedule:
- cron: "0 6 * * *"

jobs:
pre-commit:
uses: sean-m-sullivan/infra_git_ci_cd/.github/workflows/pre-commit.yml@main
sanity:
uses: sean-m-sullivan/infra_git_ci_cd/.github/workflows/sanity.yml@main
pre-commit_and_sanity:
uses: "redhat-cop/ansible_collections_tooling/.github/workflows/pre_commit_and_sanity.yml@main"
with:
collection_namespace: redhat_cop
collection_namespace: infra
collection_name: controller_configuration
collection_version: 1.0.0
collection_version: 2.0.0
collection_repo: https://github.com/redhat-cop/controller_configuration/
all_green:
if: ${{ always() }}
needs:
- pre-commit
- sanity
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
'${{ needs.pre-commit.result }}',
'${{ needs.sanity.result }}',
]) == {'success'}"
collection_dependencies: awx.awx
...
79 changes: 22 additions & 57 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,70 +9,35 @@ on:
- published

jobs:
pre-commit:
uses: sean-m-sullivan/infra_git_ci_cd/.github/workflows/pre-commit.yml@main
sanity:
uses: sean-m-sullivan/infra_git_ci_cd/.github/workflows/sanity.yml@main
ci_standalone:
strategy:
fail-fast: false
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
uses: "./.github/workflows/ci_standalone_versioned.yml"
with:
collection_namespace: redhat_cop
collection_name: controller_configuration
collection_version: 1.0.0
collection_repo: https://github.com/redhat-cop/controller_configuration/
prechecks:
needs:
- pre-commit
- sanity
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
'${{ needs.pre-commit.result }}',
'${{ needs.sanity.result }}',
]) == {'success'}"
cop_release:
needs:
- prechecks
uses: sean-m-sullivan/infra_git_ci_cd/.github/workflows/release.yml@main
with:
collection_namespace: redhat_cop
collection_name: controller_configuration
collection_version: ${{ github.ref_name }}
collection_repo: https://github.com/redhat-cop/controller_configuration/
secrets:
api_key: ${{ secrets.ANSIBLE_GALAXY_APIKEY }}
token: ${{ secrets.GITHUB_TOKEN }}
infra_release:
needs:
- cop_release
uses: sean-m-sullivan/infra_git_ci_cd/.github/workflows/release.yml@main
with:
collection_namespace: infra
collection_name: controller_configuration
collection_version: ${{ github.ref_name }}
collection_repo: https://github.com/redhat-cop/controller_configuration/
secrets:
api_key: ${{ secrets.GALAXY_INFRA_KEY }}
token: ${{ secrets.GITHUB_TOKEN }}
release_check:
needs:
- cop_release
- infra_release
runs-on: ubuntu-latest
steps:
- run: >-
python -c "assert set([
'${{ needs.infra_release.result }}',
'${{ needs.cop_release.result }}',
]) == {'success'}"
changelog:
awx_version: ${{ matrix.awx_version }}
release:
needs:
- release_check
uses: sean-m-sullivan/infra_git_ci_cd/.github/workflows/create_changelog.yml@main
- ci_standalone
uses: "redhat-cop/ansible_collections_tooling/.github/workflows/release_pipeline.yml@main"
with:
collection_namespace: infra
collection_namespace_2: redhat_cop
collection_name: controller_configuration
collection_version: ${{ github.ref_name }}
collection_repo: https://github.com/redhat-cop/controller_configuration/
quay_username: redhat_cop
collection_dependencies: awx.awx
secrets:
galaxy_api_key: ${{ secrets.ANSIBLE_GALAXY_APIKEY }}
infra_api_key: ${{ secrets.GALAXY_INFRA_KEY }}
token: ${{ secrets.GITHUB_TOKEN }}
quay_token: ${{ secrets.quay_token }}
...
Loading

0 comments on commit 590ab28

Please sign in to comment.