Hi all, Is there a way to select hosts in inventory based on a variable ? More specifically, I have a host file like :
[webservers] web1.example.com location=room1 web2.example.com location=room1 web3.example.com location=room22 [dbservers] db1.example.com location=room22 db2.example.com location=room1 db3.example.com I would like to be able to select all computers with location=room1 (basically I want to shutdown all these machines because we have to cut the power in this room). Thus a commande like : ansible all --list-hosts --filter=location=room1 would be great. Il could do that more or less in a playbook, but I also use ansible in shell scripts to run specific commands. F. -- 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/313410a1-f460-4746-9c62-3c9c8b3f5520%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
