Skip to content

Commit

Permalink
Fix 'list' incompatibility with galaxy in ansible<2.10 (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
dseeley-sky authored Jul 7, 2021
1 parent 7f5ab23 commit 7caaf20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _dependencies/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
that: "(ansible_version.full is version('2.9.6', '>=') and ansible_version.full is version('2.10.6', '<=')) or ('community.aws' in galaxy_collections and galaxy_collections['community.aws'].version is version('1.5.0', '>='))"
fail_msg: "If Ansible > 2.9.6 then community.aws > 1.5.0 is required for valid community.aws.route53 support (by default in Ansible v4)."
vars:
_galaxy_lookup: "{{ lookup('pipe', 'ansible-galaxy collection list', errors='ignore') }}"
galaxy_collections: |-
{% set res = {} -%}
{%- for sub in (lookup('pipe', 'ansible-galaxy collection list')).split('\n') | map('trim') | map('regex_replace', '\\s+', ' ') -%}
{%- for sub in (_galaxy_lookup | ternary(_galaxy_lookup, '') | trim).split('\n') | map('trim') | map('regex_replace', '\\s+', ' ') | select | list -%}
{% set _ = res.update({sub.split(' ')[0]: {'version': sub.split(' ')[1]|default('')}}) -%}
{%- endfor %}
{{ res }}
Expand Down

0 comments on commit 7caaf20

Please sign in to comment.