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?

2. 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?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e44794a2-0c06-4337-92b5-b9bde5e5400a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to