Skip to content

Commit

Permalink
Merge pull request #697 from sscheib/ci-add_core_2_18
Browse files Browse the repository at this point in the history
ci: Adding suppport for Ansible Core 2.18
  • Loading branch information
sscheib authored Nov 15, 2024
2 parents 86649ba + 2967102 commit c23e6fe
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 56 deletions.
Binary file modified .github/spellcheck/spellcheck.dic
Binary file not shown.
1 change: 1 addition & 0 deletions .github/spellcheck/wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Nav
frontmatter
OpenWrt
init
opkg
14 changes: 14 additions & 0 deletions .github/workflows/wf_call_molecule_certified_ees.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ jobs:
# UBI 8
#

# yamllint disable-line rule:line-length
- image: 'registry.redhat.io/ansible-automation-platform/ee-minimal-rhel8:2.18.0-1@sha256:b77130f48ecb52aefc955821822999f92ce8e0957d0b17289c4dd2a040280ca7'
cache_key_suffix: 'rhel8-2.18'
# renovate yaml: datasource=pypi
molecule: '24.9.0'

# yamllint disable-line rule:line-length
- image: 'registry.redhat.io/ansible-automation-platform/ee-minimal-rhel8:2.17.6-1@sha256:9ed8205b228fe1f83da12dd47475363d314fba58a4919a3c8f24ad0bfa105899'
cache_key_suffix: 'rhel8-2.17'
Expand Down Expand Up @@ -142,6 +148,14 @@ jobs:
# UBI 9
#

# yamllint disable-line rule:line-length
- image: 'registry.redhat.io/ansible-automation-platform/ee-minimal-rhel9:2.18.0-2@sha256:9dcec82d8fa5a4069f8532231f7a52d6b2b3e410bf6ef79648338b4370b2931b'
cache_key_suffix: 'rhel9-2.18'
# renovate yaml: datasource=pypi
molecule: '24.9.0'
additional_packages:
- 'python-unversioned-command'

# yamllint disable-line rule:line-length
- image: 'registry.redhat.io/ansible-automation-platform/ee-minimal-rhel9:2.17.6-2@sha256:30dfecdbab2131a050553b1c54a5f45a912a76db99efbfbbc02ac608b51255bb'
cache_key_suffix: 'rhel9-2.17'
Expand Down
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ repos:
verbose: true
args:
- '--progress'
- '--config'
- '.markdown-link-check.json'

- repo: 'https://github.com/igorshubovych/markdownlint-cli'
rev: 'v0.42.0'
Expand Down
26 changes: 19 additions & 7 deletions docs/molecule_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ Below you'll find the complete test matrix for molecule.

| Operating system control node | Operating system managed node | Ansible Core Version | Automation Execution Environment name |
| :---------------------------- | :---------------------------- | :------------------- | :---------------------------------------------------------- |
| RHEL 9 (UBI) | RHEL 9 (UBI) | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel9:2.18.0-2` |
| RHEL 9 (UBI) | Debian 12 (Bookworm) | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel9:2.18.0-2` |
| RHEL 9 (UBI) | Debian 11 (Bullseye) | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel9:2.18.0-2` |
| RHEL 9 (UBI) | OpenWrt 23.05 | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel9:2.18.0-2` |
| RHEL 9 (UBI) | OpenWrt 22.03.5 | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel9:2.18.0-2` |
| RHEL 9 (UBI) | OpenWrt 21.02.7 | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel9:2.18.0-2` |
| RHEL 9 (UBI) | RHEL 9 (UBI) | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel9:2.17.6-2` |
| RHEL 9 (UBI) | Debian 12 (Bookworm) | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel9:2.17.6-2` |
| RHEL 9 (UBI) | Debian 11 (Bullseye) | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel9:2.17.6-2` |
Expand Down Expand Up @@ -65,13 +71,19 @@ Below you'll find the complete test matrix for molecule.

| Operating system control node | Operating system managed node | Ansible Core Version | Automation Execution Environment name |
| :---------------------------- | :---------------------------- | :------------------- | :---------------------------------------------------------- |
| RHEL 8 (UBI) | RHEL 9 (UBI) | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.17.6-1` |
| RHEL 8 (UBI) | Debian 12 (Bookworm) | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.17.6-1` |
| RHEL 8 (UBI) | Debian 11 (Bullseye) | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.17.6-1` |
| RHEL 8 (UBI) | Debian 10 (Buster) | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.17.6-1` |
| RHEL 8 (UBI) | OpenWrt 23.05 | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.17.6-1` |
| RHEL 8 (UBI) | OpenWrt 22.03.5 | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.17.6-1` |
| RHEL 8 (UBI) | OpenWrt 21.02.7 | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.17.6-1` |
| RHEL 8 (UBI) | RHEL 9 (UBI) | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | Debian 12 (Bookworm) | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | Debian 11 (Bullseye) | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | OpenWrt 23.05 | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | OpenWrt 22.03.5 | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | OpenWrt 21.02.7 | Ansible Core 2.18 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | RHEL 9 (UBI) | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | Debian 12 (Bookworm) | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | Debian 11 (Bullseye) | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | Debian 10 (Buster) | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | OpenWrt 23.05 | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | OpenWrt 22.03.5 | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | OpenWrt 21.02.7 | Ansible Core 2.17 | `ansible-automation-platform/ee-minimal-rhel8:2.18.0-2` |
| RHEL 8 (UBI) | RHEL 9 (UBI) | Ansible Core 2.16 | `ansible-automation-platform/ee-minimal-rhel8:2.16.13-1` |
| RHEL 8 (UBI) | RHEL 8 (UBI) | Ansible Core 2.16 | `ansible-automation-platform/ee-minimal-rhel8:2.16.13-1` |
| RHEL 8 (UBI) | RHEL 7 (UBI) | Ansible Core 2.16 | `ansible-automation-platform/ee-minimal-rhel8:2.16.13-1` |
Expand Down
29 changes: 4 additions & 25 deletions molecule/default/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,10 @@
hosts: 'localhost'
gather_facts: false
tasks:

- name: 'Filter out platforms that are not compatible with the Ansible Core version being used'
ansible.builtin.set_fact:
molecule_yml: >-
{{
molecule_yml | ansible.builtin.combine(
{
'platforms':
(
molecule_yml.platforms |
selectattr('skip_versions', 'defined') |
length > 0
) | ansible.builtin.ternary(
molecule_yml.platforms |
selectattr('skip_versions', 'defined') |
rejectattr('skip_versions', 'contains', ansible_version.major ~ '.' ~ ansible_version.minor)
+
molecule_yml.platforms |
selectattr('skip_versions', 'undefined'),
molecule_yml.platforms
)
},
list_merge='replace'
)
}}
- name: 'Include tasks to filter incompatible platforms'
ansible.builtin.include_tasks:
file: 'tasks/filter_incompatible_platforms.yml'
run_once: true

- name: 'Set fact: Disable IPv6 via sysctl'
ansible.builtin.set_fact:
Expand Down
4 changes: 4 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ platforms:
groups:
- 'dnf'
skip_versions:
- '2.18'
- '2.17'

- name: 'rhel7-ubi'
Expand All @@ -38,6 +39,7 @@ platforms:
groups:
- 'yum'
skip_versions:
- '2.18'
- '2.17'

- name: 'debian12'
Expand All @@ -57,6 +59,8 @@ platforms:
image: 'docker.io/debian:10.13@sha256:58ce6f1271ae1c8a2006ff7d3e54e9874d839f573d8009c20154ad0f2fb0a225'
groups:
- 'apt'
skip_versions:
- '2.18'

- name: 'openwrt23.05'
# yamllint disable-line rule:line-length
Expand Down
69 changes: 47 additions & 22 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,58 @@
gather_facts: false

tasks:
- name: 'Update package lists'
ansible.builtin.raw: |
apt-get update
changed_when: true
- name: 'Include tasks to filter incompatible platforms'
ansible.builtin.include_tasks:
file: 'tasks/filter_incompatible_platforms.yml'
run_once: true

- name: 'Install Python'
ansible.builtin.raw: |
apt-get install -y python3
changed_when: true
- name: 'Block: Handle installation of python3 on Debian'
when: >-
inventory_hostname in molecule_yml.platforms |
map(attribute='name') |
ansible.builtin.flatten
block:
- name: 'Update package lists'
ansible.builtin.raw: |
apt-get update
changed_when: true

- name: 'Install Python'
ansible.builtin.raw: |
apt-get install -y python3
changed_when: true

- name: 'Bootstrap Python on OpenWrt'
hosts: 'opkg'
gather_facts: false
vars:
install_full_python: true
roles:
- role: 'sscheib.openwrt_bootstrap'
tasks:
- name: 'Include tasks to filter incompatible platforms'
ansible.builtin.include_tasks:
file: 'tasks/filter_incompatible_platforms.yml'
run_once: true

pre_tasks:
- name: 'Create opkg lock file directory'
ansible.builtin.raw: |
mkdir -p /var/lock
changed_when: true
- name: 'Block: Handle installation of python3 on Debian'
when: >-
inventory_hostname in molecule_yml.platforms |
map(attribute='name') |
ansible.builtin.flatten
block:

tasks:
- name: 'Install BASH and shadow-su'
ansible.builtin.raw: |
opkg install bash shadow-su
changed_when: true
- name: 'Create opkg lock file directory'
ansible.builtin.raw: |
mkdir -p /var/lock
changed_when: true

- name: 'Include role to bootstrap Python'
ansible.builtin.include_role:
name: 'sscheib.openwrt_bootstrap'
vars:
install_full_python: true

- name: 'Install BASH and shadow-su'
ansible.builtin.package:
name:
- 'bash'
- 'shadow-su'
state: 'present'
...
4 changes: 4 additions & 0 deletions molecule/default/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ collections:
- name: 'containers.podman'
version: '1.16.2'

# required to install packages in OpenWrt using community.general.opkg
- name: 'community.general'
version: '10.0.1'

roles:
- name: 'sscheib.openwrt_bootstrap'
version: 'v1.0.4'
Expand Down
27 changes: 27 additions & 0 deletions molecule/default/tasks/filter_incompatible_platforms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
- name: >-
filter_incompatible_platforms | Filter platforms that are not compatible with the Ansible Core version being used
ansible.builtin.set_fact:
molecule_yml: >-
{{
molecule_yml | ansible.builtin.combine(
{
'platforms':
(
molecule_yml.platforms |
selectattr('skip_versions', 'defined') |
length > 0
) | ansible.builtin.ternary(
molecule_yml.platforms |
selectattr('skip_versions', 'defined') |
rejectattr('skip_versions', 'contains', ansible_version.major ~ '.' ~ ansible_version.minor)
+
molecule_yml.platforms |
selectattr('skip_versions', 'undefined'),
molecule_yml.platforms
)
},
list_merge='replace'
)
}}
...

0 comments on commit c23e6fe

Please sign in to comment.