You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Hi,
When one has multiple inventories like:
inventories/a/hosts
inventories/b/hosts
inventories/..
Is there an easy way to run a task or playbook against all of them without explicitly having to define each inventory on the command-line?
The use case here is that all those groups contain machines for different departments or even sub-companies, however they all share certain SSL-certificates that I would like to be able to deploy to all hosts at once.
Thanks,
Nico.
Dick Davies
unread,
Feb 14, 2016, 5:17:17 AM2/14/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible list
We normally just wrap it in a shell loop:
for i in inventories/*/hosts
do
ansible-playbook -i $i foo.yml
done
This email is intended for the person(s) to whom it is addressed and may contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, distribution, copying, or disclosure by any person other than the addressee(s) is strictly prohibited. If you have received this email in error, please notify the sender immediately by return email and delete the message and any attachments from your system.
Alexey Vazhnov
unread,
Feb 15, 2016, 5:42:59 AM2/15/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Try to use:
ansible-playbook -i inventories
because Ansible can use directories.
You also can use symlinks for more complicated cases.