CI: Use 2025.02 test images, keeping same OS releases

centos8-test:2025.02 no longer has a /usr/bin/python installed, so use
centos8-py3 target which sets `ansible_python_interpreter=/usr/bin/python3` in
the templated inventory.

Ansible <= 9 (ansible-core <= 2.6) now discover the interpreter as
/usr/bin/python3 on debian11-test:2025.02, as opposed to
/usr/bin/python3.9 on debian11-test:2021. I'm don't know the exact
cause. From manual tests the change in observed behaviour appears to be common to
vanilla Ansible (strategy=linear) and Mitogen flavour
(strategy=mitogen_linear).

```console
(ans9) ➜  mitogen git:(4efb7158) ✗ ANSIBLE_STRATEGY=mitogen_linear ANSIBLE_STRATEGY_PLUGINS=ansible_mitogen/plugins/strategy ans9/bin/ansible -e ansible_python_interpreter=auto -mping d11.lan
d11.lan | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}
(ans9) ➜  mitogen git:(4efb7158) ✗ ans9/bin/ansible -e ansible_python_interpreter=auto -mping d11.lan
d11.lan | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}
```

Update some tests which assume `/usr/bin/python` exists or that `env python`
will resolve successfully.
pull/1372/head
Alex Willmer 1 week ago
parent 7eabcc61c1
commit 9609437262

@ -34,12 +34,12 @@ ANSIBLE_TESTS_HOSTS_DIR = os.path.join(GIT_ROOT, 'tests/ansible/hosts')
ANSIBLE_TESTS_TEMPLATES_DIR = os.path.join(GIT_ROOT, 'tests/ansible/templates')
DISTRO_SPECS = os.environ.get(
'MITOGEN_TEST_DISTRO_SPECS',
'centos6 centos8 debian9 debian11 ubuntu1604 ubuntu2004',
'centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004',
)
IMAGE_PREP_DIR = os.path.join(GIT_ROOT, 'tests/image_prep')
IMAGE_TEMPLATE = os.environ.get(
'MITOGEN_TEST_IMAGE_TEMPLATE',
'ghcr.io/mitogen-hq/%(distro)s-test:2021',
'ghcr.io/mitogen-hq/%(distro)s-test:2025.02',
)
SUDOERS_DEFAULTS_SRC = './tests/image_prep/files/sudoers_defaults'
SUDOERS_DEFAULTS_DEST = '/etc/sudoers.d/mitogen_test_defaults'
@ -231,7 +231,7 @@ def container_specs(
[{'distro': 'debian11',
'family': 'debian',
'hostname': 'localhost',
'image': 'ghcr.io/mitogen-hq/debian11-test:2021',
'image': 'ghcr.io/mitogen-hq/debian11-test:2025.02',
'index': 1,
'name': 'target-debian11-1',
'port': 2201,
@ -239,7 +239,7 @@ def container_specs(
{'distro': 'centos6',
'family': 'centos',
'hostname': 'localhost',
'image': 'ghcr.io/mitogen-hq/centos6-test:2021',
'image': 'ghcr.io/mitogen-hq/centos6-test:2025.02',
'index': 2,
'name': 'target-centos6-2',
'port': 2202,

@ -21,6 +21,8 @@ To avail of fixes in an unreleased version, please download a ZIP file
In progress (unreleased)
------------------------
* :gh:issue:`1118` CI: Use 2025.02 test images, keeping same OS releases
v0.3.33 (2025-11-22)
--------------------

@ -13,7 +13,7 @@
debian:
'9': /usr/bin/python
'10': /usr/bin/python3
'11': /usr/bin/python
'11': /usr/bin/python3
'NA': /usr/bin/python # Debian 11, Ansible <= 7 (ansible-core <= 2.14)
'bullseye/sid': /usr/bin/python # Debian 11, Ansible 8 - 9 (ansible-core 2.15 - 2.16)
ubuntu:
@ -29,7 +29,7 @@
debian:
'9': /usr/bin/python
'10': /usr/bin/python3
'11': /usr/bin/python3.9
'11': /usr/bin/python3
'NA': /usr/bin/python3.9 # Debian 11, Ansible <= 7 (ansible-core <= 2.14)
'bullseye/sid': /usr/bin/python3.9 # Debian 11, Ansible 8 - 9 (ansible-core 2.15 - 2.16)
ubuntu:

@ -8,9 +8,12 @@
- name: regression/issue_122__environment_difference.yml
hosts: test-targets
tasks:
- script: scripts/print_env.py
register: env
- debug: msg={{env}}
- name: Run print_env.py
script:
cmd: scripts/print_env.py
executable: "{{ ansible_python_interpreter | default(ansible_facts.discovered_interpreter_python) }}"
register: print_env_result
- debug:
var: print_env_result
tags:
- issue_122

@ -53,11 +53,11 @@ LOG = logging.getLogger(__name__)
DISTRO_SPECS = os.environ.get(
'MITOGEN_TEST_DISTRO_SPECS',
'centos6 centos8 debian9 debian11 ubuntu1604 ubuntu2004',
'centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004',
)
IMAGE_TEMPLATE = os.environ.get(
'MITOGEN_TEST_IMAGE_TEMPLATE',
'ghcr.io/mitogen-hq/%(distro)s-test:2021',
'ghcr.io/mitogen-hq/%(distro)s-test:2025.02',
)
TESTS_DIR = os.path.join(os.path.dirname(__file__))

@ -123,10 +123,11 @@ setenv =
ans{2.10,3,4,5}: ANSIBLE_STDOUT_CALLBACK=yaml
# Print warning on the first occurence at each module:linenno in Mitogen. Available Python 2.7, 3.2+.
PYTHONWARNINGS=default:::ansible_mitogen,default:::mitogen
ans{2.10,3,4,5}: MITOGEN_TEST_DISTRO_SPECS=centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004
# Ansible 6 - 8 (ansible-core 2.13 - 2.15) require Python 2.7 or >= 3.5 on targets
ans{6,7,8}: MITOGEN_TEST_DISTRO_SPECS=centos7 centos8 debian9 debian10 debian11 ubuntu1604 ubuntu1804 ubuntu2004
ans{6,7,8}: MITOGEN_TEST_DISTRO_SPECS=centos7 centos8-py3 debian9 debian10 debian11 ubuntu1604 ubuntu1804 ubuntu2004
# Ansible 9 (ansible-core 2.16) requires Python 2.7 or >= 3.6 on targets
ans9: MITOGEN_TEST_DISTRO_SPECS=centos7 centos8 debian9 debian10 debian11 ubuntu1804 ubuntu2004
ans9: MITOGEN_TEST_DISTRO_SPECS=centos7 centos8-py3 debian9 debian10 debian11 ubuntu1804 ubuntu2004
# Ansible 10 (ansible-core 2.17) requires Python >= 3.7 on targets
ans10: MITOGEN_TEST_DISTRO_SPECS=debian10-py3 debian11-py3 ubuntu2004-py3
# Ansible 11 (ansible-core 2.18) requires Python >= 3.8 on targets
@ -134,11 +135,11 @@ setenv =
ans12: MITOGEN_TEST_DISTRO_SPECS=debian11-py3 ubuntu2004-py3
# Ansible 13 (ansible-core 2.20) requires Python >= 3.9 on targets
ans13: MITOGEN_TEST_DISTRO_SPECS=debian11-py3
distros_centos: MITOGEN_TEST_DISTRO_SPECS=centos6 centos7 centos8
distros_centos: MITOGEN_TEST_DISTRO_SPECS=centos6 centos7 centos8-py3
distros_centos5: MITOGEN_TEST_DISTRO_SPECS=centos5
distros_centos6: MITOGEN_TEST_DISTRO_SPECS=centos6
distros_centos7: MITOGEN_TEST_DISTRO_SPECS=centos7
distros_centos8: MITOGEN_TEST_DISTRO_SPECS=centos8
distros_centos8: MITOGEN_TEST_DISTRO_SPECS=centos8-py3
distros_debian: MITOGEN_TEST_DISTRO_SPECS=debian9 debian10 debian11
distros_debian9: MITOGEN_TEST_DISTRO_SPECS=debian9
distros_debian10: MITOGEN_TEST_DISTRO_SPECS=debian10

Loading…
Cancel
Save