How do puppet transform group with username in /etc/sudoers file
101 views
Skip to first unread message
mac01
unread,
May 31, 2012, 9:52:05 AM5/31/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Hi,
How can I transform group in sudoers file where users are added as "%admin ALL=(ALL) ALL" with individual user name which should fetch username from my database ?
Thanks mac
Steve Singer
unread,
May 31, 2012, 11:27:10 AM5/31/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com, mac01
In the template that generates your sudoers file you could call a custom
function (that you would need to write) which queries your database to
get the username.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Hi,
How to write custom facts for sudoers files where the data or username need to be fetch from a file for the owner of the system like,
I want to replace %admin ALL=(ALL) ALL with username ALL=(ALL) ALL but from a file for the systems owner only so that no one can login to others system.
Thanks mac
Jeff McCune
unread,
Jun 2, 2012, 2:22:36 PM6/2/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
On Thursday, May 31, 2012 at 6:52 AM, mac01 wrote:
Hi,
How can I transform group in sudoers file where users are added as "%admin ALL=(ALL) ALL" with individual user name which should fetch username from my database ?
I'm not quite clear on the question you're asking. The most common way is to make sure the users who need super user access are a member of the admin group.
You can use the user resource in Puppet to manage group membership.
Another approach is to use LDAP to centralize user and group information.
-Jeff
Matt
unread,
Jun 4, 2012, 10:32:11 PM6/4/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
There is a trick I use on my infrastructure, it is around having an include dir for sudoers. You can write a custom function to retrieve the data from the database and return it as a hash. You would need to do a define if you want to define each user sudo permissions as a individual resource. Alternatively you could also use an erb and loop through the hash.