From 9b273de5ea4cc39964366242758a652f7252e497 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 25 May 2009 21:33:36 +0200 Subject: factored everything in it's own file --- manifests/sftp_only.pp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 manifests/sftp_only.pp (limited to 'manifests/sftp_only.pp') diff --git a/manifests/sftp_only.pp b/manifests/sftp_only.pp new file mode 100644 index 0000000..2047ef1 --- /dev/null +++ b/manifests/sftp_only.pp @@ -0,0 +1,29 @@ +# gid: by default it will take the same as the uid +define user::sftp_only( + $ensure = present, + $managehome = false, + $uid = 'absent', + $gid = 'uid', + $homedir_mode = '0750', + $password = 'absent', + $password_crypted = true +) { + include user::groups::sftponly + user::managed{"${name}": + ensure => $ensure, + uid => $uid, + gid => $gid, + name_comment => "SFTP-only_user_${name}", + groups => [ 'sftponly' ], + managehome => $managehome, + homedir_mode => $homedir_mode, + shell => $operatingsystem ? { + debian => '/usr/sbin/nologin', + ubuntu => '/usr/sbin/nologin', + default => '/sbin/nologin' + }, + password => $password, + password_crypted => $password_crypted, + require => Group['sftponly'], + } +} -- cgit v1.2.3