I hope its clear the doubt. I dont know if now, this can be done without creating files per user, i mean creating each block in hiera per user. If this can be done in an add_user/group like manner, then i dont know how. If not, perhaps its a desired feature? Then i could help with the code.
Thanks!
Hi,
Couldn find a Subject for this. Sorry.
What i am trying to do , is to add users, groups from hiera to a template other than the users_groups.erb as that template grants ALL.
I ws thinking in having a template for a subset of commands permited defined already as Alias in sudoers (this is done)
<% @users.each do |user| -%> <%= user %> ALL=(ALL) WEBADMINS <% end -%> <% @groups.each do |group| -%> %<%= group %> ALL=(ALL) WEBADMINS
This is in order to avoid duplicating info in hiera for lets say i have to give two persons a sudo for:
"sudo::configs" : { "sudo_web" : { "content" : "username1 ALL=(ALL) WEBADMIN", "priority" : 50 }, "sudo_web2" : { "content" : "username2 ALL=(ALL) WEBADMIN", "priority" : 50 } },
I hope its clear the doubt. I dont know if now, this can be done without creating files per user, i mean creating each block in hiera per user. If this can be done in an add_user/group like manner, then i dont know how. If not, perhaps its a desired feature? Then i could help with the code. Thanks!