From 570d4c76d8bf4435b5af0131a99cb7af83d711f9 Mon Sep 17 00:00:00 2001 From: Rick Elrod Date: Wed, 3 Oct 2018 03:34:03 +0000 Subject: [PATCH] do some magic to get it to see the post-reboot vms as a group Signed-off-by: Rick Elrod --- playbooks/vhost_reboot.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/playbooks/vhost_reboot.yml b/playbooks/vhost_reboot.yml index 2d013fcdb3..3974a7486d 100644 --- a/playbooks/vhost_reboot.yml +++ b/playbooks/vhost_reboot.yml @@ -94,6 +94,10 @@ virt: command=list_vms register: newvmlist + - name: add them to myvms_postreboot group + local_action: add_host hostname={{ item }} groupname=myvms_postreboot + with_items: "{{ newvmlist.list_vms }}" + - name: sync time command: ntpdate -u 1.rhel.pool.ntp.org @@ -108,7 +112,7 @@ when: nonagios is not defined or not nonagios - name: post reboot tasks - hosts: newvmlist + hosts: myvms_postreboot user: root gather_facts: False serial: 1