
In anticipation of puppet 4, start trying to deal with puppet 4 things that can be helpfully predicted by puppet lint plugins. Fix arrow alignment errors now caught by the bundle-installed puppet-lint. This patch makes $users::virtual::localuser::sshkeys a required parameter to fix the puppet-lint-empty_string-check error. If left as empty string and the default is used, the ssh_authorized_key resource will still create the authorized_key entry but with an empty key, which is not useful. Change-Id: Ica35f012f3af74159fc8b2ae5df60d11d4c15f33
31 lines
689 B
Puppet
31 lines
689 B
Puppet
# used to remove a user
|
|
# example:
|
|
# user::virtual::disable { 'baduser': }
|
|
|
|
define user::virtual::disable(
|
|
) {
|
|
$username = $title
|
|
#1. Remove user
|
|
user { $username:
|
|
ensure => absent,
|
|
}
|
|
#2. remove sshkeys file(s)
|
|
file { "rm_authorized_keys_${username}":
|
|
ensure => absent,
|
|
path => "/home/${username}/.ssh/authorized_keys",
|
|
}
|
|
file { "rm_authorized_keys2_${username}":
|
|
ensure => absent,
|
|
path => "/home/${username}/.ssh/authorized_keys2",
|
|
}
|
|
#3. rm screen dir (just in case)
|
|
file { "rm_screen_${username}":
|
|
ensure => absent,
|
|
path => "/var/run/screen/S-${username}",
|
|
recurse => true,
|
|
purge => true,
|
|
force => true,
|
|
}
|
|
}
|
|
|