I've recently realized that the wati_for module of Ansible is a bit tricky when it comes to waiting for a remote file, i.e. a file that's supposed to be present or absent on a host other than the one that's running the Ansible task.
If you check the doc, there is this host attribute which is rather intriguing. But when you do put it on a test drive, it won't work. My understanding is host is meant for paring with port, together checking the readiness of, say, a restful service.
The correct way then to wait for a remote file is through delegate_to, without further ado.
没有评论:
发表评论