hi All,

my playbook is asking for creating a new virtual machine.
the only thing I know about this virtual machine is its group name that 
will be added to the inventory host file later (I don't know its IP 
address).
while this virtual machine is been created and been added to the inventory 
file, my playbook is waiting for it to happen.
after this new virtual machine is been added, my playbook continues running.

I tried implementing this behavior with no success.
the last try is:

- name: wait for the new VM to be added to ansible_hosts inventory (1 hour 
timeout)
  wait_for:
      path: "{{ ansible_host_file }}"
      search_regex: "[GROUP_NAME]"
      timeout: 600
      delay: 10
      state: present
  delegate_to: localhost


- meta: refresh_inventory


the wait_for does not seem to wait at all, and meta does not seem to *update 
*the cache.


moreover, I tried to use "until" with only the meta module and it been ignored.

for example:


- meta: refresh_inventory

  until: groups[GROUP_NAME] is defined


Thank you

-- 
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/5575d4fa-ccc5-44aa-85a5-e3ed7f4736dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to