Hi, thank you, your suggestion works. 
I am wondering are this options documented some where? or how can I list 
this option for a module?
Ansible documentation is not covering all this options or I haven't been 
able to find it.  

here is a working code 
   - name: Wait till {{ target }} is powered off
     vsphere_guest:
      vcenter_hostname="{{ vcenter_server }}"
      username=ansible@local.domain
      password="{{ vc_passwd }}"
      guest="{{ ansible_hostname }}"
      validate_certs=False
      vmware_guest_facts=yes
     register: vm_state
     until: vm_state.ansible_facts.hw_power_status == 'POWERED OFF'
     retries: 10
     delay: 5
     delegate_to: localhost

  
Best regards


On Tuesday, April 10, 2018 at 9:09:42 PM UTC+2, robert sanders wrote:
>
> change result to vm_state if youre using vsphere_guest
>
> register: vm_state
>       until: vm_state.ansible_facts.hw_power_status == 'POWERED OFF'
>       retries: 10
>       delay: 5
>
> On Wednesday, April 4, 2018 at 9:34:32 AM UTC-4, Zeljko Dokman wrote:
>>
>> Hi, I am trying to use this code to check VM power state and its failing 
>> for me with this error..
>>
>>  "msg": "The conditional check 'result.hw_power_status == \"POWERED 
>> OFF\"' failed. The error was: error while evaluating conditional 
>> (result.hw_power_status == \"POWERED OFF\"): 'dict object' has no attribute 
>> 'hw_power_status'"
>>
>> My playbook..
>> Enter code here...   - name: Wait till {{ target }} is powered off
>>      vsphere_guest:
>>       vcenter_hostname="{{ vcenter_server }}"
>>       username=ansible@mbu.local
>>       password="{{ vc_passwd }}"
>>       guest=mbu-zabbix-ccp
>>       validate_certs=False
>>       vmware_guest_facts=yes
>>      register: result
>>      until: result.hw_power_status == "POWERED OFF"
>>      retries: 10
>>      delay: 5
>>
>> i tried with 
>> result.hw_power_status == "POWERED OFF"
>> and
>> result.ansible_facts.hw_power_status == "POWERED OFF"
>>
>> both fail with a same error..
>>
>> Regards 
>>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/bc04c776-0dff-4ab4-a1ab-c9021ff1e4ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to