I'm having problems with implementing a play from this article that waits for a server to reboot and then carries on with other tasks. The playbook runs fine down to this task
The playbook I have performs several functions (which I've commented out for testing including the server reboot function for now) and then reboots the server. The wait function is give me an error though
- name: Wait for server reboot
local_action: wait_for host={{ ipaddress }} state=started delay=30 timeout=300
sudo: falseTASK [Wait for server reboot] **************************************************
task path: /etc/ansible/playbooks/nodeprereqs.yml:27
fatal: [ipaddress]: FAILED! => {"failed": true, "msg": "float object has no element 155"}
NO MORE HOSTS LEFT *************************************************************
I've tried several variants of the play all getting the same error above. Right now the current playbook looks like this (minus the other comment out tasks)
---
- hosts: TestServers
become: yes
become_method: su
tasks:
- name: Wait for server reboot
wait_for: host={{ ipaddress }} port=22 state=started delay=30 timeout=300
connection: local
- name: Next task
command: do something
I run the playbook as usual
ansible-playbook -vvv nodeprereqs.yml -u username --ask-pass --ask-su-pass