Infrastructure modules allow us to not only manage the setup of our machines, but also the creation of those machines themselves. Apart from this, we can also automate much of the infrastructure surrounding them. This can be used as a simple replacement for services such as Amazon Cloud Formation.
When creating machines that we want to manage in a later play in the same playbook, we will want to use the
add_hosts module that we discussed earlier in the chapter to add the machine to the in-memory inventory so that it can be the target of further plays. We might also wish to run the
group_by module to arrange them into groups as we would arrange other machines. The
wait_for module should also be used to check that the ...