From 6a94cbdbc776c7817db0dafeb7442360f5d7ae17 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Fri, 27 Jun 2014 20:08:54 +0000 Subject: [PATCH] Set vms to autostart when installed. Tweak timeouts. --- tasks/virt_instance_create.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tasks/virt_instance_create.yml b/tasks/virt_instance_create.yml index 70999d6734..d970922206 100644 --- a/tasks/virt_instance_create.yml +++ b/tasks/virt_instance_create.yml @@ -22,8 +22,8 @@ # this just keeps checking the domstate until it stops running shell: while `/usr/bin/virsh domstate {{ inventory_hostname }} | grep -q running` ; do sleep 10; done delegate_to: "{{ vmhost }}" - async: 1200 - poll: 10 + async: 1500 + poll: 15 when: inventory_hostname not in result.list_vms - name: start the vm up @@ -31,9 +31,11 @@ delegate_to: "{{ vmhost }}" when: inventory_hostname not in result.list_vms +- name: set it to autostart + action: virt command=autostart name={{ inventory_hostname }} + delegate_to: "{{ vmhost }}" + when: inventory_hostname not in result.list_vms + - name: wait for ssh on the vm to start back local_action: wait_for delay=10 host={{ inventory_hostname }} port=22 state=started timeout=1200 when: inventory_hostname not in result.list_vms - - -