Ansible filter by Azure tag
Rédigé par uTux Aucun commentaireIt took me some time to figure out how to use Azure tags as a filter for Ansible. Well it's not that hard, azure_rm.py will automatically generate groups based on tags with this pattern:
- Tag: role:webserver
- Becomes group: role_webserver
Yes, that's the trick, ":" becomes "_". Let's say you want to run a playbook only on machines tagged with role:webserver, just use the following command:
$ ansible-playbook -i azure_rm.py playbook.yml --limit role_webserver