From b8c1f58be05c5f0b77fc72916ef13285741ecafa Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 8 Jun 2022 16:37:07 +0200 Subject: [PATCH 01/37] bump version to 1.3.0-dev again --- galaxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy.yml b/galaxy.yml index cbf1a38..a5c80e8 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -11,7 +11,7 @@ authors: - "Kyle Williams " - "Matthias Dellweg <2500@gmx.de>" - "willtome " -version: "1.2.2" +version: "1.3.0-dev" license: - "GPL-3.0-or-later" tags: From 7dddc4a95e0075aad740e0c79fd6af93cf0be05b Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 14 Jun 2022 16:43:40 +0200 Subject: [PATCH 02/37] rename tasks files to be .yml for consistency and proper branding --- roles/cloud_connector/tasks/cleanup_receptor.yml | 2 +- .../tasks/{delete_source.yaml => delete_source.yml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename roles/cloud_connector/tasks/{delete_source.yaml => delete_source.yml} (100%) diff --git a/roles/cloud_connector/tasks/cleanup_receptor.yml b/roles/cloud_connector/tasks/cleanup_receptor.yml index f2227f8..df6d28a 100644 --- a/roles/cloud_connector/tasks/cleanup_receptor.yml +++ b/roles/cloud_connector/tasks/cleanup_receptor.yml @@ -15,7 +15,7 @@ file_type: directory register: receptor_configs -- include_tasks: delete_source.yaml +- include_tasks: delete_source.yml loop: "{{ receptor_configs['files'] }}" - name: Collect service facts diff --git a/roles/cloud_connector/tasks/delete_source.yaml b/roles/cloud_connector/tasks/delete_source.yml similarity index 100% rename from roles/cloud_connector/tasks/delete_source.yaml rename to roles/cloud_connector/tasks/delete_source.yml From 82ccda8c2b6d9076e25d9728b65399452fba663e Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 14 Jun 2022 11:55:47 +0200 Subject: [PATCH 03/37] also enable pulpcore module when enabling katello --- roles/foreman_repositories/tasks/redhat-modules.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/roles/foreman_repositories/tasks/redhat-modules.yml b/roles/foreman_repositories/tasks/redhat-modules.yml index f7c5cfc..8cdf41a 100644 --- a/roles/foreman_repositories/tasks/redhat-modules.yml +++ b/roles/foreman_repositories/tasks/redhat-modules.yml @@ -11,15 +11,18 @@ when: - foreman_repositories_version == "nightly" or foreman_repositories_version is version('3.2', '>=') -- name: 'Enable katello:el8 module' - command: dnf module enable -y katello:el8 +- name: 'Enable katello el8 modules' + command: "dnf module enable -y {{ item }}:el8" # can't use the `dnf` module for modules without a default stream # https://github.com/ansible/ansible/issues/56504 # https://github.com/ansible/ansible/issues/64852 args: - creates: /etc/dnf/modules.d/katello.module + creates: "/etc/dnf/modules.d/{{ item }}.module" tags: - packages + loop: + - katello + - pulpcore when: - foreman_repositories_katello_version is defined - foreman_repositories_katello_version == "nightly" or foreman_repositories_katello_version is version('4.4', '>=') From 5879b372097757b4213278dfc648e7af142943e1 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 17 Jun 2022 13:28:03 +0200 Subject: [PATCH 04/37] Release 1.2.3 --- CHANGELOG.rst | 8 ++++++++ changelogs/changelog.yaml | 5 +++++ galaxy.yml | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 73f5d3b..b917148 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,14 @@ theforeman.operations Release Notes .. contents:: Topics +v1.2.3 +====== + +Bugfixes +-------- + +- foreman_repositories - also enable pulpcore module when enabling katello + v1.2.2 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 126494e..2a1d270 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -52,3 +52,8 @@ releases: fragments: - 94-subject-regex.yml release_date: '2022-06-08' + 1.2.3: + changes: + bugfixes: + - foreman_repositories - also enable pulpcore module when enabling katello + release_date: '2022-06-17' diff --git a/galaxy.yml b/galaxy.yml index a5c80e8..041e38e 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -11,7 +11,7 @@ authors: - "Kyle Williams " - "Matthias Dellweg <2500@gmx.de>" - "willtome " -version: "1.3.0-dev" +version: "1.2.3" license: - "GPL-3.0-or-later" tags: From c5b4e2dcf005d9225c7c092c705c33de48f5dc38 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 17 Jun 2022 13:28:19 +0200 Subject: [PATCH 05/37] bump version to 1.3.0-dev again --- galaxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy.yml b/galaxy.yml index 041e38e..a5c80e8 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -11,7 +11,7 @@ authors: - "Kyle Williams " - "Matthias Dellweg <2500@gmx.de>" - "willtome " -version: "1.2.3" +version: "1.3.0-dev" license: - "GPL-3.0-or-later" tags: From ef55553bcd95202c55cfb1c1a53a155726d5f0e8 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 29 Aug 2022 14:02:40 +0200 Subject: [PATCH 06/37] don't run ansible devel tests on Python 3.8 --- .github/workflows/main.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc90022..013342c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,6 @@ jobs: - stable-2.11 - stable-2.12 - stable-2.13 - - devel include: - python: "2.7" ansible: "stable-2.11" @@ -117,19 +116,23 @@ jobs: runs-on: ubuntu-latest strategy: matrix: + python: + - "3.8" ansible: - stable-2.9 - stable-2.10 - stable-2.11 - stable-2.12 - stable-2.13 - - devel + include: + - python: "3.9" + ansible: "devel" steps: - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: ${{ matrix.python }} - name: Install Ansible run: pip install --upgrade https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz - name: Install dependencies From 8a0d69e52b31dcaa750c280e902cf64e096dcff7 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 29 Aug 2022 14:36:36 +0200 Subject: [PATCH 07/37] update community.docker to 3 --- roles/ansible_repositories/molecule/redhat/collections.yml | 2 +- .../molecule/default/collections.yml | 2 +- roles/foreman_repositories/molecule/debian/collections.yml | 2 +- roles/foreman_repositories/molecule/redhat/collections.yml | 2 +- roles/installer/molecule/default/collections.yml | 2 +- roles/postgresql_upgrade/molecule/redhat/collections.yml | 2 +- roles/puppet_repositories/molecule/debian/collections.yml | 2 +- roles/puppet_repositories/molecule/redhat/collections.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/roles/ansible_repositories/molecule/redhat/collections.yml b/roles/ansible_repositories/molecule/redhat/collections.yml index 4ba6628..03425ca 100644 --- a/roles/ansible_repositories/molecule/redhat/collections.yml +++ b/roles/ansible_repositories/molecule/redhat/collections.yml @@ -1,5 +1,5 @@ collections: - name: community.docker - version: ">=1.2.0,<2" + version: ">=3,<4" - name: community.general version: ">=2,<3" diff --git a/roles/foreman_proxy_certs_generate/molecule/default/collections.yml b/roles/foreman_proxy_certs_generate/molecule/default/collections.yml index 4ba6628..03425ca 100644 --- a/roles/foreman_proxy_certs_generate/molecule/default/collections.yml +++ b/roles/foreman_proxy_certs_generate/molecule/default/collections.yml @@ -1,5 +1,5 @@ collections: - name: community.docker - version: ">=1.2.0,<2" + version: ">=3,<4" - name: community.general version: ">=2,<3" diff --git a/roles/foreman_repositories/molecule/debian/collections.yml b/roles/foreman_repositories/molecule/debian/collections.yml index 4ba6628..03425ca 100644 --- a/roles/foreman_repositories/molecule/debian/collections.yml +++ b/roles/foreman_repositories/molecule/debian/collections.yml @@ -1,5 +1,5 @@ collections: - name: community.docker - version: ">=1.2.0,<2" + version: ">=3,<4" - name: community.general version: ">=2,<3" diff --git a/roles/foreman_repositories/molecule/redhat/collections.yml b/roles/foreman_repositories/molecule/redhat/collections.yml index 4ba6628..03425ca 100644 --- a/roles/foreman_repositories/molecule/redhat/collections.yml +++ b/roles/foreman_repositories/molecule/redhat/collections.yml @@ -1,5 +1,5 @@ collections: - name: community.docker - version: ">=1.2.0,<2" + version: ">=3,<4" - name: community.general version: ">=2,<3" diff --git a/roles/installer/molecule/default/collections.yml b/roles/installer/molecule/default/collections.yml index 4ba6628..03425ca 100644 --- a/roles/installer/molecule/default/collections.yml +++ b/roles/installer/molecule/default/collections.yml @@ -1,5 +1,5 @@ collections: - name: community.docker - version: ">=1.2.0,<2" + version: ">=3,<4" - name: community.general version: ">=2,<3" diff --git a/roles/postgresql_upgrade/molecule/redhat/collections.yml b/roles/postgresql_upgrade/molecule/redhat/collections.yml index 4ba6628..03425ca 100644 --- a/roles/postgresql_upgrade/molecule/redhat/collections.yml +++ b/roles/postgresql_upgrade/molecule/redhat/collections.yml @@ -1,5 +1,5 @@ collections: - name: community.docker - version: ">=1.2.0,<2" + version: ">=3,<4" - name: community.general version: ">=2,<3" diff --git a/roles/puppet_repositories/molecule/debian/collections.yml b/roles/puppet_repositories/molecule/debian/collections.yml index 4ba6628..03425ca 100644 --- a/roles/puppet_repositories/molecule/debian/collections.yml +++ b/roles/puppet_repositories/molecule/debian/collections.yml @@ -1,5 +1,5 @@ collections: - name: community.docker - version: ">=1.2.0,<2" + version: ">=3,<4" - name: community.general version: ">=2,<3" diff --git a/roles/puppet_repositories/molecule/redhat/collections.yml b/roles/puppet_repositories/molecule/redhat/collections.yml index 4ba6628..03425ca 100644 --- a/roles/puppet_repositories/molecule/redhat/collections.yml +++ b/roles/puppet_repositories/molecule/redhat/collections.yml @@ -1,5 +1,5 @@ collections: - name: community.docker - version: ">=1.2.0,<2" + version: ">=3,<4" - name: community.general version: ">=2,<3" From 3f42f74e7c8ebcb3698cbdb7f458f4e4537a7a90 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 29 Aug 2022 14:43:48 +0200 Subject: [PATCH 08/37] disable 2.9 tests for now --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 013342c..07f151a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -119,7 +119,6 @@ jobs: python: - "3.8" ansible: - - stable-2.9 - stable-2.10 - stable-2.11 - stable-2.12 From 1b59f30a6c074284bffca70362d18112a894396c Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 29 Aug 2022 16:13:40 +0200 Subject: [PATCH 09/37] Revert "disable 2.9 tests for now" This reverts commit 3f42f74e7c8ebcb3698cbdb7f458f4e4537a7a90. --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07f151a..013342c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -119,6 +119,7 @@ jobs: python: - "3.8" ansible: + - stable-2.9 - stable-2.10 - stable-2.11 - stable-2.12 From 5010bcad4c8d6d3a80795bc82bf438a4cf7cb62b Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 29 Aug 2022 16:16:00 +0200 Subject: [PATCH 10/37] Install Ansible 2.9 compatible molecule --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 013342c..0245a75 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -137,6 +137,9 @@ jobs: run: pip install --upgrade https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz - name: Install dependencies run: make test-setup + - name: Install Ansible 2.9 compatible molecule + run: pip install --upgrade 'molecule[docker,lint]<4.0' + if: matrix.ansible == 'stable-2.9' - name: Run tests env: DRIVER_NAME: docker From dafa5eb3382bdd2040d6fa23b27d93c127a49b0b Mon Sep 17 00:00:00 2001 From: Jeremy Audet Date: Wed, 24 Aug 2022 15:20:23 -0400 Subject: [PATCH 11/37] Enable rhcd.service Ensure `rhcd.service` starts after system reboots. Fix: https://issues.redhat.com/browse/SAT-12447 --- roles/cloud_connector/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/cloud_connector/tasks/main.yml b/roles/cloud_connector/tasks/main.yml index c1f396e..5bf6781 100644 --- a/roles/cloud_connector/tasks/main.yml +++ b/roles/cloud_connector/tasks/main.yml @@ -37,6 +37,7 @@ service: name: rhcd state: started + enabled: true - name: Read client ID from CN of consumer ansible.builtin.command: openssl x509 -in /etc/pki/consumer/cert.pem -subject -noout From 6fc1ecd4dde4367abdbd74c9b09a7c0d37be2bff Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 12 Sep 2022 11:34:31 +0200 Subject: [PATCH 12/37] update debian tests to debian:11 --- roles/foreman_repositories/molecule/debian/molecule.yml | 4 ++-- roles/foreman_repositories/molecule/debian/verify.yml | 2 +- roles/puppet_repositories/molecule/debian/molecule.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/foreman_repositories/molecule/debian/molecule.yml b/roles/foreman_repositories/molecule/debian/molecule.yml index b40fa68..b2fcbe4 100644 --- a/roles/foreman_repositories/molecule/debian/molecule.yml +++ b/roles/foreman_repositories/molecule/debian/molecule.yml @@ -4,8 +4,8 @@ dependency: driver: name: ${DRIVER_NAME:-podman} platforms: - - name: debian-buster - image: debian:buster + - name: debian-bullseye + image: debian:11 provisioner: name: ansible verifier: diff --git a/roles/foreman_repositories/molecule/debian/verify.yml b/roles/foreman_repositories/molecule/debian/verify.yml index 7d728a4..e5e0a73 100644 --- a/roles/foreman_repositories/molecule/debian/verify.yml +++ b/roles/foreman_repositories/molecule/debian/verify.yml @@ -11,5 +11,5 @@ - name: check foreman repos exists assert: that: - - "'deb http://deb.theforeman.org buster 3.2' in repos['content'] | b64decode" + - "'deb http://deb.theforeman.org bullseye 3.2' in repos['content'] | b64decode" - "'deb http://deb.theforeman.org plugins 3.2' in repos['content'] | b64decode" diff --git a/roles/puppet_repositories/molecule/debian/molecule.yml b/roles/puppet_repositories/molecule/debian/molecule.yml index b40fa68..b2fcbe4 100644 --- a/roles/puppet_repositories/molecule/debian/molecule.yml +++ b/roles/puppet_repositories/molecule/debian/molecule.yml @@ -4,8 +4,8 @@ dependency: driver: name: ${DRIVER_NAME:-podman} platforms: - - name: debian-buster - image: debian:buster + - name: debian-bullseye + image: debian:11 provisioner: name: ansible verifier: From 58992a408920b19843addb4db8f9a56efe622b84 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 12 Sep 2022 11:35:51 +0200 Subject: [PATCH 13/37] drop EL7 tests --- roles/ansible_repositories/molecule/redhat/molecule.yml | 8 -------- roles/foreman_repositories/molecule/redhat/molecule.yml | 8 -------- roles/puppet_repositories/molecule/redhat/molecule.yml | 8 -------- 3 files changed, 24 deletions(-) diff --git a/roles/ansible_repositories/molecule/redhat/molecule.yml b/roles/ansible_repositories/molecule/redhat/molecule.yml index 16d7966..f7f2083 100644 --- a/roles/ansible_repositories/molecule/redhat/molecule.yml +++ b/roles/ansible_repositories/molecule/redhat/molecule.yml @@ -12,14 +12,6 @@ platforms: - /tmp:exec,mode=777 volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - - name: centos7 - image: centos:7 - command: /sbin/init - tmpfs: - - /run - - /tmp:exec,mode=777 - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro provisioner: name: ansible verifier: diff --git a/roles/foreman_repositories/molecule/redhat/molecule.yml b/roles/foreman_repositories/molecule/redhat/molecule.yml index 16d7966..f7f2083 100644 --- a/roles/foreman_repositories/molecule/redhat/molecule.yml +++ b/roles/foreman_repositories/molecule/redhat/molecule.yml @@ -12,14 +12,6 @@ platforms: - /tmp:exec,mode=777 volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - - name: centos7 - image: centos:7 - command: /sbin/init - tmpfs: - - /run - - /tmp:exec,mode=777 - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro provisioner: name: ansible verifier: diff --git a/roles/puppet_repositories/molecule/redhat/molecule.yml b/roles/puppet_repositories/molecule/redhat/molecule.yml index 16d7966..f7f2083 100644 --- a/roles/puppet_repositories/molecule/redhat/molecule.yml +++ b/roles/puppet_repositories/molecule/redhat/molecule.yml @@ -12,14 +12,6 @@ platforms: - /tmp:exec,mode=777 volumes: - /sys/fs/cgroup:/sys/fs/cgroup:ro - - name: centos7 - image: centos:7 - command: /sbin/init - tmpfs: - - /run - - /tmp:exec,mode=777 - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro provisioner: name: ansible verifier: From 1d6ba2ab580633ae9ce70c63b68c3f2bb9777ec2 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 12 Sep 2022 13:09:39 +0200 Subject: [PATCH 14/37] test puppet 6 to 7, not 5 to 6 --- roles/puppet_repositories/molecule/debian/converge.yml | 2 +- roles/puppet_repositories/molecule/debian/prepare.yml | 2 +- roles/puppet_repositories/molecule/debian/verify.yml | 7 ++++++- roles/puppet_repositories/molecule/redhat/converge.yml | 2 +- roles/puppet_repositories/molecule/redhat/prepare.yml | 2 +- roles/puppet_repositories/molecule/redhat/verify.yml | 7 ++++++- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/roles/puppet_repositories/molecule/debian/converge.yml b/roles/puppet_repositories/molecule/debian/converge.yml index 49913ed..180a8bd 100644 --- a/roles/puppet_repositories/molecule/debian/converge.yml +++ b/roles/puppet_repositories/molecule/debian/converge.yml @@ -3,6 +3,6 @@ hosts: all gather_facts: true vars: - foreman_puppet_repositories_version: 6 + foreman_puppet_repositories_version: 7 roles: - puppet_repositories diff --git a/roles/puppet_repositories/molecule/debian/prepare.yml b/roles/puppet_repositories/molecule/debian/prepare.yml index 56a5b52..d723e82 100644 --- a/roles/puppet_repositories/molecule/debian/prepare.yml +++ b/roles/puppet_repositories/molecule/debian/prepare.yml @@ -3,6 +3,6 @@ hosts: all gather_facts: true vars: - foreman_puppet_repositories_version: 5 + foreman_puppet_repositories_version: 6 roles: - puppet_repositories diff --git a/roles/puppet_repositories/molecule/debian/verify.yml b/roles/puppet_repositories/molecule/debian/verify.yml index a89e4cf..d7898ea 100644 --- a/roles/puppet_repositories/molecule/debian/verify.yml +++ b/roles/puppet_repositories/molecule/debian/verify.yml @@ -8,7 +8,12 @@ name: puppet5-release state: absent - - name: Ensure puppet6-release package is present + - name: Ensure puppet6-release package is absent package: name: puppet6-release + state: absent + + - name: Ensure puppet7-release package is present + package: + name: puppet7-release state: present diff --git a/roles/puppet_repositories/molecule/redhat/converge.yml b/roles/puppet_repositories/molecule/redhat/converge.yml index 49913ed..180a8bd 100644 --- a/roles/puppet_repositories/molecule/redhat/converge.yml +++ b/roles/puppet_repositories/molecule/redhat/converge.yml @@ -3,6 +3,6 @@ hosts: all gather_facts: true vars: - foreman_puppet_repositories_version: 6 + foreman_puppet_repositories_version: 7 roles: - puppet_repositories diff --git a/roles/puppet_repositories/molecule/redhat/prepare.yml b/roles/puppet_repositories/molecule/redhat/prepare.yml index 56a5b52..d723e82 100644 --- a/roles/puppet_repositories/molecule/redhat/prepare.yml +++ b/roles/puppet_repositories/molecule/redhat/prepare.yml @@ -3,6 +3,6 @@ hosts: all gather_facts: true vars: - foreman_puppet_repositories_version: 5 + foreman_puppet_repositories_version: 6 roles: - puppet_repositories diff --git a/roles/puppet_repositories/molecule/redhat/verify.yml b/roles/puppet_repositories/molecule/redhat/verify.yml index 45d9657..89dd49c 100644 --- a/roles/puppet_repositories/molecule/redhat/verify.yml +++ b/roles/puppet_repositories/molecule/redhat/verify.yml @@ -8,7 +8,12 @@ name: puppet5-release state: absent - - name: Ensure puppet6-release RPM is installed + - name: Ensure puppet6-release RPM is absent package: name: puppet6-release + state: absent + + - name: Ensure puppet7-release RPM is installed + package: + name: puppet7-release state: present From 8fbf65e6e5d8752fe619976f369e7d1d39315b43 Mon Sep 17 00:00:00 2001 From: Robert Rettig Date: Tue, 20 Sep 2022 22:57:07 +0200 Subject: [PATCH 15/37] Update README.md `plugins` repository! ```txt ansible-collection-theforeman-operations noarch 1.2.0-1.el8 foreman-plugins 38 k ``` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 437cd63..f99910d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ After the installation, the assets are available as `theforeman.operations. Date: Mon, 12 Sep 2022 12:09:16 +0200 Subject: [PATCH 16/37] fix paths in execution-environment.yml see https://github.com/theforeman/foreman-ansible-modules/pull/1471 for a longer discussion on the why and how this helps --- meta/execution-environment.yml | 2 +- meta/requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 120000 meta/requirements.txt diff --git a/meta/execution-environment.yml b/meta/execution-environment.yml index 18bb012..db52ac8 100644 --- a/meta/execution-environment.yml +++ b/meta/execution-environment.yml @@ -5,4 +5,4 @@ build_arg_defaults: EE_BASE_IMAGE: 'quay.io/ansible/ansible-runner:latest' dependencies: - python: ../requirements.txt + python: requirements.txt diff --git a/meta/requirements.txt b/meta/requirements.txt new file mode 120000 index 0000000..dc833dd --- /dev/null +++ b/meta/requirements.txt @@ -0,0 +1 @@ +../requirements.txt \ No newline at end of file From f837d397dd148aecfedfabcc92d3112e68c50e1d Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 12 Sep 2022 12:16:22 +0200 Subject: [PATCH 17/37] update default puppet to 7 --- roles/puppet_repositories/README.md | 8 ++++---- roles/puppet_repositories/defaults/main.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/puppet_repositories/README.md b/roles/puppet_repositories/README.md index c8883b7..25d679b 100644 --- a/roles/puppet_repositories/README.md +++ b/roles/puppet_repositories/README.md @@ -8,12 +8,12 @@ Role Variables Optional: -- `foreman_puppet_repositories_version`: Version of Puppet to setup repositories for (default: 6) +- `foreman_puppet_repositories_version`: Version of Puppet to setup repositories for (default: 7) Example Playbooks ----------------- -Setup repositories for default Puppet 6 for use by installer: +Setup repositories for default Puppet 7 for use by installer: ```yaml --- @@ -23,14 +23,14 @@ Setup repositories for default Puppet 6 for use by installer: - puppet_repositories ``` -Setup repositories for Puppet 7: +Setup repositories for Puppet 6: ```yaml --- - hosts: all gather_facts: true vars: - foreman_puppet_repositories_version: 7 + foreman_puppet_repositories_version: 6 roles: - puppet_repositories ``` diff --git a/roles/puppet_repositories/defaults/main.yml b/roles/puppet_repositories/defaults/main.yml index 7961b88..71be53a 100644 --- a/roles/puppet_repositories/defaults/main.yml +++ b/roles/puppet_repositories/defaults/main.yml @@ -1,2 +1,2 @@ --- -foreman_puppet_repositories_version: 6 +foreman_puppet_repositories_version: 7 From 90d4c6f9706381ed785068e95daef365ed0fca35 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 27 Sep 2022 09:21:37 +0200 Subject: [PATCH 18/37] add ansible-core 2.14 to CI --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0245a75..2899fff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,6 +30,8 @@ jobs: ansible: "stable-2.11" - python: "3.7" ansible: "stable-2.11" + - python: "3.9" + ansible: "stable-2.14" - python: "3.9" ansible: "devel" - python: "3.10" From f4c3491bc975f13ace2ff61f26a86e0024bbf34a Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 29 Aug 2022 12:55:43 +0200 Subject: [PATCH 19/37] add backup role --- roles/backup/README.md | 24 ++++++++++++++++++++ roles/backup/defaults/main.yml | 4 ++++ roles/backup/molecule/debian/collections.yml | 5 ++++ roles/backup/molecule/debian/converge.yml | 6 +++++ roles/backup/molecule/debian/molecule.yml | 16 +++++++++++++ roles/backup/molecule/debian/verify.yml | 16 +++++++++++++ roles/backup/molecule/redhat/collections.yml | 5 ++++ roles/backup/molecule/redhat/converge.yml | 6 +++++ roles/backup/molecule/redhat/molecule.yml | 22 ++++++++++++++++++ roles/backup/molecule/redhat/prepare.yml | 10 ++++++++ roles/backup/molecule/redhat/verify.yml | 16 +++++++++++++ roles/backup/tasks/main.yml | 8 +++++++ roles/backup/templates/foreman-backup.sh.j2 | 22 ++++++++++++++++++ 13 files changed, 160 insertions(+) create mode 100644 roles/backup/README.md create mode 100644 roles/backup/defaults/main.yml create mode 100644 roles/backup/molecule/debian/collections.yml create mode 100644 roles/backup/molecule/debian/converge.yml create mode 100644 roles/backup/molecule/debian/molecule.yml create mode 100644 roles/backup/molecule/debian/verify.yml create mode 100644 roles/backup/molecule/redhat/collections.yml create mode 100644 roles/backup/molecule/redhat/converge.yml create mode 100644 roles/backup/molecule/redhat/molecule.yml create mode 100644 roles/backup/molecule/redhat/prepare.yml create mode 100644 roles/backup/molecule/redhat/verify.yml create mode 100644 roles/backup/tasks/main.yml create mode 100644 roles/backup/templates/foreman-backup.sh.j2 diff --git a/roles/backup/README.md b/roles/backup/README.md new file mode 100644 index 0000000..1e73ef5 --- /dev/null +++ b/roles/backup/README.md @@ -0,0 +1,24 @@ +theforeman.operations.backup +============================ + +Sets up backup cronjob using `foreman_maintain`, creating one full backup each Sunday and incremental ones otherwise. + +Role Variables +-------------- + +* `foreman_backup_destination`: Destination where to write the backups to, defaults to `/var/backup/foreman` +* `foreman_backup_type`: Backup type, can be either `online` or `offline`, defaults to `online` +* `foreman_backup_keep_full`: How many full (weekly) backups to keep, defaults to `2` + +None + +Example Playbooks +----------------- + +```yaml +--- +- hosts: all + gather_facts: true + roles: + - backup +``` diff --git a/roles/backup/defaults/main.yml b/roles/backup/defaults/main.yml new file mode 100644 index 0000000..13272ed --- /dev/null +++ b/roles/backup/defaults/main.yml @@ -0,0 +1,4 @@ +--- +foreman_backup_destination: /var/backup/foreman +foreman_backup_type: online +foreman_backup_keep_full: 2 diff --git a/roles/backup/molecule/debian/collections.yml b/roles/backup/molecule/debian/collections.yml new file mode 100644 index 0000000..03425ca --- /dev/null +++ b/roles/backup/molecule/debian/collections.yml @@ -0,0 +1,5 @@ +collections: + - name: community.docker + version: ">=3,<4" + - name: community.general + version: ">=2,<3" diff --git a/roles/backup/molecule/debian/converge.yml b/roles/backup/molecule/debian/converge.yml new file mode 100644 index 0000000..f995746 --- /dev/null +++ b/roles/backup/molecule/debian/converge.yml @@ -0,0 +1,6 @@ +--- +- name: Converge + hosts: all + gather_facts: true + roles: + - backup diff --git a/roles/backup/molecule/debian/molecule.yml b/roles/backup/molecule/debian/molecule.yml new file mode 100644 index 0000000..b2fcbe4 --- /dev/null +++ b/roles/backup/molecule/debian/molecule.yml @@ -0,0 +1,16 @@ +--- +dependency: + name: galaxy +driver: + name: ${DRIVER_NAME:-podman} +platforms: + - name: debian-bullseye + image: debian:11 +provisioner: + name: ansible +verifier: + name: ansible +lint: | + set -e + yamllint -c ../../.yamllint . + ansible-lint . diff --git a/roles/backup/molecule/debian/verify.yml b/roles/backup/molecule/debian/verify.yml new file mode 100644 index 0000000..16f2a10 --- /dev/null +++ b/roles/backup/molecule/debian/verify.yml @@ -0,0 +1,16 @@ +--- +- name: Verify + hosts: all + gather_facts: false + tasks: + - name: get cronjob file + slurp: + path: /etc/cron.daily/foreman-backup + register: backupcron + + - name: check foreman cronjob content + assert: + that: + - "'/var/backup/foreman' in crobjobcontent" + vars: + crobjobcontent: "{{ backupcron['content'] | b64decode }}" diff --git a/roles/backup/molecule/redhat/collections.yml b/roles/backup/molecule/redhat/collections.yml new file mode 100644 index 0000000..03425ca --- /dev/null +++ b/roles/backup/molecule/redhat/collections.yml @@ -0,0 +1,5 @@ +collections: + - name: community.docker + version: ">=3,<4" + - name: community.general + version: ">=2,<3" diff --git a/roles/backup/molecule/redhat/converge.yml b/roles/backup/molecule/redhat/converge.yml new file mode 100644 index 0000000..f995746 --- /dev/null +++ b/roles/backup/molecule/redhat/converge.yml @@ -0,0 +1,6 @@ +--- +- name: Converge + hosts: all + gather_facts: true + roles: + - backup diff --git a/roles/backup/molecule/redhat/molecule.yml b/roles/backup/molecule/redhat/molecule.yml new file mode 100644 index 0000000..f7f2083 --- /dev/null +++ b/roles/backup/molecule/redhat/molecule.yml @@ -0,0 +1,22 @@ +--- +dependency: + name: galaxy +driver: + name: ${DRIVER_NAME:-podman} +platforms: + - name: centos8 + image: quay.io/centos/centos:stream8 + command: /sbin/init + tmpfs: + - /run + - /tmp:exec,mode=777 + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro +provisioner: + name: ansible +verifier: + name: ansible +lint: | + set -e + yamllint -c ../../.yamllint . + ansible-lint . diff --git a/roles/backup/molecule/redhat/prepare.yml b/roles/backup/molecule/redhat/prepare.yml new file mode 100644 index 0000000..22dcd71 --- /dev/null +++ b/roles/backup/molecule/redhat/prepare.yml @@ -0,0 +1,10 @@ +--- +- name: Prepare + hosts: all + gather_facts: true + pre_tasks: + - name: install crontabs + package: + name: crontabs + roles: + - backup diff --git a/roles/backup/molecule/redhat/verify.yml b/roles/backup/molecule/redhat/verify.yml new file mode 100644 index 0000000..16f2a10 --- /dev/null +++ b/roles/backup/molecule/redhat/verify.yml @@ -0,0 +1,16 @@ +--- +- name: Verify + hosts: all + gather_facts: false + tasks: + - name: get cronjob file + slurp: + path: /etc/cron.daily/foreman-backup + register: backupcron + + - name: check foreman cronjob content + assert: + that: + - "'/var/backup/foreman' in crobjobcontent" + vars: + crobjobcontent: "{{ backupcron['content'] | b64decode }}" diff --git a/roles/backup/tasks/main.yml b/roles/backup/tasks/main.yml new file mode 100644 index 0000000..1c565e5 --- /dev/null +++ b/roles/backup/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- name: Configure backup cronjob + template: + src: templates/foreman-backup.sh.j2 + dest: /etc/cron.daily/foreman-backup + owner: root + group: root + mode: '0750' diff --git a/roles/backup/templates/foreman-backup.sh.j2 b/roles/backup/templates/foreman-backup.sh.j2 new file mode 100644 index 0000000..33c559f --- /dev/null +++ b/roles/backup/templates/foreman-backup.sh.j2 @@ -0,0 +1,22 @@ +#!/bin/bash -eu +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +DESTINATION={{ foreman_backup_destination }} +KEEP_FULL={{ foreman_backup_keep_full }} + +if [[ $(date +%w) -eq 0 ]]; then + foreman-maintain backup {{ foreman_backup_type }} --assumeyes $DESTINATION + + FULL_BACKUPS=$(grep -l 'incremental: false' $DESTINATION/*/metadata.yml| xargs -n1 dirname) + + if [[ $(echo "${FULL_BACKUPS}" | wc -l) -gt ${KEEP_FULL} ]]; then + REF=$(ls -td -- ${FULL_BACKUPS} | tail -n 2 | head -n 1) + echo "deleting everything BEFORE $REF" + find $DESTINATION -maxdepth 1 -mindepth 1 -type d ! -newer "$REF" ! -path "$REF" -exec rm -rf '{}' \; + else + echo "nothing to delete" + fi +else + LAST=$(ls -td -- $DESTINATION/*/ | head -n 1) + foreman-maintain backup {{ foreman_backup_type }} --assumeyes --incremental "$LAST" $DESTINATION +fi From 738cb376bd460c680983850f1ceb6faeefacd974 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 25 Oct 2022 11:21:32 +0200 Subject: [PATCH 20/37] also test on python 3.11 --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2899fff..dc45414 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,6 +36,8 @@ jobs: ansible: "devel" - python: "3.10" ansible: "devel" + - python: "3.11" + ansible: "devel" steps: - uses: actions/checkout@v3 - name: Set up Python From 2ad58c40f9f1a41cdbe338e5a183a4d1a2b7c1ac Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 24 Nov 2022 09:04:59 +0100 Subject: [PATCH 21/37] simplify codeql fetching -- the bug that required this is fixed --- .github/workflows/codeql-analysis.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 4b0fe20..1ce0d02 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,15 +23,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - name: Initialize CodeQL uses: github/codeql-action/init@v2 From 7a4400fd6ac6382aea1bd98077c98c8462179e16 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 24 Nov 2022 09:07:00 +0100 Subject: [PATCH 22/37] use Python 3.9 as the default Python --- .github/workflows/docs.yml | 2 +- .github/workflows/main.yml | 36 +++++++++++++++-------------------- .github/workflows/release.yml | 2 +- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a42dc34..17e9c5e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.7" + python-version: "3.9" - name: Install dependencies run: make doc-setup - name: Build docs diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc45414..690ffe8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,14 +14,18 @@ jobs: fail-fast: false matrix: python: - - "3.8" + - "3.9" ansible: - - stable-2.9 - - stable-2.10 - stable-2.11 - stable-2.12 - stable-2.13 + - stable-2.14 + - devel include: + - python: "3.8" + ansible: "stable-2.9" + - python: "3.8" + ansible: "stable-2.10" - python: "2.7" ansible: "stable-2.11" - python: "3.5" @@ -30,10 +34,6 @@ jobs: ansible: "stable-2.11" - python: "3.7" ansible: "stable-2.11" - - python: "3.9" - ansible: "stable-2.14" - - python: "3.9" - ansible: "devel" - python: "3.10" ansible: "devel" - python: "3.11" @@ -62,7 +62,7 @@ jobs: if: matrix.ansible != 'stable-2.9' - name: Run sanity tests run: make SANITY_OPTS="--local" sanity - if: matrix.ansible != 'stable-2.9' + if: matrix.ansible != 'stable-2.9' && matrix.ansible != 'stable-2.10' && matrix.ansible != 'stable-2.11' docs: runs-on: ubuntu-latest @@ -75,10 +75,9 @@ jobs: - name: Restore pip cache uses: actions/cache@v3 with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} - restore-keys: | - ${{ runner.os }}-pip- + python-version: "3.9" + cache: 'pip' + cache-dependency-path: '**/requirements*.txt' - name: Install dependencies run: make doc-setup - name: Build docs @@ -96,14 +95,9 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.8" - - name: Restore pip cache - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} - restore-keys: | - ${{ runner.os }}-pip- + python-version: "3.9" + cache: 'pip' + cache-dependency-path: '**/requirements*.txt' - name: Install dependencies run: | pip install --upgrade ansible-core @@ -156,7 +150,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: "3.9" cache: 'pip' cache-dependency-path: '**/requirements*.txt' - name: Install dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 09a85f8..fb95b51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: "3.9" - name: Install Ansible run: pip install --upgrade ansible - name: Build Ansible Collection From 72f18280a4d9508ef88ba3cb3634e5f79586af46 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 24 Nov 2022 09:10:33 +0100 Subject: [PATCH 23/37] create latest symlink when publishing docs --- .github/workflows/docs.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 17e9c5e..17d8739 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,10 +31,11 @@ jobs: git checkout gh-pages rm -rf $(basename ${GITHUB_REF}) mv docs/_build/html $(basename ${GITHUB_REF}) + ln --force --no-dereference --symbolic $(dirname v*/index.html | sort --version-sort --reverse | head -n1) latest git show origin/develop:docs/_gh_include/header.inc > index.html - (echo develop; dirname v*/index.html | sort --version-sort --reverse) | xargs -I@@ -n1 echo '' >> index.html + (echo develop; echo latest; dirname v*/index.html | sort --version-sort --reverse) | xargs -I@@ -n1 echo '' >> index.html git show origin/develop:docs/_gh_include/footer.inc >> index.html - git add $(basename ${GITHUB_REF}) index.html + git add $(basename ${GITHUB_REF}) latest index.html git commit -m "update docs for $(basename ${GITHUB_REF})" || true - name: push docs run: git push origin gh-pages From 4ca2fe6f6224a11f23d0ce8950c73c40d4e4de81 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 24 Nov 2022 09:10:52 +0100 Subject: [PATCH 24/37] Run on Ubuntu 20.04 to still be able to test Python 2.7 and 3.5/3.6 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 690ffe8..e638737 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: From 134178a76728f71eaa7b3c724b64ec75e6f3c04d Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 24 Nov 2022 09:11:21 +0100 Subject: [PATCH 25/37] no need to install community.general, we don't need it in tests --- .github/workflows/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e638737..896b9fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,9 +57,6 @@ jobs: run: pip install --upgrade https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz - name: Install dependencies run: make test-setup - - name: Install required collections for ansible-base (2.10+) - run: ansible-galaxy collection install community.general - if: matrix.ansible != 'stable-2.9' - name: Run sanity tests run: make SANITY_OPTS="--local" sanity if: matrix.ansible != 'stable-2.9' && matrix.ansible != 'stable-2.10' && matrix.ansible != 'stable-2.11' From a1a2e91f8f30ce49b7f388c131b6e62db3e4c64a Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 24 Nov 2022 09:11:50 +0100 Subject: [PATCH 26/37] use setup-python's cache feature --- .github/workflows/main.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 896b9fb..66e9d36 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,13 +44,8 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - - name: Restore pip cache - uses: actions/cache@v3 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }} - restore-keys: | - ${{ runner.os }}-pip- + cache: 'pip' + cache-dependency-path: '**/requirements*.txt' - name: Install libyaml-dev for PyYAML run: sudo apt-get install -y libyaml-dev - name: Install Ansible @@ -67,10 +62,6 @@ jobs: - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 - with: - python-version: "3.8" - - name: Restore pip cache - uses: actions/cache@v3 with: python-version: "3.9" cache: 'pip' From 4fb7b90f89bfa1e1b99c3b27a5077e7c222b26b4 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 5 Dec 2022 08:14:56 +0100 Subject: [PATCH 27/37] also run molecule on ubuntu 20.04 Docker and systemd doesn't play well on 22.04 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 66e9d36..ef65a47 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -99,7 +99,7 @@ jobs: path: theforeman-operations-*.tar.gz molecule: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: python: From 44c77a50386867664f84b93ce33e121f07d1534d Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 24 Nov 2022 08:55:14 +0100 Subject: [PATCH 28/37] Update ansible-lint to 6.1+ and enable only-builtins rule --- .ansible-lint | 9 ++++++--- requirements-lint.txt | 2 +- roles/ansible_repositories/tasks/main.yml | 2 +- roles/cloud_connector/tasks/cleanup_receptor.yml | 3 ++- roles/cloud_connector/tasks/main.yml | 4 ++-- roles/foreman_repositories/tasks/main.yml | 3 ++- roles/foreman_repositories/tasks/redhat.yml | 3 ++- roles/installer/tasks/main.yml | 7 ++++--- roles/postgresql_upgrade/tasks/main.yml | 3 ++- roles/puppet_repositories/tasks/main.yml | 2 +- 10 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 6fe22a5..5472dbb 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,4 +1,7 @@ --- -skip_list: - - role-name - - line-length +warn_list: + - fqcn[action-core] + - name[template] + - name[casing] +enable_list: + - only-builtins diff --git a/requirements-lint.txt b/requirements-lint.txt index 5141560..0f6df64 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -1,4 +1,4 @@ flake8<4 yamllint -ansible-lint<6 +ansible-lint>=6.1.0 galaxy-importer diff --git a/roles/ansible_repositories/tasks/main.yml b/roles/ansible_repositories/tasks/main.yml index 3974386..5842ac1 100644 --- a/roles/ansible_repositories/tasks/main.yml +++ b/roles/ansible_repositories/tasks/main.yml @@ -1,3 +1,3 @@ --- - name: 'Include {{ ansible_os_family }}' - include_tasks: '{{ ansible_os_family|lower }}.yml' + include_tasks: '{{ ansible_os_family | lower }}.yml' diff --git a/roles/cloud_connector/tasks/cleanup_receptor.yml b/roles/cloud_connector/tasks/cleanup_receptor.yml index df6d28a..773c37c 100644 --- a/roles/cloud_connector/tasks/cleanup_receptor.yml +++ b/roles/cloud_connector/tasks/cleanup_receptor.yml @@ -15,7 +15,8 @@ file_type: directory register: receptor_configs -- include_tasks: delete_source.yml +- name: Delete sources + include_tasks: delete_source.yml loop: "{{ receptor_configs['files'] }}" - name: Collect service facts diff --git a/roles/cloud_connector/tasks/main.yml b/roles/cloud_connector/tasks/main.yml index 5bf6781..12d691d 100644 --- a/roles/cloud_connector/tasks/main.yml +++ b/roles/cloud_connector/tasks/main.yml @@ -60,8 +60,8 @@ client_id: "{{ cert_output.stdout | regex_search('CN\\s?=\\s?([a-z0-9-]+)', '\\1') | first }}" - name: Configure HTTP proxy - include: http_proxy.yml + include_tasks: http_proxy.yml when: foreman_cloud_connector_http_proxy is defined - name: Cleanup receptor - include: cleanup_receptor.yml + include_tasks: cleanup_receptor.yml diff --git a/roles/foreman_repositories/tasks/main.yml b/roles/foreman_repositories/tasks/main.yml index c39cf09..caa024a 100644 --- a/roles/foreman_repositories/tasks/main.yml +++ b/roles/foreman_repositories/tasks/main.yml @@ -1,2 +1,3 @@ --- -- include_tasks: "{{ ansible_os_family|lower }}.yml" +- name: Load OS specific repository tasks + include_tasks: "{{ ansible_os_family | lower }}.yml" diff --git a/roles/foreman_repositories/tasks/redhat.yml b/roles/foreman_repositories/tasks/redhat.yml index 964721b..037ae12 100644 --- a/roles/foreman_repositories/tasks/redhat.yml +++ b/roles/foreman_repositories/tasks/redhat.yml @@ -33,7 +33,8 @@ when: - ansible_distribution_major_version == '8' -- when: +- name: Enable powertools for Katello + when: - foreman_repositories_katello_version is defined - ansible_distribution_major_version == '8' block: diff --git a/roles/installer/tasks/main.yml b/roles/installer/tasks/main.yml index 5335817..a22375f 100644 --- a/roles/installer/tasks/main.yml +++ b/roles/installer/tasks/main.yml @@ -4,7 +4,8 @@ that: - foreman_installer_scenario is defined -- when: +- name: Enable the ruby module + when: - ansible_distribution_major_version == '8' - ansible_os_family == 'RedHat' block: @@ -35,8 +36,8 @@ command: > {{ foreman_installer_command }} --scenario {{ foreman_installer_scenario }} - {{ (foreman_installer_verbose|bool) | ternary("-v", "") }} - {{ (foreman_installer_no_colors|bool) | ternary("--no-colors", "") }} + {{ (foreman_installer_verbose | bool) | ternary("-v", "") }} + {{ (foreman_installer_no_colors | bool) | ternary("--no-colors", "") }} {{ foreman_installer_options | join(' ') }} --detailed-exitcodes async: "{{ ansible_check_mode | ternary(0, foreman_installer_timeout) }}" # avoid connection timeouts diff --git a/roles/postgresql_upgrade/tasks/main.yml b/roles/postgresql_upgrade/tasks/main.yml index 6e210be..1b1a69b 100644 --- a/roles/postgresql_upgrade/tasks/main.yml +++ b/roles/postgresql_upgrade/tasks/main.yml @@ -11,7 +11,8 @@ path: /var/lib/pgsql/data/PG_VERSION register: pg_version -- when: +- name: Perform PostgreSQL upgrade + when: - "'10' in pg_version['content']|b64decode" block: - name: Start postgresql diff --git a/roles/puppet_repositories/tasks/main.yml b/roles/puppet_repositories/tasks/main.yml index 590d8a9..7ef96e8 100644 --- a/roles/puppet_repositories/tasks/main.yml +++ b/roles/puppet_repositories/tasks/main.yml @@ -6,4 +6,4 @@ loop: "{{ foreman_puppet_repositories_supported_versions | difference([foreman_puppet_repositories_version | string]) }}" - name: 'Include {{ ansible_os_family }}' - include_tasks: '{{ ansible_os_family|lower }}.yml' + include_tasks: '{{ ansible_os_family | lower }}.yml' From 4bbbfc7ca5bcc131c58e531ef2e7139b3a4da61e Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 5 Dec 2022 08:27:54 +0100 Subject: [PATCH 29/37] make tests name[casing] correct --- .ansible-lint | 1 - roles/backup/molecule/debian/verify.yml | 4 ++-- roles/backup/molecule/redhat/prepare.yml | 2 +- roles/backup/molecule/redhat/verify.yml | 4 ++-- .../molecule/default/prepare.yml | 2 +- .../molecule/default/verify.yml | 6 +++--- .../foreman_repositories/molecule/debian/verify.yml | 4 ++-- .../foreman_repositories/molecule/redhat/verify.yml | 12 ++++++------ roles/installer/molecule/default/verify.yml | 8 ++++---- 9 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 5472dbb..0e0a2b9 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -2,6 +2,5 @@ warn_list: - fqcn[action-core] - name[template] - - name[casing] enable_list: - only-builtins diff --git a/roles/backup/molecule/debian/verify.yml b/roles/backup/molecule/debian/verify.yml index 16f2a10..403ace1 100644 --- a/roles/backup/molecule/debian/verify.yml +++ b/roles/backup/molecule/debian/verify.yml @@ -3,12 +3,12 @@ hosts: all gather_facts: false tasks: - - name: get cronjob file + - name: Get cronjob file slurp: path: /etc/cron.daily/foreman-backup register: backupcron - - name: check foreman cronjob content + - name: Check foreman cronjob content assert: that: - "'/var/backup/foreman' in crobjobcontent" diff --git a/roles/backup/molecule/redhat/prepare.yml b/roles/backup/molecule/redhat/prepare.yml index 22dcd71..add1911 100644 --- a/roles/backup/molecule/redhat/prepare.yml +++ b/roles/backup/molecule/redhat/prepare.yml @@ -3,7 +3,7 @@ hosts: all gather_facts: true pre_tasks: - - name: install crontabs + - name: Install crontabs package: name: crontabs roles: diff --git a/roles/backup/molecule/redhat/verify.yml b/roles/backup/molecule/redhat/verify.yml index 16f2a10..403ace1 100644 --- a/roles/backup/molecule/redhat/verify.yml +++ b/roles/backup/molecule/redhat/verify.yml @@ -3,12 +3,12 @@ hosts: all gather_facts: false tasks: - - name: get cronjob file + - name: Get cronjob file slurp: path: /etc/cron.daily/foreman-backup register: backupcron - - name: check foreman cronjob content + - name: Check foreman cronjob content assert: that: - "'/var/backup/foreman' in crobjobcontent" diff --git a/roles/foreman_proxy_certs_generate/molecule/default/prepare.yml b/roles/foreman_proxy_certs_generate/molecule/default/prepare.yml index dd1f8db..0ad8da1 100644 --- a/roles/foreman_proxy_certs_generate/molecule/default/prepare.yml +++ b/roles/foreman_proxy_certs_generate/molecule/default/prepare.yml @@ -15,7 +15,7 @@ name: glibc-langpack-en state: present when: ansible_facts['os_family'] == 'RedHat' - - name: run installer + - name: Run installer include_role: name: installer vars: diff --git a/roles/foreman_proxy_certs_generate/molecule/default/verify.yml b/roles/foreman_proxy_certs_generate/molecule/default/verify.yml index ad3f6f8..456debe 100644 --- a/roles/foreman_proxy_certs_generate/molecule/default/verify.yml +++ b/roles/foreman_proxy_certs_generate/molecule/default/verify.yml @@ -1,14 +1,14 @@ --- -- name: verify +- name: Verify hosts: all gather_facts: false tasks: - - name: find tasks config file + - name: Find proxy certs file stat: path: /root/proxy.example.com.tar.gz register: cert_tarball - - name: check tasks config file exists + - name: Check proxy certs file exists assert: that: - cert_tarball.stat.exists diff --git a/roles/foreman_repositories/molecule/debian/verify.yml b/roles/foreman_repositories/molecule/debian/verify.yml index e5e0a73..f9d7cd9 100644 --- a/roles/foreman_repositories/molecule/debian/verify.yml +++ b/roles/foreman_repositories/molecule/debian/verify.yml @@ -3,12 +3,12 @@ hosts: all gather_facts: false tasks: - - name: get sources.list + - name: Get sources.list slurp: path: /etc/apt/sources.list.d/deb_theforeman_org.list register: repos - - name: check foreman repos exists + - name: Check Foreman repos exists assert: that: - "'deb http://deb.theforeman.org bullseye 3.2' in repos['content'] | b64decode" diff --git a/roles/foreman_repositories/molecule/redhat/verify.yml b/roles/foreman_repositories/molecule/redhat/verify.yml index 94dc610..22ba5ee 100644 --- a/roles/foreman_repositories/molecule/redhat/verify.yml +++ b/roles/foreman_repositories/molecule/redhat/verify.yml @@ -13,32 +13,32 @@ name: katello-repos state: present - - name: stat foreman.repo + - name: Stat foreman.repo stat: path: /etc/yum.repos.d/foreman.repo register: foreman_repo - - name: check foreman_repo file exists + - name: Check foreman_repo file exists assert: that: - foreman_repo.stat.exists - - name: stat foreman-plugins.repo + - name: Stat foreman-plugins.repo stat: path: /etc/yum.repos.d/foreman-plugins.repo register: foreman_plugins_repo - - name: check foreman_plugins_repo file exists + - name: Check foreman_plugins_repo file exists assert: that: - foreman_plugins_repo.stat.exists - - name: stat katello.repo + - name: Stat katello.repo stat: path: /etc/yum.repos.d/katello.repo register: katello_repo - - name: check katello_repo file exists + - name: Check katello_repo file exists assert: that: - katello_repo.stat.exists diff --git a/roles/installer/molecule/default/verify.yml b/roles/installer/molecule/default/verify.yml index 382ae7a..f334606 100644 --- a/roles/installer/molecule/default/verify.yml +++ b/roles/installer/molecule/default/verify.yml @@ -8,20 +8,20 @@ name: foreman state: present - - name: find installer flag file + - name: Find installer flag file stat: path: /etc/foreman-installer/scenarios.d/.installed register: installed_file - - name: assert installer flag file exists + - name: Assert installer flag file exists assert: that: - installed_file.stat.exists - - name: find tasks config file + - name: Find tasks config file stat: path: /etc/foreman/plugins/foreman-tasks.yaml register: foreman_tasks_yaml - - name: check tasks config file exists + - name: Check tasks config file exists assert: that: - foreman_tasks_yaml.stat.exists From abf88834982dab9b49ac33a3e90e452f21820ec3 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 5 Dec 2022 08:30:52 +0100 Subject: [PATCH 30/37] make name[template] lint happy --- .ansible-lint | 1 - roles/foreman_repositories/tasks/debian.yml | 4 ++-- roles/foreman_repositories/tasks/redhat.yml | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 0e0a2b9..3df7a97 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,6 +1,5 @@ --- warn_list: - fqcn[action-core] - - name[template] enable_list: - only-builtins diff --git a/roles/foreman_repositories/tasks/debian.yml b/roles/foreman_repositories/tasks/debian.yml index f572de3..90e2660 100644 --- a/roles/foreman_repositories/tasks/debian.yml +++ b/roles/foreman_repositories/tasks/debian.yml @@ -5,12 +5,12 @@ dest: /etc/apt/trusted.gpg.d/foreman.asc mode: '0444' -- name: 'Setup Foreman {{ foreman_repositories_version }} repository' +- name: 'Setup repository for Foreman {{ foreman_repositories_version }}' apt_repository: repo: deb http://deb.theforeman.org {{ ansible_distribution_release }} {{ foreman_repositories_version }} state: present -- name: 'Setup Foreman {{ foreman_repositories_version }} plugins repository' +- name: 'Setup repository for Foreman Plugins {{ foreman_repositories_version }}' apt_repository: repo: deb http://deb.theforeman.org plugins {{ foreman_repositories_version }} state: present diff --git a/roles/foreman_repositories/tasks/redhat.yml b/roles/foreman_repositories/tasks/redhat.yml index 037ae12..b839071 100644 --- a/roles/foreman_repositories/tasks/redhat.yml +++ b/roles/foreman_repositories/tasks/redhat.yml @@ -10,7 +10,7 @@ - ansible_distribution == 'CentOS' - ansible_distribution_major_version == '7' -- name: 'Setup Foreman {{ foreman_repositories_version }} Repository' +- name: 'Setup repository for Foreman {{ foreman_repositories_version }}' yum: name: https://yum.theforeman.org/releases/{{ foreman_repositories_version }}/el{{ ansible_distribution_major_version }}/x86_64/foreman-release.rpm disable_gpg_check: true @@ -18,7 +18,7 @@ tags: - packages -- name: 'Setup Katello {{ foreman_repositories_katello_version }} Repository' +- name: 'Setup repository for Katello {{ foreman_repositories_katello_version }}' yum: name: https://yum.theforeman.org/katello/{{ foreman_repositories_katello_version }}/katello/el{{ ansible_distribution_major_version }}/x86_64/katello-repos-latest.rpm disable_gpg_check: true From 42454be6d5330b243f15b0b7dbe76f50bd044255 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 5 Dec 2022 08:49:09 +0100 Subject: [PATCH 31/37] always use FQCN names --- .ansible-lint | 2 -- .../molecule/redhat/verify.yml | 2 +- roles/ansible_repositories/tasks/main.yml | 2 +- roles/ansible_repositories/tasks/redhat.yml | 2 +- roles/backup/molecule/debian/verify.yml | 4 ++-- roles/backup/molecule/redhat/prepare.yml | 2 +- roles/backup/molecule/redhat/verify.yml | 4 ++-- roles/backup/tasks/main.yml | 2 +- .../tasks/cleanup_receptor.yml | 10 ++++----- roles/cloud_connector/tasks/main.yml | 10 ++++----- .../molecule/default/prepare.yml | 4 ++-- .../molecule/default/verify.yml | 4 ++-- .../tasks/main.yml | 2 +- .../molecule/debian/verify.yml | 4 ++-- .../molecule/redhat/verify.yml | 16 +++++++------- roles/foreman_repositories/tasks/debian.yml | 6 ++--- roles/foreman_repositories/tasks/main.yml | 2 +- .../tasks/redhat-modules.yml | 6 ++--- roles/foreman_repositories/tasks/redhat.yml | 14 ++++++------ roles/installer/molecule/default/prepare.yml | 2 +- roles/installer/molecule/default/verify.yml | 10 ++++----- roles/installer/tasks/main.yml | 14 ++++++------ .../molecule/redhat/prepare.yml | 4 ++-- .../molecule/redhat/verify.yml | 6 ++--- roles/postgresql_upgrade/tasks/main.yml | 22 +++++++++---------- .../molecule/debian/verify.yml | 6 ++--- .../molecule/redhat/verify.yml | 6 ++--- roles/puppet_repositories/tasks/debian.yml | 6 ++--- roles/puppet_repositories/tasks/main.yml | 4 ++-- roles/puppet_repositories/tasks/redhat.yml | 2 +- 30 files changed, 89 insertions(+), 91 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 3df7a97..c9562df 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,5 +1,3 @@ --- -warn_list: - - fqcn[action-core] enable_list: - only-builtins diff --git a/roles/ansible_repositories/molecule/redhat/verify.yml b/roles/ansible_repositories/molecule/redhat/verify.yml index 117da0a..81c4ae5 100644 --- a/roles/ansible_repositories/molecule/redhat/verify.yml +++ b/roles/ansible_repositories/molecule/redhat/verify.yml @@ -4,6 +4,6 @@ gather_facts: false tasks: - name: Ensure centos-release-ansible-29 RPM is installed - package: + ansible.builtin.package: name: centos-release-ansible-29 state: present diff --git a/roles/ansible_repositories/tasks/main.yml b/roles/ansible_repositories/tasks/main.yml index 5842ac1..82a3fcc 100644 --- a/roles/ansible_repositories/tasks/main.yml +++ b/roles/ansible_repositories/tasks/main.yml @@ -1,3 +1,3 @@ --- - name: 'Include {{ ansible_os_family }}' - include_tasks: '{{ ansible_os_family | lower }}.yml' + ansible.builtin.include_tasks: '{{ ansible_os_family | lower }}.yml' diff --git a/roles/ansible_repositories/tasks/redhat.yml b/roles/ansible_repositories/tasks/redhat.yml index 2a2aeca..0a47819 100644 --- a/roles/ansible_repositories/tasks/redhat.yml +++ b/roles/ansible_repositories/tasks/redhat.yml @@ -1,6 +1,6 @@ --- - name: 'Install centos-release-ansible29 on EL8' # noqa package-latest - dnf: + ansible.builtin.dnf: name: centos-release-ansible-29 state: latest update_cache: true diff --git a/roles/backup/molecule/debian/verify.yml b/roles/backup/molecule/debian/verify.yml index 403ace1..04355ce 100644 --- a/roles/backup/molecule/debian/verify.yml +++ b/roles/backup/molecule/debian/verify.yml @@ -4,12 +4,12 @@ gather_facts: false tasks: - name: Get cronjob file - slurp: + ansible.builtin.slurp: path: /etc/cron.daily/foreman-backup register: backupcron - name: Check foreman cronjob content - assert: + ansible.builtin.assert: that: - "'/var/backup/foreman' in crobjobcontent" vars: diff --git a/roles/backup/molecule/redhat/prepare.yml b/roles/backup/molecule/redhat/prepare.yml index add1911..d37863f 100644 --- a/roles/backup/molecule/redhat/prepare.yml +++ b/roles/backup/molecule/redhat/prepare.yml @@ -4,7 +4,7 @@ gather_facts: true pre_tasks: - name: Install crontabs - package: + ansible.builtin.package: name: crontabs roles: - backup diff --git a/roles/backup/molecule/redhat/verify.yml b/roles/backup/molecule/redhat/verify.yml index 403ace1..04355ce 100644 --- a/roles/backup/molecule/redhat/verify.yml +++ b/roles/backup/molecule/redhat/verify.yml @@ -4,12 +4,12 @@ gather_facts: false tasks: - name: Get cronjob file - slurp: + ansible.builtin.slurp: path: /etc/cron.daily/foreman-backup register: backupcron - name: Check foreman cronjob content - assert: + ansible.builtin.assert: that: - "'/var/backup/foreman' in crobjobcontent" vars: diff --git a/roles/backup/tasks/main.yml b/roles/backup/tasks/main.yml index 1c565e5..3089e05 100644 --- a/roles/backup/tasks/main.yml +++ b/roles/backup/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Configure backup cronjob - template: + ansible.builtin.template: src: templates/foreman-backup.sh.j2 dest: /etc/cron.daily/foreman-backup owner: root diff --git a/roles/cloud_connector/tasks/cleanup_receptor.yml b/roles/cloud_connector/tasks/cleanup_receptor.yml index 773c37c..2969c08 100644 --- a/roles/cloud_connector/tasks/cleanup_receptor.yml +++ b/roles/cloud_connector/tasks/cleanup_receptor.yml @@ -10,13 +10,13 @@ register: satellite_uuid_json - name: Find receptor configs - find: + ansible.builtin.find: paths: /etc/receptor file_type: directory register: receptor_configs - name: Delete sources - include_tasks: delete_source.yml + ansible.builtin.include_tasks: delete_source.yml loop: "{{ receptor_configs['files'] }}" - name: Collect service facts @@ -30,7 +30,7 @@ loop: "{{ ansible_facts.services.values() | selectattr('name', 'regex', 'receptor\\@.+.service') | list }}" - name: Remove receptor packages - yum: + ansible.builtin.yum: state: absent name: - receptor @@ -39,11 +39,11 @@ disable_plugin: foreman-protector - name: Cleanup receptor config - file: + ansible.builtin.file: state: absent path: /etc/receptor - name: Remove receptor service file - file: + ansible.builtin.file: state: absent path: /etc/systemd/system/receptor@.service diff --git a/roles/cloud_connector/tasks/main.yml b/roles/cloud_connector/tasks/main.yml index 12d691d..1c24747 100644 --- a/roles/cloud_connector/tasks/main.yml +++ b/roles/cloud_connector/tasks/main.yml @@ -1,13 +1,13 @@ --- - name: Install yggdrasil-worker-forwarder and rhc - yum: + ansible.builtin.yum: name: - rhc - yggdrasil-worker-forwarder disable_plugin: foreman-protector - name: Create workers directory - file: + ansible.builtin.file: state: directory path: "/etc/rhc/workers" owner: root @@ -34,7 +34,7 @@ mode: 0755 - name: Ensure rhcd started - service: + ansible.builtin.service: name: rhcd state: started enabled: true @@ -60,8 +60,8 @@ client_id: "{{ cert_output.stdout | regex_search('CN\\s?=\\s?([a-z0-9-]+)', '\\1') | first }}" - name: Configure HTTP proxy - include_tasks: http_proxy.yml + ansible.builtin.include_tasks: http_proxy.yml when: foreman_cloud_connector_http_proxy is defined - name: Cleanup receptor - include_tasks: cleanup_receptor.yml + ansible.builtin.include_tasks: cleanup_receptor.yml diff --git a/roles/foreman_proxy_certs_generate/molecule/default/prepare.yml b/roles/foreman_proxy_certs_generate/molecule/default/prepare.yml index 0ad8da1..ce05451 100644 --- a/roles/foreman_proxy_certs_generate/molecule/default/prepare.yml +++ b/roles/foreman_proxy_certs_generate/molecule/default/prepare.yml @@ -11,12 +11,12 @@ - puppet_repositories post_tasks: - name: Ensure langpacks on EL8 - dnf: + ansible.builtin.dnf: name: glibc-langpack-en state: present when: ansible_facts['os_family'] == 'RedHat' - name: Run installer - include_role: + ansible.builtin.include_role: name: installer vars: foreman_installer_scenario: katello diff --git a/roles/foreman_proxy_certs_generate/molecule/default/verify.yml b/roles/foreman_proxy_certs_generate/molecule/default/verify.yml index 456debe..1ef2cc1 100644 --- a/roles/foreman_proxy_certs_generate/molecule/default/verify.yml +++ b/roles/foreman_proxy_certs_generate/molecule/default/verify.yml @@ -4,11 +4,11 @@ gather_facts: false tasks: - name: Find proxy certs file - stat: + ansible.builtin.stat: path: /root/proxy.example.com.tar.gz register: cert_tarball - name: Check proxy certs file exists - assert: + ansible.builtin.assert: that: - cert_tarball.stat.exists diff --git a/roles/foreman_proxy_certs_generate/tasks/main.yml b/roles/foreman_proxy_certs_generate/tasks/main.yml index 4e8b915..536f965 100644 --- a/roles/foreman_proxy_certs_generate/tasks/main.yml +++ b/roles/foreman_proxy_certs_generate/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: 'Generate certificates for a Foreman Proxy' - command: | + ansible.builtin.command: | {{ foreman_proxy_certs_generate_command }} --foreman-proxy-fqdn {{ foreman_proxy_certs_generate_fqdn }} --certs-tar {{ foreman_proxy_certs_generate_tarball }} diff --git a/roles/foreman_repositories/molecule/debian/verify.yml b/roles/foreman_repositories/molecule/debian/verify.yml index f9d7cd9..a13f58d 100644 --- a/roles/foreman_repositories/molecule/debian/verify.yml +++ b/roles/foreman_repositories/molecule/debian/verify.yml @@ -4,12 +4,12 @@ gather_facts: false tasks: - name: Get sources.list - slurp: + ansible.builtin.slurp: path: /etc/apt/sources.list.d/deb_theforeman_org.list register: repos - name: Check Foreman repos exists - assert: + ansible.builtin.assert: that: - "'deb http://deb.theforeman.org bullseye 3.2' in repos['content'] | b64decode" - "'deb http://deb.theforeman.org plugins 3.2' in repos['content'] | b64decode" diff --git a/roles/foreman_repositories/molecule/redhat/verify.yml b/roles/foreman_repositories/molecule/redhat/verify.yml index 22ba5ee..b14326a 100644 --- a/roles/foreman_repositories/molecule/redhat/verify.yml +++ b/roles/foreman_repositories/molecule/redhat/verify.yml @@ -4,41 +4,41 @@ gather_facts: false tasks: - name: Ensure foreman-release is installed - package: + ansible.builtin.package: name: foreman-release state: present - name: Ensure katello-repos is installed - package: + ansible.builtin.package: name: katello-repos state: present - name: Stat foreman.repo - stat: + ansible.builtin.stat: path: /etc/yum.repos.d/foreman.repo register: foreman_repo - name: Check foreman_repo file exists - assert: + ansible.builtin.assert: that: - foreman_repo.stat.exists - name: Stat foreman-plugins.repo - stat: + ansible.builtin.stat: path: /etc/yum.repos.d/foreman-plugins.repo register: foreman_plugins_repo - name: Check foreman_plugins_repo file exists - assert: + ansible.builtin.assert: that: - foreman_plugins_repo.stat.exists - name: Stat katello.repo - stat: + ansible.builtin.stat: path: /etc/yum.repos.d/katello.repo register: katello_repo - name: Check katello_repo file exists - assert: + ansible.builtin.assert: that: - katello_repo.stat.exists diff --git a/roles/foreman_repositories/tasks/debian.yml b/roles/foreman_repositories/tasks/debian.yml index 90e2660..6fece8a 100644 --- a/roles/foreman_repositories/tasks/debian.yml +++ b/roles/foreman_repositories/tasks/debian.yml @@ -1,16 +1,16 @@ --- - name: 'Install Foreman GPG key' - get_url: + ansible.builtin.get_url: url: https://deb.theforeman.org/foreman.asc dest: /etc/apt/trusted.gpg.d/foreman.asc mode: '0444' - name: 'Setup repository for Foreman {{ foreman_repositories_version }}' - apt_repository: + ansible.builtin.apt_repository: repo: deb http://deb.theforeman.org {{ ansible_distribution_release }} {{ foreman_repositories_version }} state: present - name: 'Setup repository for Foreman Plugins {{ foreman_repositories_version }}' - apt_repository: + ansible.builtin.apt_repository: repo: deb http://deb.theforeman.org plugins {{ foreman_repositories_version }} state: present diff --git a/roles/foreman_repositories/tasks/main.yml b/roles/foreman_repositories/tasks/main.yml index caa024a..5eb70d7 100644 --- a/roles/foreman_repositories/tasks/main.yml +++ b/roles/foreman_repositories/tasks/main.yml @@ -1,3 +1,3 @@ --- - name: Load OS specific repository tasks - include_tasks: "{{ ansible_os_family | lower }}.yml" + ansible.builtin.include_tasks: "{{ ansible_os_family | lower }}.yml" diff --git a/roles/foreman_repositories/tasks/redhat-modules.yml b/roles/foreman_repositories/tasks/redhat-modules.yml index 8cdf41a..26a750e 100644 --- a/roles/foreman_repositories/tasks/redhat-modules.yml +++ b/roles/foreman_repositories/tasks/redhat-modules.yml @@ -1,6 +1,6 @@ --- - name: 'Enable foreman:el8 module' - command: dnf module enable -y foreman:el8 + ansible.builtin.command: dnf module enable -y foreman:el8 # can't use the `dnf` module for modules without a default stream # https://github.com/ansible/ansible/issues/56504 # https://github.com/ansible/ansible/issues/64852 @@ -12,7 +12,7 @@ - foreman_repositories_version == "nightly" or foreman_repositories_version is version('3.2', '>=') - name: 'Enable katello el8 modules' - command: "dnf module enable -y {{ item }}:el8" + ansible.builtin.command: "dnf module enable -y {{ item }}:el8" # can't use the `dnf` module for modules without a default stream # https://github.com/ansible/ansible/issues/56504 # https://github.com/ansible/ansible/issues/64852 @@ -28,7 +28,7 @@ - foreman_repositories_katello_version == "nightly" or foreman_repositories_katello_version is version('4.4', '>=') - name: 'Enable pki-core module' - command: dnf module enable -y pki-core + ansible.builtin.command: dnf module enable -y pki-core # can't use the `dnf` module for modules without a default stream # https://github.com/ansible/ansible/issues/56504 # https://github.com/ansible/ansible/issues/64852 diff --git a/roles/foreman_repositories/tasks/redhat.yml b/roles/foreman_repositories/tasks/redhat.yml index b839071..b81bca3 100644 --- a/roles/foreman_repositories/tasks/redhat.yml +++ b/roles/foreman_repositories/tasks/redhat.yml @@ -1,6 +1,6 @@ --- - name: 'Install centos-release-scl-rh on CentOS7' # noqa package-latest - yum: + ansible.builtin.yum: name: centos-release-scl-rh state: latest update_cache: true @@ -11,7 +11,7 @@ - ansible_distribution_major_version == '7' - name: 'Setup repository for Foreman {{ foreman_repositories_version }}' - yum: + ansible.builtin.yum: name: https://yum.theforeman.org/releases/{{ foreman_repositories_version }}/el{{ ansible_distribution_major_version }}/x86_64/foreman-release.rpm disable_gpg_check: true state: present @@ -19,7 +19,7 @@ - packages - name: 'Setup repository for Katello {{ foreman_repositories_katello_version }}' - yum: + ansible.builtin.yum: name: https://yum.theforeman.org/katello/{{ foreman_repositories_katello_version }}/katello/el{{ ansible_distribution_major_version }}/x86_64/katello-repos-latest.rpm disable_gpg_check: true state: present @@ -29,7 +29,7 @@ - foreman_repositories_katello_version is defined - name: 'Enable modules on EL8' - include_tasks: redhat-modules.yml + ansible.builtin.include_tasks: redhat-modules.yml when: - ansible_distribution_major_version == '8' @@ -39,17 +39,17 @@ - ansible_distribution_major_version == '8' block: - name: Install dnf-config-manager - package: + ansible.builtin.package: name: dnf-plugins-core state: present - name: Check if powertools repository is disabled - command: dnf repolist --disabled powertools + ansible.builtin.command: dnf repolist --disabled powertools register: disabled_repos changed_when: false - name: Enable powertools - command: dnf config-manager --set-enabled powertools + ansible.builtin.command: dnf config-manager --set-enabled powertools when: - "'powertools' in disabled_repos.stdout" - ansible_distribution != 'RedHat' diff --git a/roles/installer/molecule/default/prepare.yml b/roles/installer/molecule/default/prepare.yml index 8df6232..c140285 100644 --- a/roles/installer/molecule/default/prepare.yml +++ b/roles/installer/molecule/default/prepare.yml @@ -8,7 +8,7 @@ - foreman_repositories tasks: - name: Ensure langpacks on EL8 - dnf: + ansible.builtin.dnf: name: glibc-langpack-en state: present when: ansible_facts['os_family'] == 'RedHat' diff --git a/roles/installer/molecule/default/verify.yml b/roles/installer/molecule/default/verify.yml index f334606..0f09e97 100644 --- a/roles/installer/molecule/default/verify.yml +++ b/roles/installer/molecule/default/verify.yml @@ -4,24 +4,24 @@ gather_facts: false tasks: - name: Foreman is installed - package: + ansible.builtin.package: name: foreman state: present - name: Find installer flag file - stat: + ansible.builtin.stat: path: /etc/foreman-installer/scenarios.d/.installed register: installed_file - name: Assert installer flag file exists - assert: + ansible.builtin.assert: that: - installed_file.stat.exists - name: Find tasks config file - stat: + ansible.builtin.stat: path: /etc/foreman/plugins/foreman-tasks.yaml register: foreman_tasks_yaml - name: Check tasks config file exists - assert: + ansible.builtin.assert: that: - foreman_tasks_yaml.stat.exists diff --git a/roles/installer/tasks/main.yml b/roles/installer/tasks/main.yml index a22375f..6de4f16 100644 --- a/roles/installer/tasks/main.yml +++ b/roles/installer/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Check that necessary variables are defined - assert: + ansible.builtin.assert: that: - foreman_installer_scenario is defined @@ -10,12 +10,12 @@ - ansible_os_family == 'RedHat' block: - name: Get foreman-installer version - dnf: + ansible.builtin.dnf: list: foreman-installer register: package_info - name: Enable ruby:2.7 module - dnf: + ansible.builtin.dnf: name: '@ruby:2.7' state: present when: @@ -23,17 +23,17 @@ # This is a workaround for https://projects.theforeman.org/issues/34468 - name: "Install hostname" - package: + ansible.builtin.package: name: hostname state: present - name: "Install {{ foreman_installer_package }}" - package: + ansible.builtin.package: name: "{{ foreman_installer_package }}" state: present - name: Run installer - command: > + ansible.builtin.command: > {{ foreman_installer_command }} --scenario {{ foreman_installer_scenario }} {{ (foreman_installer_verbose | bool) | ternary("-v", "") }} @@ -49,7 +49,7 @@ LANG: "{{ foreman_installer_locale }}" - name: Check async status for foreman-installer - async_status: + ansible.builtin.async_status: jid: "{{ async_results.ansible_job_id }}" register: async_poll_results until: async_poll_results.finished diff --git a/roles/postgresql_upgrade/molecule/redhat/prepare.yml b/roles/postgresql_upgrade/molecule/redhat/prepare.yml index f2a7f09..3116854 100644 --- a/roles/postgresql_upgrade/molecule/redhat/prepare.yml +++ b/roles/postgresql_upgrade/molecule/redhat/prepare.yml @@ -4,11 +4,11 @@ gather_facts: true tasks: - name: Install PostgreSQL 10 - dnf: + ansible.builtin.dnf: name: '@postgresql:10/server' state: present - name: Run postgresql-setup --initdb - command: postgresql-setup --initdb + ansible.builtin.command: postgresql-setup --initdb args: creates: /var/lib/pgsql/data/PG_VERSION diff --git a/roles/postgresql_upgrade/molecule/redhat/verify.yml b/roles/postgresql_upgrade/molecule/redhat/verify.yml index c62086e..8155ff0 100644 --- a/roles/postgresql_upgrade/molecule/redhat/verify.yml +++ b/roles/postgresql_upgrade/molecule/redhat/verify.yml @@ -4,15 +4,15 @@ gather_facts: false tasks: - name: Get version of postgres data directory - slurp: + ansible.builtin.slurp: path: /var/lib/pgsql/data/PG_VERSION register: pg_version - name: Print PostgreSQL version - debug: + ansible.builtin.debug: msg: "{{ pg_version['content'] | b64decode }}" - name: Assure postgresql version is 12 - assert: + ansible.builtin.assert: that: - "'12' in pg_version['content'] | b64decode" diff --git a/roles/postgresql_upgrade/tasks/main.yml b/roles/postgresql_upgrade/tasks/main.yml index 1b1a69b..726a462 100644 --- a/roles/postgresql_upgrade/tasks/main.yml +++ b/roles/postgresql_upgrade/tasks/main.yml @@ -1,13 +1,13 @@ --- - name: Ensure running on EL8 - assert: + ansible.builtin.assert: that: - ansible_os_family == "RedHat" - ansible_distribution_major_version == '8' fail_msg: "This role is only supported on EL8" - name: Get version from the PostgreSQL data directory - slurp: + ansible.builtin.slurp: path: /var/lib/pgsql/data/PG_VERSION register: pg_version @@ -16,52 +16,52 @@ - "'10' in pg_version['content']|b64decode" block: - name: Start postgresql - service: + ansible.builtin.service: name: postgresql state: started - name: Collect postgres data - shell: psql --list --tuples-only | grep -E "^\s+postgres" + ansible.builtin.shell: psql --list --tuples-only | grep -E "^\s+postgres" become: true become_user: postgres changed_when: false register: postgres_output - name: Set collate and ctype facts - set_fact: + ansible.builtin.set_fact: collate: "{{ postgres_output.stdout.split('|')[3] | trim }}" ctype: "{{ postgres_output.stdout.split('|')[4] | trim }}" - name: Stop postgresql - service: + ansible.builtin.service: name: postgresql state: stopped # https://bugzilla.redhat.com/show_bug.cgi?id=1935301 - name: Update postgresq.conf data directory - lineinfile: + ansible.builtin.lineinfile: path: /var/lib/pgsql/data/postgresql.conf regexp: '^data_directory =' line: '' - name: Enable postgresql:12 module - dnf: + ansible.builtin.dnf: name: '@postgresql:12' state: present - name: Update postgresql packages # noqa package-latest - dnf: + ansible.builtin.dnf: name: - postgresql-server - postgresql-upgrade state: latest - name: Run postgresql-setup --upgrade # noqa no-changed-when - command: postgresql-setup --upgrade + ansible.builtin.command: postgresql-setup --upgrade environment: PGSETUP_INITDB_OPTIONS: "--lc-collate={{ collate }} --lc-ctype={{ ctype }} --locale={{ collate }}" - name: Start postgresql - service: + ansible.builtin.service: name: postgresql state: started diff --git a/roles/puppet_repositories/molecule/debian/verify.yml b/roles/puppet_repositories/molecule/debian/verify.yml index d7898ea..9bd8e0a 100644 --- a/roles/puppet_repositories/molecule/debian/verify.yml +++ b/roles/puppet_repositories/molecule/debian/verify.yml @@ -4,16 +4,16 @@ gather_facts: false tasks: - name: Ensure puppet5-release package is absent - package: + ansible.builtin.package: name: puppet5-release state: absent - name: Ensure puppet6-release package is absent - package: + ansible.builtin.package: name: puppet6-release state: absent - name: Ensure puppet7-release package is present - package: + ansible.builtin.package: name: puppet7-release state: present diff --git a/roles/puppet_repositories/molecule/redhat/verify.yml b/roles/puppet_repositories/molecule/redhat/verify.yml index 89dd49c..8f5428a 100644 --- a/roles/puppet_repositories/molecule/redhat/verify.yml +++ b/roles/puppet_repositories/molecule/redhat/verify.yml @@ -4,16 +4,16 @@ gather_facts: false tasks: - name: Ensure puppet5-release RPM is absent - package: + ansible.builtin.package: name: puppet5-release state: absent - name: Ensure puppet6-release RPM is absent - package: + ansible.builtin.package: name: puppet6-release state: absent - name: Ensure puppet7-release RPM is installed - package: + ansible.builtin.package: name: puppet7-release state: present diff --git a/roles/puppet_repositories/tasks/debian.yml b/roles/puppet_repositories/tasks/debian.yml index 8e78859..56aab46 100644 --- a/roles/puppet_repositories/tasks/debian.yml +++ b/roles/puppet_repositories/tasks/debian.yml @@ -1,18 +1,18 @@ --- - name: Install GPG package - package: + ansible.builtin.package: name: gpg state: present update_cache: true - name: Install Puppet repository - apt: + ansible.builtin.apt: deb: "https://apt.puppet.com/puppet{{ foreman_puppet_repositories_version }}-release-{{ ansible_distribution_release }}.deb" state: present register: puppet_apt_deb_install - name: Update apt cache if necessary - apt: + ansible.builtin.apt: update_cache: true force_apt_get: true when: puppet_apt_deb_install.changed diff --git a/roles/puppet_repositories/tasks/main.yml b/roles/puppet_repositories/tasks/main.yml index 7ef96e8..e4d10f4 100644 --- a/roles/puppet_repositories/tasks/main.yml +++ b/roles/puppet_repositories/tasks/main.yml @@ -1,9 +1,9 @@ --- - name: Remove any existing Puppet release packages for versions other than {{ foreman_puppet_repositories_version }} - package: + ansible.builtin.package: name: "puppet{{ item }}-release" state: absent loop: "{{ foreman_puppet_repositories_supported_versions | difference([foreman_puppet_repositories_version | string]) }}" - name: 'Include {{ ansible_os_family }}' - include_tasks: '{{ ansible_os_family | lower }}.yml' + ansible.builtin.include_tasks: '{{ ansible_os_family | lower }}.yml' diff --git a/roles/puppet_repositories/tasks/redhat.yml b/roles/puppet_repositories/tasks/redhat.yml index 3028e9e..323b56d 100644 --- a/roles/puppet_repositories/tasks/redhat.yml +++ b/roles/puppet_repositories/tasks/redhat.yml @@ -1,6 +1,6 @@ --- - name: 'Setup Puppet repository' - yum: + ansible.builtin.yum: name: https://yum.puppet.com/puppet{{ foreman_puppet_repositories_version }}-release-el-{{ ansible_distribution_major_version }}.noarch.rpm disable_gpg_check: true state: present From 3308f12919a3ae050ae3ef804cf315e4b4d89be5 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 16 Dec 2022 09:36:13 +0100 Subject: [PATCH 32/37] make ansible-lint use our yamllint config --- requirements-dev.txt | 2 +- roles/ansible_repositories/molecule/redhat/molecule.yml | 2 +- roles/backup/molecule/debian/molecule.yml | 2 +- roles/backup/molecule/redhat/molecule.yml | 2 +- .../foreman_proxy_certs_generate/molecule/default/molecule.yml | 2 +- roles/foreman_repositories/molecule/debian/molecule.yml | 2 +- roles/foreman_repositories/molecule/redhat/molecule.yml | 2 +- roles/installer/molecule/default/molecule.yml | 2 +- roles/postgresql_upgrade/molecule/redhat/molecule.yml | 2 +- roles/puppet_repositories/molecule/debian/molecule.yml | 2 +- roles/puppet_repositories/molecule/redhat/molecule.yml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ab1f8d4..23e24be 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,4 +7,4 @@ pylint==2.6.0; python_version >= '3.6' voluptuous==0.12.1 # from https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.validate-modules.txt yamllint molecule[docker,lint] -ansible-lint<6 +ansible-lint diff --git a/roles/ansible_repositories/molecule/redhat/molecule.yml b/roles/ansible_repositories/molecule/redhat/molecule.yml index f7f2083..1c22c75 100644 --- a/roles/ansible_repositories/molecule/redhat/molecule.yml +++ b/roles/ansible_repositories/molecule/redhat/molecule.yml @@ -19,4 +19,4 @@ verifier: lint: | set -e yamllint -c ../../.yamllint . - ansible-lint . + YAMLLINT_CONFIG_FILE=../../.yamllint ansible-lint . diff --git a/roles/backup/molecule/debian/molecule.yml b/roles/backup/molecule/debian/molecule.yml index b2fcbe4..517489c 100644 --- a/roles/backup/molecule/debian/molecule.yml +++ b/roles/backup/molecule/debian/molecule.yml @@ -13,4 +13,4 @@ verifier: lint: | set -e yamllint -c ../../.yamllint . - ansible-lint . + YAMLLINT_CONFIG_FILE=../../.yamllint ansible-lint . diff --git a/roles/backup/molecule/redhat/molecule.yml b/roles/backup/molecule/redhat/molecule.yml index f7f2083..1c22c75 100644 --- a/roles/backup/molecule/redhat/molecule.yml +++ b/roles/backup/molecule/redhat/molecule.yml @@ -19,4 +19,4 @@ verifier: lint: | set -e yamllint -c ../../.yamllint . - ansible-lint . + YAMLLINT_CONFIG_FILE=../../.yamllint ansible-lint . diff --git a/roles/foreman_proxy_certs_generate/molecule/default/molecule.yml b/roles/foreman_proxy_certs_generate/molecule/default/molecule.yml index fbf1ad7..6159f8e 100644 --- a/roles/foreman_proxy_certs_generate/molecule/default/molecule.yml +++ b/roles/foreman_proxy_certs_generate/molecule/default/molecule.yml @@ -19,4 +19,4 @@ verifier: lint: | set -e yamllint -c ../../.yamllint . - ansible-lint . + YAMLLINT_CONFIG_FILE=../../.yamllint ansible-lint . diff --git a/roles/foreman_repositories/molecule/debian/molecule.yml b/roles/foreman_repositories/molecule/debian/molecule.yml index b2fcbe4..517489c 100644 --- a/roles/foreman_repositories/molecule/debian/molecule.yml +++ b/roles/foreman_repositories/molecule/debian/molecule.yml @@ -13,4 +13,4 @@ verifier: lint: | set -e yamllint -c ../../.yamllint . - ansible-lint . + YAMLLINT_CONFIG_FILE=../../.yamllint ansible-lint . diff --git a/roles/foreman_repositories/molecule/redhat/molecule.yml b/roles/foreman_repositories/molecule/redhat/molecule.yml index f7f2083..1c22c75 100644 --- a/roles/foreman_repositories/molecule/redhat/molecule.yml +++ b/roles/foreman_repositories/molecule/redhat/molecule.yml @@ -19,4 +19,4 @@ verifier: lint: | set -e yamllint -c ../../.yamllint . - ansible-lint . + YAMLLINT_CONFIG_FILE=../../.yamllint ansible-lint . diff --git a/roles/installer/molecule/default/molecule.yml b/roles/installer/molecule/default/molecule.yml index fbf1ad7..6159f8e 100644 --- a/roles/installer/molecule/default/molecule.yml +++ b/roles/installer/molecule/default/molecule.yml @@ -19,4 +19,4 @@ verifier: lint: | set -e yamllint -c ../../.yamllint . - ansible-lint . + YAMLLINT_CONFIG_FILE=../../.yamllint ansible-lint . diff --git a/roles/postgresql_upgrade/molecule/redhat/molecule.yml b/roles/postgresql_upgrade/molecule/redhat/molecule.yml index fbf1ad7..6159f8e 100644 --- a/roles/postgresql_upgrade/molecule/redhat/molecule.yml +++ b/roles/postgresql_upgrade/molecule/redhat/molecule.yml @@ -19,4 +19,4 @@ verifier: lint: | set -e yamllint -c ../../.yamllint . - ansible-lint . + YAMLLINT_CONFIG_FILE=../../.yamllint ansible-lint . diff --git a/roles/puppet_repositories/molecule/debian/molecule.yml b/roles/puppet_repositories/molecule/debian/molecule.yml index b2fcbe4..517489c 100644 --- a/roles/puppet_repositories/molecule/debian/molecule.yml +++ b/roles/puppet_repositories/molecule/debian/molecule.yml @@ -13,4 +13,4 @@ verifier: lint: | set -e yamllint -c ../../.yamllint . - ansible-lint . + YAMLLINT_CONFIG_FILE=../../.yamllint ansible-lint . diff --git a/roles/puppet_repositories/molecule/redhat/molecule.yml b/roles/puppet_repositories/molecule/redhat/molecule.yml index f7f2083..1c22c75 100644 --- a/roles/puppet_repositories/molecule/redhat/molecule.yml +++ b/roles/puppet_repositories/molecule/redhat/molecule.yml @@ -19,4 +19,4 @@ verifier: lint: | set -e yamllint -c ../../.yamllint . - ansible-lint . + YAMLLINT_CONFIG_FILE=../../.yamllint ansible-lint . From f376c9b78c89b0ee69c4e67887b01a371f517073 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 16 Dec 2022 08:25:45 +0100 Subject: [PATCH 33/37] update docs build from FAM --- docs/conf.py | 2 +- docs/requirements.txt | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 96bd11d..821bc43 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -43,7 +43,7 @@ 'recommonmark', 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', - 'ansible_basic_sphinx_ext', + 'sphinx_antsibull_ext', ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/requirements.txt b/docs/requirements.txt index 2f96bfb..51adf16 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,4 @@ -antsibull>=0.17.0 -ansible-base>=2.10.0rc2 +antsibull-docs>=1 +ansible-core sphinx-rtd-theme -git+https://github.com/felixfontein/ansible-basic-sphinx-ext recommonmark From af1bed3a72a27745e34274e12789235bb8334ff3 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 4 Jan 2023 10:16:39 +0100 Subject: [PATCH 34/37] run molecule against ansible 2.14 too --- .github/workflows/main.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ef65a47..95569ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -103,16 +103,18 @@ jobs: strategy: matrix: python: - - "3.8" + - "3.9" ansible: - - stable-2.9 - - stable-2.10 - stable-2.11 - stable-2.12 - stable-2.13 + - stable-2.14 + - devel include: - - python: "3.9" - ansible: "devel" + - python: "3.8" + ansible: "stable-2.9" + - python: "3.8" + ansible: "stable-2.10" steps: - uses: actions/checkout@v3 - name: Set up Python From 689b43923922c42538ebc0a99ffcb217c0167e0a Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 4 Jan 2023 10:03:40 +0100 Subject: [PATCH 35/37] Update default Foreman to 3.5 --- roles/foreman_repositories/README.md | 12 ++++++------ roles/foreman_repositories/defaults/main.yml | 2 +- .../foreman_repositories/molecule/debian/verify.yml | 4 ++-- .../molecule/redhat/converge.yml | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/roles/foreman_repositories/README.md b/roles/foreman_repositories/README.md index 20cdf0f..ce66a04 100644 --- a/roles/foreman_repositories/README.md +++ b/roles/foreman_repositories/README.md @@ -8,33 +8,33 @@ Role Variables Optional: -- `foreman_repositories_version`: Version of Foreman to setup repositories for (default: 3.2) +- `foreman_repositories_version`: Version of Foreman to setup repositories for (default: 3.5) - `foreman_repositories_katello_version`: Version of Katello to setup repositories for, set a value for this to configure Katello repositories otherwise no Katello repositories will be configured (default: null) Example Playbooks ----------------- -Setup repositories for Foreman 3.2: +Setup repositories for Foreman 3.5: ```yaml --- - hosts: all gather_facts: true vars: - foreman_repositories_version: "3.2" + foreman_repositories_version: "3.5" roles: - foreman_repositories ``` -Setup repositories for Katello 4.4 and Foreman 3.2: +Setup repositories for Katello 4.7 and Foreman 3.5: ```yaml --- - hosts: all gather_facts: true vars: - foreman_repositories_version: "3.2" - foreman_repositories_katello_version: "4.4" + foreman_repositories_version: "3.5" + foreman_repositories_katello_version: "4.7" roles: - foreman_repositories ``` diff --git a/roles/foreman_repositories/defaults/main.yml b/roles/foreman_repositories/defaults/main.yml index 011a826..9c4952c 100644 --- a/roles/foreman_repositories/defaults/main.yml +++ b/roles/foreman_repositories/defaults/main.yml @@ -1,2 +1,2 @@ --- -foreman_repositories_version: "3.2" +foreman_repositories_version: "3.5" diff --git a/roles/foreman_repositories/molecule/debian/verify.yml b/roles/foreman_repositories/molecule/debian/verify.yml index a13f58d..7c4d095 100644 --- a/roles/foreman_repositories/molecule/debian/verify.yml +++ b/roles/foreman_repositories/molecule/debian/verify.yml @@ -11,5 +11,5 @@ - name: Check Foreman repos exists ansible.builtin.assert: that: - - "'deb http://deb.theforeman.org bullseye 3.2' in repos['content'] | b64decode" - - "'deb http://deb.theforeman.org plugins 3.2' in repos['content'] | b64decode" + - "'deb http://deb.theforeman.org bullseye 3.5' in repos['content'] | b64decode" + - "'deb http://deb.theforeman.org plugins 3.5' in repos['content'] | b64decode" diff --git a/roles/foreman_repositories/molecule/redhat/converge.yml b/roles/foreman_repositories/molecule/redhat/converge.yml index 7763cb1..9c4580c 100644 --- a/roles/foreman_repositories/molecule/redhat/converge.yml +++ b/roles/foreman_repositories/molecule/redhat/converge.yml @@ -3,7 +3,7 @@ hosts: all gather_facts: true vars: - foreman_repositories_version: "3.2" - foreman_repositories_katello_version: "4.4" + foreman_repositories_version: "3.5" + foreman_repositories_katello_version: "4.7" roles: - foreman_repositories From 30e6a620cfef356590f129bb3e072cff19f4adad Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 4 Jan 2023 10:05:24 +0100 Subject: [PATCH 36/37] release 1.3.0 --- CHANGELOG.rst | 16 ++++++++++++++++ changelogs/changelog.yaml | 10 ++++++++++ galaxy.yml | 5 +++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b917148..03e2e8e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,22 @@ theforeman.operations Release Notes .. contents:: Topics +v1.3.0 +====== + +Minor Changes +------------- + +- new role to configure backups using ``foreman-maintain`` +- update default Foreman to 3.5 +- update default Puppet to 7 + +Bugfixes +-------- + +- cloud_connector role - Ensure ``rhcd.service`` starts after system reboots +- fix paths in execution-environment.yml (https://bugzilla.redhat.com/show_bug.cgi?id=2156941) + v1.2.3 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 2a1d270..3b31dbe 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -57,3 +57,13 @@ releases: bugfixes: - foreman_repositories - also enable pulpcore module when enabling katello release_date: '2022-06-17' + 1.3.0: + changes: + bugfixes: + - cloud_connector role - Ensure ``rhcd.service`` starts after system reboots + - fix paths in execution-environment.yml (https://bugzilla.redhat.com/show_bug.cgi?id=2156941) + minor_changes: + - new role to configure backups using ``foreman-maintain`` + - update default Foreman to 3.5 + - update default Puppet to 7 + release_date: '2023-01-04' diff --git a/galaxy.yml b/galaxy.yml index a5c80e8..1f9daa8 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -6,12 +6,13 @@ authors: - "Eric D. Helms " - "Evgeni Golov " - "Ewoud Kohl van Wijngaarden " - - "Jeremy Audet " - "Jeffrey van Pelt " + - "Jeremy Audet " - "Kyle Williams " - "Matthias Dellweg <2500@gmx.de>" + - "Robert Rettig " - "willtome " -version: "1.3.0-dev" +version: "1.3.0" license: - "GPL-3.0-or-later" tags: From 9be7ee9c482c11b9985d6faa776c05c96d37c9f7 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 9 Jan 2023 09:12:39 +0100 Subject: [PATCH 37/37] fix FQCN in fake role --- roles/fake_installer_rpm/tasks/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/fake_installer_rpm/tasks/main.yml b/roles/fake_installer_rpm/tasks/main.yml index 1f14ea0..8cce3fc 100644 --- a/roles/fake_installer_rpm/tasks/main.yml +++ b/roles/fake_installer_rpm/tasks/main.yml @@ -1,24 +1,24 @@ --- - name: Install rpmbuild and dependencies - package: + ansible.builtin.package: name: - rpm-build - createrepo - rpmdevtools - name: Create directory structure for rpmbuild - shell: rpmdev-setuptree # noqa command-instead-of-shell + ansible.builtin.shell: rpmdev-setuptree # noqa command-instead-of-shell args: creates: "{{ ansible_env.HOME }}/rpmbuild" - name: Copy spec file to destination - template: + ansible.builtin.template: src: satellite-installer.spec.j2 dest: "{{ ansible_env.HOME }}/rpmbuild/SPECS/satellite-installer.spec" mode: 0644 - name: Build satellite-installer RPM - shell: "rpmbuild -ba SPECS/satellite-installer.spec" # noqa command-instead-of-shell + ansible.builtin.shell: "rpmbuild -ba SPECS/satellite-installer.spec" # noqa command-instead-of-shell args: chdir: "{{ ansible_env.HOME }}/rpmbuild" register: build_result @@ -27,7 +27,7 @@ - molecule-idempotence-notest - name: Copy satellite-installer RPM to local repo - copy: + ansible.builtin.copy: src: "{{ ansible_env.HOME }}/rpmbuild/RPMS/x86_64/" dest: "{{ fake_installer_rpm_repo }}" remote_src: true @@ -36,13 +36,13 @@ - molecule-idempotence-notest - name: Create a local repository - command: "createrepo --update {{ fake_installer_rpm_repo }}" + ansible.builtin.command: "createrepo --update {{ fake_installer_rpm_repo }}" changed_when: true tags: - molecule-idempotence-notest - name: Create yumrepo - yum_repository: + ansible.builtin.yum_repository: name: fake-installer-rpm description: Local repository for satellite-installer fake RPM baseurl: "file://{{ fake_installer_rpm_repo }}"