Ansible limiting the playbook execution to few hosts / groups.
Limit to one host
ansible-playbook playbooks/PLAYBOOK_NAME.yml --limit "host1"
Limit to multiple hosts
ansible-playbook playbooks/PLAYBOOK_NAME.yml --limit "host1,host2"
All but one host
ansible-playbook playbooks/PLAYBOOK_NAME.yml --limit 'all:!host1'
Limit to a group
ansible-playbook playbooks/PLAYBOOK_NAME.yml --limit 'group1'
All but one group
ansible-playbook playbooks/PLAYBOOK_NAME.yml --limit 'all:!group1'
source:
https://ansible-tips-and-tricks.readthedocs.io/en/latest/ansible/commands/#limit-to-one-or-more-hosts
No comments:
Post a Comment