User management and roles-reuse

28 views
Skip to first unread message

Francisco Reyes

unread,
May 14, 2014, 4:54:03 PM5/14/14
to ansible...@googlegroups.com
I have a role that sets up "admin users".. On both FreeBSD and Ubuntu.

I would like to expand that role to use it for other users as needed.

Is there a way to over-ride the vars/main.yml file with a different list on a playbook by playbook bases?

So I can create one playbook per user and then limit to what server it is run against.

In summary..
Existing
Have a role that adds admins

Desired
Want to reuse the users role to add other users to specific machines using the users role.

Michael DeHaan

unread,
May 14, 2014, 6:13:22 PM5/14/14
to ansible...@googlegroups.com
Yes, you can pass variables to roles.

Search for "parameterize" on this page - http://docs.ansible.com/playbooks_roles.html#roles

Though I think you should move your vars to defaults/main.yml instead, if you are doing that -- or even consider requiring the list to be passed each time.




--
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/2cb412a0-0dca-487f-992f-f60ce8a11dd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages