diff options
author | Leif Johansson <leifj@sunet.se> | 2015-04-01 08:58:59 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2015-04-01 08:58:59 +0200 |
commit | 8b5d4875013efe18cffcd91a38fd201e82a92246 (patch) | |
tree | b16355ad6e1ea14043daa5cde889741e9ddcc9f3 /global/overlay/etc/puppet/modules/sunet/manifests | |
parent | 82194de4656c118f28365db83f22d50f286fbd18 (diff) | |
parent | 5cb9279fd0472bec59f5430786a6c684854bcf6f (diff) |
Merge branch 'master' of git.nordu.net:sunet-ops
Diffstat (limited to 'global/overlay/etc/puppet/modules/sunet/manifests')
-rw-r--r-- | global/overlay/etc/puppet/modules/sunet/manifests/add_user_to_group.pp | 7 | ||||
-rw-r--r-- | global/overlay/etc/puppet/modules/sunet/manifests/system_user.pp | 22 |
2 files changed, 29 insertions, 0 deletions
diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/add_user_to_group.pp b/global/overlay/etc/puppet/modules/sunet/manifests/add_user_to_group.pp new file mode 100644 index 0000000..348d9c5 --- /dev/null +++ b/global/overlay/etc/puppet/modules/sunet/manifests/add_user_to_group.pp @@ -0,0 +1,7 @@ +# Add a user to a group +define sunet::add_user_to_group($username, $group) { + exec {"add_user_${username}_to_group_${group}_exec": + command => "adduser --quiet $username $group", + path => ['/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', ], + } +} diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/system_user.pp b/global/overlay/etc/puppet/modules/sunet/manifests/system_user.pp new file mode 100644 index 0000000..819ef4a --- /dev/null +++ b/global/overlay/etc/puppet/modules/sunet/manifests/system_user.pp @@ -0,0 +1,22 @@ +define sunet::system_user( + $username, + $group, + $system = true, + $shell = '/bin/false' + ) { + + user { $username : + ensure => present, + name => $username, + membership => minimum, + system => $system, + require => Group[ $group ], + shell => $shell, + } + + group { $group : + ensure => present, + name => $group, + } + +} |