Is there a way to only run one task in ansible playbook?
For example, in roles/hadoop_primary/tasks/hadoop_master.yml. I have "start hadoop jo
See my answer here: Run only one task and handler from ansible playbook
It is possible to run separate role (from roles/ dir):
ansible -i stage.yml -m include_role -a name=create-os-user localhost
and separate task file:
ansible -i stage.yml -m include_tasks -a file=tasks/create-os-user.yml localhost
If you externalize tasks from role to root tasks/ directory (reuse is achieved by import_tasks: ../../../tasks/create-os-user.yml) you can run it independently from playbook/role.