Skip to content

Commit 6541ad6

Browse files
Test maintained versions of ansible-core.
1 parent 6b09f1e commit 6541ad6

File tree

10 files changed

+137
-27
lines changed

10 files changed

+137
-27
lines changed

.ansible-lint

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Ansible managed
44
#
55
exclude_paths:
6+
- meta/preferences.yml
67
- molecule/default/prepare.yml
78
- molecule/default/converge.yml
89
- molecule/default/verify.yml

.github/workflows/molecule.yml

+57-8
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ jobs:
2121
uses: actions/checkout@v4
2222
- name: ansible-lint
2323
uses: ansible-community/ansible-lint-action@main
24-
test:
24+
25+
python-3-9:
2526
needs:
2627
- lint
2728
runs-on: ubuntu-20.04
29+
container:
30+
image: python:3.9
2831
strategy:
2932
fail-fast: false
3033
matrix:
@@ -33,8 +36,6 @@ jobs:
3336
tag: "latest"
3437
- image: "amazonlinux"
3538
tag: "latest"
36-
- image: "enterpriselinux"
37-
tag: "8"
3839
- image: "enterpriselinux"
3940
tag: "latest"
4041
- image: "debian"
@@ -47,8 +48,52 @@ jobs:
4748
tag: "latest"
4849
- image: "fedora"
4950
tag: "rawhide"
50-
- image: "opensuse"
51+
- image: "ubuntu"
52+
tag: "latest"
53+
- image: "ubuntu"
54+
tag: "jammy"
55+
- image: "ubuntu"
56+
tag: "focal"
57+
steps:
58+
- name: checkout
59+
uses: actions/checkout@v4
60+
61+
- name: molecule
62+
run: |
63+
apt-get update -qq
64+
apt-get -y -qq install yamllint docker.io
65+
pip install --no-cache-dir tox
66+
if [ -f tox.ini ] ; then tox ; fi
67+
if [ ! -f tox.ini ] ; then pip install -r requirements.yml ; pip install ansible-lint ansible-core ; molecule test ; fi
68+
env:
69+
image: ${{ matrix.config.image }}
70+
tag: ${{ matrix.config.tag }}
71+
python-3-10:
72+
needs:
73+
- lint
74+
runs-on: ubuntu-20.04
75+
container:
76+
image: python:3.10
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
config:
81+
- image: "alpine"
82+
tag: "latest"
83+
- image: "amazonlinux"
84+
tag: "latest"
85+
- image: "enterpriselinux"
86+
tag: "latest"
87+
- image: "debian"
5188
tag: "latest"
89+
- image: "debian"
90+
tag: "bullseye"
91+
- image: "fedora"
92+
tag: "39"
93+
- image: "fedora"
94+
tag: "latest"
95+
- image: "fedora"
96+
tag: "rawhide"
5297
- image: "ubuntu"
5398
tag: "latest"
5499
- image: "ubuntu"
@@ -58,10 +103,14 @@ jobs:
58103
steps:
59104
- name: checkout
60105
uses: actions/checkout@v4
61-
with:
62-
path: "${{ github.repository }}"
106+
63107
- name: molecule
64-
uses: robertdebock/[email protected]
65-
with:
108+
run: |
109+
apt-get update -qq
110+
apt-get -y -qq install yamllint docker.io
111+
pip install --no-cache-dir tox
112+
if [ -f tox.ini ] ; then tox ; fi
113+
if [ ! -f tox.ini ] ; then pip install -r requirements.yml ; pip install ansible-lint ansible-core ; molecule test ; fi
114+
env:
66115
image: ${{ matrix.config.image }}
67116
tag: ${{ matrix.config.tag }}

.gitlab-ci.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,53 @@
11
---
2-
image: "robertdebock/github-action-molecule:6.0.1"
32

43
variables:
5-
PY_COLORS: 1
4+
DEBIAN_FRONTEND: noninteractive
65

76
molecule:
7+
image: $python
88
script:
9+
- apt-get update -qq
10+
- apt-get -y -qq install yamllint docker.io
11+
- pip install --no-cache-dir tox
912
- if [ -f tox.ini ] ; then tox ; fi
10-
- if [ ! -f tox.ini ] ; then molecule test ; fi
13+
- if [ ! -f tox.ini ] ; then pip install -r requirements.yml ; pip install ansible-lint ansible-core ; molecule test ; fi
1114
rules:
1215
- if: $CI_COMMIT_REF_NAME == "master"
1316
parallel:
1417
matrix:
1518
- image: "alpine"
1619
tag: "latest"
20+
python: ['python:3.9', 'python:3.10']
1721
- image: "amazonlinux"
1822
tag: "latest"
19-
- image: "enterpriselinux"
20-
tag: "8"
23+
python: ['python:3.9', 'python:3.10']
2124
- image: "enterpriselinux"
2225
tag: "latest"
26+
python: ['python:3.9', 'python:3.10']
2327
- image: "debian"
2428
tag: "latest"
29+
python: ['python:3.9', 'python:3.10']
2530
- image: "debian"
2631
tag: "bullseye"
32+
python: ['python:3.9', 'python:3.10']
2733
- image: "fedora"
2834
tag: "39"
35+
python: ['python:3.9', 'python:3.10']
2936
- image: "fedora"
3037
tag: "latest"
38+
python: ['python:3.9', 'python:3.10']
3139
- image: "fedora"
3240
tag: "rawhide"
33-
- image: "opensuse"
34-
tag: "latest"
41+
python: ['python:3.9', 'python:3.10']
3542
- image: "ubuntu"
3643
tag: "latest"
44+
python: ['python:3.9', 'python:3.10']
3745
- image: "ubuntu"
3846
tag: "jammy"
47+
python: ['python:3.9', 'python:3.10']
3948
- image: "ubuntu"
4049
tag: "focal"
50+
python: ['python:3.9', 'python:3.10']
4151

4252
galaxy:
4353
script:

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,9 @@ This role has been tested on these [container images](https://hub.docker.com/u/r
205205
|---------|----|
206206
|[Alpine](https://hub.docker.com/r/robertdebock/alpine)|all|
207207
|[Amazon](https://hub.docker.com/r/robertdebock/amazonlinux)|Candidate|
208-
|[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|all|
208+
|[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|9|
209209
|[Debian](https://hub.docker.com/r/robertdebock/debian)|all|
210210
|[Fedora](https://hub.docker.com/r/robertdebock/fedora)|all|
211-
|[opensuse](https://hub.docker.com/r/robertdebock/opensuse)|all|
212211
|[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|all|
213212

214213
The minimum version of Ansible required is 2.12, tests have been done to:

meta/main.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,13 @@ galaxy_info:
1616
- Candidate
1717
- name: EL
1818
versions:
19-
- all
19+
- "9"
2020
- name: Debian
2121
versions:
2222
- all
2323
- name: Fedora
2424
versions:
2525
- all
26-
- name: opensuse
27-
versions:
28-
- all
2926
- name: Ubuntu
3027
versions:
3128
- all

meta/preferences.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
3+
matrix_overrides:
4+
amazonlinux:
5+
python:
6+
- python:3.9
7+
- python:3.10

molecule/default/molecule.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ platforms:
1818
image: "${namespace:-robertdebock}/${image:-fedora}:${tag:-latest}"
1919
command: /sbin/init
2020
volumes:
21-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
21+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
2222
privileged: true
2323
pre_build_image: true
2424
provisioner:

requirements.txt

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
ansible-compat == 4.*
2-
molecule == 6.*
3-
molecule-plugins[docker] == 23.*
4-
ansible-lint == 6.*
5-
paramiko == 3.*
1+
molecule
2+
molecule-plugins[docker]
3+
paramiko

requirements.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
roles:
33
- name: robertdebock.bootstrap
44
- name: robertdebock.cron
5+
collections:
56
- name: community.general

tox.ini

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[tox]
2+
envlist = ansible-2.{15,16,17}
3+
skipsdist = true
4+
5+
[testenv]
6+
commands = molecule test
7+
8+
setenv =
9+
TOX_ENVNAME={envname}
10+
PY_COLORS=1
11+
ANSIBLE_FORCE_COLOR=1
12+
ANSIBLE_ROLES_PATH=../
13+
14+
passenv = namespace, image, tag, DOCKER_HOST
15+
16+
# Test supported releases of ansible-core. See:
17+
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix
18+
19+
[testenv:ansible-2.15]
20+
basepython = python3.9
21+
deps =
22+
-rrequirements.txt
23+
ansible-core==2.15.*
24+
ansible-lint==6.*
25+
26+
[testenv:ansible-2.16]
27+
basepython = python3.10
28+
deps =
29+
-rrequirements.txt
30+
ansible-core==2.16.*
31+
ansible-lint==24.*
32+
33+
[testenv:ansible-2.17]
34+
basepython = python3.10
35+
deps =
36+
-rrequirements.txt
37+
ansible-core==2.17.*
38+
ansible-lint==24.*
39+
40+
# Future work, not releases, just prepared. See:
41+
# https://docs.ansible.com/ansible/devel//roadmap/ROADMAP_2_18.html
42+
# Note: enable python3.13 in `vars/main.yml` as well.
43+
# [testenv:ansible-2.18]
44+
# basepython = python3.13
45+
# deps =
46+
# -rrequirements.txt
47+
# ansible-core==2.18.*
48+
# ansible-lint==24.*

0 commit comments

Comments
 (0)