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
molecule == 24.* molecule-plugins[docker]
molecule-plugins[docker] == 23.* paramiko
ansible-lint == 24.*
paramiko == 3.*

View File

@ -141,21 +141,19 @@
mode: "0644" mode: "0644"
when: when:
- generate_ansible_lint - 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 - name: Render file tox.ini
ansible.builtin.file: ansible.builtin.template:
path: "{{ role_path }}/tox.ini" src: "{{ playbook_dir }}/templates/tox.ini.j2"
state: absent 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 - name: Render file .github/settings.yml
ansible.builtin.template: ansible.builtin.template:

View File

@ -1,35 +1,56 @@
{{ ansible_managed | comment }}
[tox] [tox]
minversion = 4.2.4 envlist = ansible-2.{12,13,14,15,16,17}
{% 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 %}
skipsdist = true skipsdist = true
[testenv] [testenv]
deps =
-rrequirements.txt
ansible8: ansible == 8.*
ansible9: ansible == 9.*
ansible10: ansible == 10.*
commands = molecule test commands = molecule test
setenv = setenv =
TOX_ENVNAME={envname} TOX_ENVNAME={envname}
PY_COLORS=1 PY_COLORS=1
ANSIBLE_FORCE_COLOR=1 ANSIBLE_FORCE_COLOR=1
ANSIBLE_ROLES_PATH=../ ANSIBLE_ROLES_PATH=../
passenv = passenv = namespace, image, tag, DOCKER_HOST
namespace
image [testenv:ansible-2.12]
tag basepython = python3.8
DOCKER_HOST deps =
{% if github_variables_mapping is defined %} -rrequirements.txt
{% for item in github_variables_mapping %} ansible-core==2.12.*
{{ item.variable }} ansible-lint==5.*
{% endfor %}
{% endif %} [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.*