From 54ce042c5869613408e72925c218da6a4cdd4f43 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Mon, 11 Jul 2022 11:27:50 +0000 Subject: [PATCH] Move all virsh commands to be run on vmhost --- playbooks/include/deploy-kvm-guest.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/playbooks/include/deploy-kvm-guest.yml b/playbooks/include/deploy-kvm-guest.yml index 2e528b5..94cc48e 100644 --- a/playbooks/include/deploy-kvm-guest.yml +++ b/playbooks/include/deploy-kvm-guest.yml @@ -103,14 +103,13 @@ - name: wait for install to finish virt: - uri: "{{ vmhost_uri }}" name: "{{ inventory_hostname }}" command: status register: vmstatus until: vmstatus.status == "shutdown" retries: 1000 delay: 20 - delegate_to: localhost + delegate_to: "{{ vmhost }}" when: inventory_hostname not in result.list_vms - name: clean tempdir @@ -122,10 +121,9 @@ - name: start vm virt: - uri: "{{ vmhost_uri }}" name: "{{ inventory_hostname }}" command: start - delegate_to: localhost + delegate_to: "{{ vmhost }}" when: inventory_hostname not in result.list_vms - name: wait for ssh to start