I have playbook which deploy vitrual machine. I want delay run playbook until vm get ip-address. I try make loop but have error.
tasks:
- vsphere_guest:
vcenter_hostname: "{{ vcenter_hostname }}"
username: "{{ vcenter_user }}"
password: "{{ vcenter_pass }}"
guest: "{{ inventory_hostname }}"
vmware_guest_facts: yes
validate_certs: no
register: vsphere_facts
until: vsphere_facts.ansible_facts.hw_eth0.ipaddresses[0] = "192.168.250.*"
retries: 20
delay: 60
{"failed": true, "msg": "The conditional check 'vsphere_facts.ansible_facts.hw_eth0.ipaddresses[0] = \"192.168.250.\"' failed. The error was: template error while templating string: expected token 'end of statement block', got '='. String: {% if vsphere_facts.ansible_facts.hw_eth0.ipaddresses[0] = \"192.168.250.\" %} True {% else %} False {% endif %}"}
==
instead of=
... And this will not work because of*
. You need to usematch
filter. – Konstantin Suvorov==
working. Please, give an examplematch
or give an URL, as i don't could not find – Nikita