how to refactor a play consisting of multiple roles into a single role?

39 views
Skip to first unread message

Gallagher Polyn

unread,
Apr 2, 2014, 8:55:41 AM4/2/14
to ansible...@googlegroups.com
I'd like to convert a playbook consisting of several (3) roles into a role (the playbook: github.com/leucos/ansible-rbenv-playbook).

It seems odd that I would flatten the several roles back into plays, but I haven't seen examples of a role consisting of roles.

What is the recommended approach for making a role from a playbook consisting of several roles?

Thanks, G

Michael DeHaan

unread,
Apr 2, 2014, 11:46:45 AM4/2/14
to ansible...@googlegroups.com
Having a play map server roles to a host group is pretty simple:

- hosts: webservers
  roles:
    - role_a
    - role_b
    - role_c

Some users may like role dependencies but they are usually overkill, and I don't use them hardly ever myself.

(It is true of course that a role doesn't consist of roles - it's made up of tasks, handlers, variables (defaults and ones that are strictly observed, and metadata)



--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0c06eeb5-5a9e-4fc7-88ba-f0b36d59f3e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages