From f2d7ebb501d5393170e98f3ccafd51b4f15b76aa Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 27 Aug 2024 12:39:56 -0600 Subject: [PATCH] changes from jce --- .../demo/openshift/roles/snapshot/tasks/main.yml | 6 +++--- openshift/cnv/snapshot.yml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/collections/ansible_collections/demo/openshift/roles/snapshot/tasks/main.yml b/collections/ansible_collections/demo/openshift/roles/snapshot/tasks/main.yml index 8995bc24b..bc0eeadb7 100644 --- a/collections/ansible_collections/demo/openshift/roles/snapshot/tasks/main.yml +++ b/collections/ansible_collections/demo/openshift/roles/snapshot/tasks/main.yml @@ -1,12 +1,12 @@ --- -# paameters +# parameters # snapshot_opeation: - 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', _hosts) | split(',') | difference(['localhost'])}}" +{{ lookup('ansible.builtin.inventory_hostnames', snapshot_hosts) | split(',') | difference(['localhost'])}}" - name: Manage snapshots based on operation ansible.builtin.include_tasks: file: "{{ snapshot_operation }}.yml" - loop: "{{ lookup('ansible.builtin.inventory_hostnames', _hosts) | regex_replace(vm_namespace+'-', '') | split(',') | difference(['localhost']) }}" + loop: "{{ lookup('ansible.builtin.inventory_hostnames', snapshot_hosts) | regex_replace(vm_namespace+'-', '') | split(',') | difference(['localhost']) }}" diff --git a/openshift/cnv/snapshot.yml b/openshift/cnv/snapshot.yml index c0c624586..fb5cc55ca 100644 --- a/openshift/cnv/snapshot.yml +++ b/openshift/cnv/snapshot.yml @@ -5,3 +5,5 @@ - name: Include snapshot role ansible.builtin.include_role: name: "demo.openshift.snapshot" + vars: + snapshot_hosts: "{{ _hosts }}"