Tox reintroduced.

This commit is contained in:
Robert de Bock 2024-07-20 08:10:10 +02:00
parent d9fa8aa593
commit 66bab3efda
3 changed files with 60 additions and 43 deletions

View File

@ -1,5 +1,3 @@
ansible-compat == 24.*
molecule == 24.*
molecule-plugins[docker] == 23.*
ansible-lint == 24.*
paramiko == 3.*
molecule
molecule-plugins[docker]
paramiko

View File

@ -141,21 +141,19 @@
mode: "0644"
when:
- generate_ansible_lint
# Since May 2024, tox stopped working, throwing this error:
# CRITICAL Unable to contact the Docker daemon. Please refer to https://docs.docker.com/config/daemon/ for managing the daemon
# It's disabled for now.
# - name: Render file tox.ini
# ansible.builtin.template:
# src: "{{ playbook_dir }}/templates/tox.ini.j2"
# dest: "{{ role_path }}/tox.ini"
# mode: "0644"
# when:
# - generate_tox
- name: Remove tox.ini
ansible.builtin.file:
path: "{{ role_path }}/tox.ini"
state: absent
- name: Render file tox.ini
ansible.builtin.template:
src: "{{ playbook_dir }}/templates/tox.ini.j2"
dest: "{{ role_path }}/tox.ini"
mode: "0644"
when:
- generate_tox
# - name: Remove tox.ini
# ansible.builtin.file:
# path: "{{ role_path }}/tox.ini"
# state: absent
- name: Render file .github/settings.yml
ansible.builtin.template:

View File

@ -1,35 +1,56 @@
{{ ansible_managed | comment }}
[tox]
minversion = 4.2.4
{% if tox_ansible_versions is defined %}
envlist = py3-ansible{% raw %}{{% endraw %}{% for version in tox_ansible_versions %}{{ version }}{% if not loop.last %},{% endif %}{% endfor %}{% raw %}}{% endraw %}
{% else %}
envlist = py3-ansible{8,9,10}
{% endif %}
envlist = ansible-2.{12,13,14,15,16,17}
skipsdist = true
[testenv]
deps =
-rrequirements.txt
ansible8: ansible == 8.*
ansible9: ansible == 9.*
ansible10: ansible == 10.*
commands = molecule test
setenv =
TOX_ENVNAME={envname}
PY_COLORS=1
ANSIBLE_FORCE_COLOR=1
ANSIBLE_ROLES_PATH=../
passenv =
namespace
image
tag
DOCKER_HOST
{% if github_variables_mapping is defined %}
{% for item in github_variables_mapping %}
{{ item.variable }}
{% endfor %}
{% endif %}
passenv = namespace, image, tag, DOCKER_HOST
[testenv:ansible-2.12]
basepython = python3.8
deps =
-rrequirements.txt
ansible-core==2.12.*
ansible-lint==5.*
[testenv:ansible-2.13]
basepython = python3.8
deps =
-rrequirements.txt
ansible-core==2.13.*
ansible-lint==5.*
[testenv:ansible-2.14]
basepython = python3.9
deps =
-rrequirements.txt
ansible-core==2.14.*
ansible-lint==6.*
[testenv:ansible-2.15]
basepython = python3.9
deps =
-rrequirements.txt
ansible-core==2.15.*
ansible-lint==6.*
[testenv:ansible-2.16]
basepython = python3.10
deps =
-rrequirements.txt
ansible-core==2.16.*
ansible-lint==24.*
[testenv:ansible-2.17]
basepython = python3.10
deps =
-rrequirements.txt
ansible-core==2.17.*
ansible-lint==24.*