Skip to content

Commit

Permalink
fix(molecule): skip testing eol ansible versions on incompatible distros
Browse files Browse the repository at this point in the history
Signed-off-by: gardar <[email protected]>
  • Loading branch information
gardar committed Sep 16, 2024
1 parent 7be1f09 commit c5e4858
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .config/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ warn_list:
- name[casing] # https://github.com/ansible/ansible-lint/issues/4035#issuecomment-2116272270
skip_list:
- var-naming[no-role-prefix] # https://github.com/ansible/ansible-lint/pull/3422#issuecomment-1549584988
exclude_paths:
- .cache
- .config/molecule/converge.yml
17 changes: 17 additions & 0 deletions .config/molecule/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,20 @@ verifier:
provisioner:
playbooks:
converge: "${MOLECULE_PROJECT_DIRECTORY}/../../.config/molecule/converge.yml"
inventory:
host_vars:
fedora-39:
exclude_ansible_vers:
- "2.9"
- "2.10"
- "2.11"
fedora-40:
exclude_ansible_vers:
- "2.9"
- "2.10"
- "2.11"
ubuntu-24.04:
exclude_ansible_vers:
- "2.9"
- "2.10"
- "2.11"
17 changes: 16 additions & 1 deletion .config/molecule/converge.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
---
- name: Converge
hosts: all
hosts: >-
{{
groups['all']
| map('extract', hostvars)
| rejectattr('exclude_ansible_vers', 'defined')
| map(attribute='inventory_hostname')
| list
| union(
groups['all']
| map('extract', hostvars)
| selectattr('exclude_ansible_vers', 'defined')
| rejectattr('exclude_ansible_vers', 'search', ansible_version.major ~ '.' ~ ansible_version.minor)
| map(attribute='inventory_hostname')
| list
)
}}
any_errors_fatal: true
tasks:
- name: "Run role"
Expand Down

0 comments on commit c5e4858

Please sign in to comment.