I want to import into playbook (and execute) only part of Ansible role defined in tagged block.
E.g. I have role some_role
containing 3 blocks of tasks tagged as tag1
, tag2
and tag3
. I could create playbook that imports whole role:
---
- hosts: some_host
roles:
- role: roles/some_role
And then execute it from command line specifying single tag:
$ ansible-playbook -i hosts.yml playbook.yml --tags tag1
But I want to move --tags tag1
part into playbook itself to be able to run that single block without providing tags to ansible-playbook
.