On 27. okt. 2016 21:05, Nitin Mathur wrote:
On Monday, April 4, 2016 at 6:05:15 AM UTC-7, Rob Verduijn wrote:
Hello,
When shutting down a kvm guest using the task
- name: shut down kvm guest
virt: name=kvm-guest state=shutdown
Ansible will continue when the virsh shutdown kvm-guest command is
finished.
However I want it to wait for the guest to actually finnish the shutdown
procedure.
Anybody who knows how to do this ?
>
> Were you able to figure this out? Or any suggestions??
You can use a do until loop
https://docs.ansible.com/ansible/playbooks_loops.html#do-until-loops
- action: virt name=kvm-guest command=status
register: result
until: result.status.find("shutdown") != -1
retries: 30
delay: 5
--
Kai Stian Olstad
--
You received this message because you are subscribed to the Google Groups "Ansible
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/316542a3-7393-2c18-f84e-b5e42843fbbe%40olstad.com.
For more options, visit https://groups.google.com/d/optout.