Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,12 @@ String - The ssh key for the user

- *Default*: undef

ssh_auth_key_ensure
-----------------
String - The ssh key Present or Absent

- *Default*: present

ssh_auth_key_type
-----------------
String - Anything that the ssh_authorized_key resource can take for the type attribute, such as `ssh-dss` or `ssh-rsa`.
Expand Down
60 changes: 31 additions & 29 deletions manifests/mkuser.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@
# [email protected] - Licensed GPLv2
#
# Parameters:
# $uid - UID of user
# $gid - GID of user, defaults to UID
# $group - group name of user, defaults to username
# $shell - user's shell, defaults to '/bin/bash'
# $home - home directory, defaults to /home/<username>
# $ensure - present by default
# $managehome - true by default
# $manage_dotssh - true by default. creates ~/.ssh
# $comment - comment field for passwd
# $groups - additional groups the user should be associated with
# $password - defaults to '!!'
# $mode - mode of home directory, defaults to 0700
# $ssh_auth_key - ssh key of the user
# $ssh_auth_key_type - defaults to 'ssh-dss'
# $uid - UID of user
# $gid - GID of user, defaults to UID
# $group - group name of user, defaults to username
# $shell - user's shell, defaults to '/bin/bash'
# $home - home directory, defaults to /home/<username>
# $ensure - present by default
# $managehome - true by default
# $manage_dotssh - true by default. creates ~/.ssh
# $comment - comment field for passwd
# $groups - additional groups the user should be associated with
# $password - defaults to '!!'
# $mode - mode of home directory, defaults to 0700
# $ssh_auth_key - ssh key of the user
# $ssh_auth_key_ensure - ssh key present by default
# $ssh_auth_key_type - defaults to 'ssh-dss'
#
# Actions: creates a user/group
#
Expand All @@ -38,20 +39,21 @@
#
define common::mkuser (
$uid,
$gid = undef,
$group = undef,
$shell = undef,
$home = undef,
$ensure = 'present',
$managehome = true,
$manage_dotssh = true,
$comment = 'created via puppet',
$groups = undef,
$password = undef,
$mode = undef,
$ssh_auth_key = undef,
$create_group = true,
$ssh_auth_key_type = undef,
$gid = undef,
$group = undef,
$shell = undef,
$home = undef,
$ensure = 'present',
$managehome = true,
$manage_dotssh = true,
$comment = 'created via puppet',
$groups = undef,
$password = undef,
$mode = undef,
$create_group = true,
$ssh_auth_key = undef,
$ssh_auth_key_ensure = 'present',
$ssh_auth_key_type = undef,
) {

if $shell {
Expand Down Expand Up @@ -175,7 +177,7 @@
# if we specify a key, then it should be present
if $ssh_auth_key {
ssh_authorized_key { $name:
ensure => present,
ensure => $ssh_auth_key_ensure,
user => $name,
key => $ssh_auth_key,
type => $my_ssh_auth_key_type,
Expand Down