I was wondering if there was any way to update the address that Ansible uses to ssh into a host mid-playbook.
I'm trying to write a script that will shutdown an AWS EC2 host, start a snapshot of the root volume, boot it back up, and perform some other tasks. The catch is that the address of this instance changes when it reboots and Ansible keeps using the address it retrieved at the beginning of the playbook via the dynamic inventory script, causing the rest of the actions to fail. I've considered breaking the playbook into two different files so I can refresh the hosts cache after the box starts back up, but I'd prefer to execute all the tasks in one run. I've also tried looking around for some fact I could set to change the address Ansible uses to ssh, but I haven't found anything. Is it possible to change the address Ansible is using to ssh from within the playbook? If it is, how can I change it? Thanks for any and all help! -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/079eb7a9-5d8f-4b09-b4c9-807152f18660%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
