Hi Kai, 

thank you, this works for me (with a very small modification:
  - name: wait till {{ template }} is powered off
    vsphere_guest: 
      vcenter_hostname: "{{vcenter}}"
      username: "{{user}}"
      password: "{{passw}}"
      guest: "{{template}}"
      validate_certs: False
      vmware_guest_facts: yes
    register: result 
    until: result.ansible_facts.hw_power_status == "POWERED OFF" 
    retries: 10 
    delay: 5 
 ). 

Mathias

On Friday, November 11, 2016 at 5:40:55 PM UTC+1, Kai Stian Olstad wrote:
>
>
> Something like this. 
>
> - name: Check if {{ template }} is down 
>    vsphere_guest: 
>      vcenter_hostname: "{{ vcenter }}" 
>      username: "{{ user }}" 
>      password: "{{ pass }}" 
>      guest: "{{ template }}" 
>      vmware_guest_facts: yes 
>    register:  result 
>    until: result.hw_power_status == "POWERED OFF" 
>    reties: 10 
>    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/2ce8ed46-57e6-461b-bb8a-c68802e5d6e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to