I’d like to iterate through the list of hostnames in a playbook so I can run a command on each hostname. That way I can use the “vmm” command from Vmware to make a snapshot of all hosts in the playbook before acting on them.
I'd like to iterate through the list of hostnames in a playbook so I can
run a command on each hostname. That way I can use the "vmm" command from
Vmware to make a snapshot of all hosts in the playbook before acting on
them.
With local_action, you have access to all the same variables that you
typically do, and it runs once per host. So all you really need is to use
$inventory_hostname
With local_action, you have access to all the same variables that you
typically do, and it runs once per host. So all you really need is to use
$inventory_hostname