system-config/modules/user/manifests/virtual.pp
Clark Boylan f40847dd78 Kill trailing whitespace.
Killed trailing whitespace in the puppet repo files using
`sed -r 's/\s+$//'`. Skip binary files and html templates for lodgeit
and mailman.

Change-Id: Ib43493161d8f0e8fae1426b22fb1737832ca14cd
Reviewed-on: https://review.openstack.org/12969
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2012-10-05 23:27:31 +00:00

39 lines
937 B
Puppet

class user::virtual {
define localuser ($realname,$sshkeys='',$shell="/bin/bash") {
group { $title:
ensure => 'present'
}
user { $title:
ensure => "present",
comment => $realname,
home => "/home/$title",
shell => $shell,
gid => $title,
groups => ['sudo','admin'],
membership => 'minimum',
managehome => true, # creates the home directory (does not actually manage it)
require => Group[$title],
}
file { "${title}_sshdir":
name => "/home/$title/.ssh",
owner => $title,
group => $title,
mode => 700,
ensure => 'directory',
require => User[$title],
}
file { "${title}_keys":
name => "/home/$title/.ssh/authorized_keys",
owner => $title,
group => $title,
mode => 400,
content => $sshkeys,
ensure => 'present',
require => File["${title}_sshdir"],
}
}
}