Hello!
I have a playbook, which dynamically creates hosts on Amazon EC2 and (also dynamically) adds them to various groups.
Ideally, I would like to be able to revisit these hosts on a second run, just in case something went wrong with one of those hosts, or I want to change something.
Therefore, I’m wondering if there is a preferred way to output (dump) the current state of the dynamic inventory. Is there a module for it or do I have to use a local_action, run my groups through a template and generate an inventory file in that manner?
Thank you for your help…
I don't believe there is a built in way to do what you want. A local_action with a template is the way to go.
-jlk
"
Ideally, I would like to be able to revisit these hosts on a second run, just in case something went wrong with one of those hosts,"
The way to do this is to call some basic script tests to verify that your service is running by the time your playbooks complete, such that the playbooks fail for those hosts.
Then the generated retry file can be used to selectively target just the hosts that fail.
Hello!
The way to do this is to call some basic script tests to verify that
your service is running by the time your playbooks complete, such that
the playbooks fail for those hosts.
Then the generated retry file can be used to selectively target just
the hosts that fail.
Yes, that would work. Thank you for your response.
In the meantime, I've gone the route of generating a full inventory file
via a template. Fortunately, that's easy enough. That way, I can use
this inventory also for further configuration management tasks for which
maybe I have other playbooks.
Thank you again...
Juergen