Skip to content

Commit

Permalink
plugin-scan - use explicit collection requirements
Browse files Browse the repository at this point in the history
Install the collections from meta/collection-requirements.yml
and tests/collection-requirements.yml to override those found
in the `ansible` bundle.  We have to use an old ansible to
maintain compatability with jinja 2.7 and the collections
bundled there are not updated with newer versions of
ansible.posix, community.general, etc.

At some point when we drop compatability with EL7 and python2,
we can drop support for jinja 2.7 and use the latest ansible.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
  • Loading branch information
richm committed Oct 10, 2023
1 parent 1163bbf commit 96d6f68
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/tox_lsr/config_files/tox-default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,17 @@ allowlist_externals =
deps =
ansible==6.*
jinja2==2.7.* ; python_version <= "3.7"
setenv =
ANSIBLE_COLLECTIONS_PATHS = {envdir}
commands =
curl -L -o {envdir}/report-modules-plugins.py https://raw.githubusercontent.com/linux-system-roles/auto-maintenance/master/report-modules-plugins.py
bash -c '\
set -euxo pipefail; \
for file in meta/collection-requirements.yml tests/collection-requirements.yml; do \
if [ -f "$file" ]; then \
ansible-galaxy collection install -vv --force -r "$file"; \
fi; \
done'
python {env:LSR_REPORT_MODULES_PLUGINS:{envdir}/report-modules-plugins.py} \
{env:RUN_PLUGIN_SCAN_EXTRA_ARGS:} --details {posargs} .

Expand Down
8 changes: 8 additions & 0 deletions tests/fixtures/test_tox_merge_ini/result.ini
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,15 @@ allowlist_externals = curl
bash
deps = ansible==6.*
jinja2==2.7.* ; python_version <= "3.7"
setenv = ANSIBLE_COLLECTIONS_PATHS = {envdir}
commands = curl -L -o {envdir}/report-modules-plugins.py https://raw.githubusercontent.com/linux-system-roles/auto-maintenance/master/report-modules-plugins.py
bash -c '\
set -euxo pipefail; \
for file in meta/collection-requirements.yml tests/collection-requirements.yml; do \
if [ -f "$file" ]; then \
ansible-galaxy collection install -vv --force -r "$file"; \
fi; \
done'
python {env:LSR_REPORT_MODULES_PLUGINS:{envdir}/report-modules-plugins.py} \
{env:RUN_PLUGIN_SCAN_EXTRA_ARGS:} --details {posargs} .

Expand Down

0 comments on commit 96d6f68

Please sign in to comment.