Skip to content

Commit

Permalink
try using _hosts string for lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
l3acon committed Aug 26, 2024
1 parent eafe79c commit 4ac3241
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
- name: Show hostnames we care about
ansible.builtin.debug:
msg: "About to {{ snapshot_operation }} snapshot(s) for the following hosts:
{{ lookup('ansible.builtin.inventory_hostnames', 'all') | split(',') | difference(['localhost'])}}"
{{ lookup('ansible.builtin.inventory_hostnames', _hosts) | split(',') | difference(['localhost'])}}"

- name: Manage snapshots based on operation
ansible.builtin.include_tasks:
file: "{{ snapshot_operation }}.yml"
loop: "{{ lookup('ansible.builtin.inventory_hostnames', 'all') | regex_replace(vm_namespace+'-', '') | split(',') | difference(['localhost']) }}"
loop: "{{ lookup('ansible.builtin.inventory_hostnames', _hosts) | regex_replace(vm_namespace+'-', '') | split(',') | difference(['localhost']) }}"

0 comments on commit 4ac3241

Please sign in to comment.