summaryrefslogtreecommitdiff
path: root/manifests/sftp_only.pp
blob: 0990af2befb861ed9169e2796264ed10c657dcaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# gid:  by default it will take the same as the uid
define user::sftp_only(
  $ensure = present,
  $managehome = false,
  $uid = 'absent',
  $gid = 'uid',
  $homedir = 'absent',
  $homedir_mode = '0750',
  $password = 'absent',
  $password_crypted = true
) {
  require user::groups::sftponly
  user::managed{$name:
    ensure => $ensure,
    uid => $uid,
    gid => $gid,
    name_comment => "SFTP-only_user_${name}",
    groups => [ 'sftponly' ],
    managehome => $managehome,
    homedir => $homedir,
    homedir_mode => $homedir_mode,
    shell => $::operatingsystem ? {
      debian => '/usr/sbin/nologin',
      ubuntu => '/usr/sbin/nologin',
      default => '/sbin/nologin'
    },
    password => $password,
    password_crypted => $password_crypted;
  }
}