- name: Find a free IP
local_action: script files/find_free_ip.py {{ startip }} {{ endip }}
register: freeip
become: "no"
- name: Assign the correct IP and Hostname to the VM
script: files/set_ip_and_hostname.sh {{ initialip }} {{ freeip.stdout }} {{ hostname }}
changed_when: "False"
delegate_to: "{{ initialip }}"
- name: Wait for VM to become available
local_action: wait_for host={{ freeip.stdout }} port=22 delay=1 \
state=started timeout=300
become: "no"
fatal: [nj-kvm02 -> localhost]: FAILED! => {"changed": false, "elapsed": 300, "failed": true, "msg": "Timeout when waiting for 192.168.1.147\n:22"}