ci: Use highest supported Ansible version during image prep

It was necessary to split setup.yml because there is no common subset of
supported include/import keywords across Ansible 2.3 - 2.11. The yaml stdout
callback is unavailabe in Ansible 2.3.
pull/1254/head
Alex Willmer 2 weeks ago
parent 22e7046cf6
commit 01e24f9ddf

@ -3,11 +3,6 @@
strategy: mitogen_free
gather_facts: false
tasks:
- name: Fetch container images
docker_image:
name: "{{ docker_base }}"
delegate_to: localhost
- name: Start containers
docker_container:
name: "{{ inventory_hostname }}"

@ -16,7 +16,7 @@
pre_tasks:
- meta: end_play
when:
- ansible_facts.virtualization_type != "docker"
- ansible_virtualization_type != "docker"
roles:
- role: package_manager

@ -5,6 +5,7 @@ any_errors_fatal = true
callback_result_format = yaml
deprecation_warnings = false
duplicate_dict_key = error
inventory = hosts.ini
strategy_plugins = ../../ansible_mitogen/plugins/strategy
retry_files_enabled = false
display_args_to_stdout = True

@ -21,3 +21,23 @@ debian11
ubuntu1604
ubuntu1804
ubuntu2004
[ansible_2_3]
# Python 2.4 on targets
centos5
[ansible_5]
# Python 2.6 on targets
centos6
[ansible_9]
# Python 2.7 and/or 3.6 on targets
centos7
centos8
debian9
debian10
ubuntu1804
[ansible_11]
# Python >= 3.8 on targets
debian11

@ -1,6 +1,17 @@
#!/usr/bin/env ansible-playbook
- include_playbook: _container_create.yml
- include_playbook: _container_setup.yml
- include_playbook: _user_accounts.yml
- include_playbook: _container_finalize.yml
- name: Get base images
hosts: all
# strategy: mitogen_free
gather_facts: false
tasks:
- name: Fetch container base images
docker_image:
name: "{{ docker_base }}"
source: pull # Added in Ansible 2.8, required circa 2.12
delegate_to: localhost
- import_playbook: _container_create.yml
- import_playbook: _container_setup.yml
- import_playbook: _user_accounts.yml
- import_playbook: _container_finalize.yml

@ -0,0 +1,15 @@
#!/usr/bin/env ansible-playbook
- name: Get base images
hosts: all
gather_facts: false
tasks:
- name: Fetch container base images
docker_image:
name: "{{ docker_base }}"
delegate_to: localhost
- include: _container_create.yml
- include: _container_setup.yml
- include: _user_accounts.yml
- include: _container_finalize.yml

@ -1,7 +1,9 @@
[tox]
envlist =
ansible2.3,
ansible2.10,
ansible5
ansible9
ansible11
skipsdist = true
[testenv]
@ -13,17 +15,47 @@ basepython = python2
deps =
ansible>=2.3,<2.4
docker-py>=1.7.0
mitogen>=0.2.10rc1,<0.3
mitogen~=0.2.0
install_command =
python -m pip --no-python-version-warning install {opts} {packages}
commands =
./setup.yml -i hosts.ini -l 'localhost,centos5' {posargs}
ansible-playbook -l 'localhost,ansible_2_3' setup_ansible2.3.yml
[testenv:ansible2.10]
[testenv:ansible5]
basepython = python3
deps =
ansible>=2.10,<2.11
ansible~=5.0
docker>=1.8.0
mitogen>=0.3.0rc1,<0.4
mitogen~=0.3.0
passlib
setenv =
ANSIBLE_PYTHON_INTERPRETER=auto_silent
ANSIBLE_STDOUT_CALLBACK=yaml
commands =
ansible-playbook -l 'localhost,ansible_5' setup.yml
[testenv:ansible9]
basepython = python3
deps =
ansible~=9.0
docker>=1.8.0
mitogen~=0.3.0
passlib
setenv =
ANSIBLE_PYTHON_INTERPRETER=auto_silent
ANSIBLE_STDOUT_CALLBACK=yaml
commands =
ansible-playbook -l 'localhost,ansible_9' setup.yml
[testenv:ansible11]
basepython = python3
deps =
ansible~=11.0
docker>=1.8.0
mitogen~=0.3.0
passlib
setenv =
ANSIBLE_PYTHON_INTERPRETER=auto_silent
ANSIBLE_STDOUT_CALLBACK=yaml
commands =
./setup.yml -i hosts.ini -l '!centos5' {posargs}
ansible-playbook -l 'localhost,ansible_11' setup.yml

@ -6,8 +6,8 @@
# Py A cntrllr A target coverage Django Jinja2 pip psutil pytest tox virtualenv
# ==== ========== ========== ========== ========== ========== ========== ========== ========== ========== ==========
# 2.4 2.3? <= 3.7.1 <= 1.3.7 <= 1.1 <= 2.1.3 <= 1.4 <= 1.8
# 2.5 <= 3.7.1 <= 1.4.22 <= 1.3.1 <= 2.1.3 <= 2.8.7 <= 1.6.1 <= 1.9.1
# 2.4 <= 2.3³ <= 3.7.1 <= 1.3.7 <= 1.1 <= 2.1.3 <= 1.4 <= 1.8
# 2.5 <= 2.3³ <= 3.7.1 <= 1.4.22 <= 1.3.1 <= 2.1.3 <= 2.8.7 <= 1.6.1 <= 1.9.1
# 2.6 <= 2.6.20 <= 2.12 <= 4.5.4 <= 1.6.11 <= 2.10.3 <= 9.0.3 <= 5.9.0 <= 3.2.5 <= 2.9.1 <= 15.2.0
# 2.7 <= 2.11 <= 2.16 <= 5.5 <= 1.11.29 <= 2.11.3 <= 20 <= 4.6.11 <= 3.28 <= 20.15²
# 3.5 <= 2.11 <= 2.15 <= 5.5 <= 2.2.28 <= 2.11.3 <= 20 <= 5.9.5 <= 6.1.0 <= 3.28 <= 20.15²
@ -35,6 +35,8 @@
# Virtualenv <= 20.21.1 supports creating virtualenvs with any *target* Python.
# Virtualenv >= 20.22 supports creating virtualenvs with target Python >= 3.7.
# https://virtualenv.pypa.io/en/latest/#compatibility
#
# 3. https://docs.ansible.com/ansible/2.7/dev_guide/developing_python_3.html#minimum-version-of-python-3-x-and-python-2-x
# Ansible Dependency
# ================== ======================

Loading…
Cancel
Save