You can not include single tasks from roles. If you install a role, no matter if from Galaxy or any other source, you can use it as it is by adding it to the roles section of your playbook or as a dependency in any of your own roles.
The readme of the chruby role shows an example playbook:
- hosts: all
roles:
- ferrarimarco.chruby
I need to install chruby on web and worker
You can add it as a dependency to those roles. The format is the same. Create a file roles/web/meta/main.yml
(and the same for the worker role) with the content:
dependencies:
- ferrarimarco.chruby
If you were looking for tasks to actually use chruby, I have to disappoint you. There is nothing in the role. But it appears to me chruby simply is a command which you can use with the command
or shell
modules:
- name: Change ruby to 1.9.3
shell: chruby 1.9.3
A role could provide mechanisms (tags or extra-vars) to trigger specific tasks, for example installing, updating or uninstalling software. Also a role could provide modules to interact with the installed software. But this is not the case with the chruby role. It simply installs chruby and its dependencies via apt.