dev-sec / ansible-collection-hardening

This Ansible collection provides battle tested hardening for Linux, SSH, nginx, MySQL
http://dev-sec.io/
Apache License 2.0
3.94k stars 725 forks source link

Test multiple supported Ansible versions #729

Open schurzi opened 9 months ago

schurzi commented 9 months ago

Description

Currently we use the most recent Ansible version to run our tests. But our collection supports also older Ansible releases. To make sure we stay compatible, we need to add tests for the older Ansible versions. Since we already have a lot of tests, we should keep this to a minimum.

Solution

We have no clear solution to this.

Alternatives

Running our Playbooks without executing them against a specific host should cover a lot of possible issues. So using ansible-lint or something similar pinned to a specific Ansible version in a matrix build could be a good way to do this.

Additional information

No response

dlouzan commented 8 months ago

@schurzi As a hint, we currently address this internally with a combination of poetry, tox and https://github.com/enpaul/tox-poetry-installer.

/cc @nejch

nejch commented 8 months ago

Since poetry is not used here, even plain tox could do this and install different versions based on the tox environment.

Recently, hatch has also become more popular for python projects and supports tox-like environments (https://hatch.pypa.io/latest/environment/#dependencies).