Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

In Ansible, is it possible to define a set of tasks in one files and then run selected tasks from other playbooks? The documentation describes how to include and reuse the task list, is there a way to run only selected tasks and not the full list?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

You can do so by either using roles: http://www.ansibleworks.com/docs/playbooks_roles.html

or by tagging individual tasks you want to be able to turn off: http://www.ansibleworks.com/docs/playbooks_tags.html

You can even combine the two, as described on the tags page:

You may also apply tags to roles:

  - { role: webserver, port: 5000, tags: [ 'web', 'foo' ] }
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.