Merge "Remove hardcoded commands"
This commit is contained in:
commit
272d6ccc32
@ -6,9 +6,8 @@ define user::virtual::disable(
|
|||||||
) {
|
) {
|
||||||
$username = $title
|
$username = $title
|
||||||
#1. Remove user
|
#1. Remove user
|
||||||
exec { "disable_${username}":
|
user { "${username}":
|
||||||
command => "userdel ${username}",
|
ensure => absent,
|
||||||
onlyif => "grep ^${username}: /etc/passwd",
|
|
||||||
}
|
}
|
||||||
#2. remove sshkeys file(s)
|
#2. remove sshkeys file(s)
|
||||||
file { "rm_authorized_keys_${username}":
|
file { "rm_authorized_keys_${username}":
|
||||||
@ -20,9 +19,12 @@ define user::virtual::disable(
|
|||||||
path => "/home/${username}/.ssh/authorized_keys2",
|
path => "/home/${username}/.ssh/authorized_keys2",
|
||||||
}
|
}
|
||||||
#3. rm screen dir (just in case)
|
#3. rm screen dir (just in case)
|
||||||
exec { "rm_screen_${username}":
|
file { "rm_screen_${username}":
|
||||||
command => "rm -rf /var/run/screen/S-${username}",
|
ensure => absent,
|
||||||
onlyif => "ls /var/run/screen/S-${username}",
|
path => "/var/run/screen/S-${username}",
|
||||||
|
recurse => true,
|
||||||
|
purge => true,
|
||||||
|
force => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user