Created
May 6, 2019 07:17
-
-
Save raphink/6bdf7badca949d4b45d91a95b36ba483 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define user_group ( | |
String $group, | |
Enum['present', 'absent'] $ensure = 'present', | |
) { | |
$changes = $ensure ? { | |
'present' => "defnode ${group}/user[.='${name}'] '${name}'", | |
'absent' => "rm ${group}/user[.='${name}']", | |
} | |
augeas { "Manage ${title} in group ${group}": | |
lens => 'Group.lns', | |
incl => '/etc/group', | |
changes => $changes, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment