# Including and overriding Ansible galaxy roles in my roles

**URL:** <https://forum.ansible.com/t/including-and-overriding-ansible-galaxy-roles-in-my-roles/16503>\
**Category:** Ansible Project\
**Tags:** ubuntu, galaxy-ng\
**Created:** [October 14, 2014, 2:10pm UTC](https://forum.ansible.com/t/including-and-overriding-ansible-galaxy-roles-in-my-roles/16503 "2014-10-14T14:10:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navid\_Paya](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@Navid\_Paya](https://forum.ansible.com/u/Navid_Paya)\
**Post date:** [October 14, 2014, 2:10pm UTC](https://forum.ansible.com/t/including-and-overriding-ansible-galaxy-roles-in-my-roles/16503/1 "2014-10-14T14:10:04Z")

</div>

Hi  
So this is a refined version of a question I asked before. I have a role that aims to:

- Do some specific change such as creating users
- Install nodejs and ruby using rbenv
- Run a rails app

I’m using two dependencies from Ansible galaxy for that:

- [nodesource.node](https://github.com/nodesource/ansible-nodejs-role)
- [zzet.rbenv](https://github.com/zzet/ansible-rbenv-role)

How I do that at the moment is to install those roles using a requirements.txt file, and include them in my site.yml:

- hosts: all  
user: ubuntu  
sudo: true

roles:

- base-ami
- nodesource.node
- zzet.rbenv
- rails

Now I have two questions.

1. Is there a way to include these roles from within one of my roles instead of the site.yml file so that I’ll have just one role (base-ami) instead of four showing up in my site.yml. I tried to do something like this:

- name: Include the nodesource.node role  
include: zzet.rbenv

But then it would expect to see the role in my Ansible playbook. Is there a way to include a Ansible galaxy role from within my role?

1. I like what zzet.rbenv does but I want to change the version of Ruby it installs. According to the github page, that is controlled like this:

rbenv:  
env: user  
ruby\_version: 2.1.2

How can I include this Ansible galaxy role in my base-ami role and then override these values?
