try if setting a target fixes the problem
This commit is contained in:
parent
d92fa75793
commit
e3cb846f32
1 changed files with 13 additions and 8 deletions
|
@ -290,10 +290,23 @@ define sshd::ssh_authorized_key(
|
|||
$target = 'absent',
|
||||
$options = 'absent'
|
||||
){
|
||||
|
||||
case $target {
|
||||
'absent': {
|
||||
case $user {
|
||||
'root': { $real_target = '/root/.ssh/authorized_keys' }
|
||||
'default': { $real_target = "/home/${user}/.ssh/authorized_keys" }
|
||||
}
|
||||
}
|
||||
default: {
|
||||
$real_target = $target
|
||||
}
|
||||
}
|
||||
ssh_authorized_key{$name:
|
||||
type => $type,
|
||||
key => $key,
|
||||
user => $user,
|
||||
target => $real_target,
|
||||
}
|
||||
|
||||
case $options {
|
||||
|
@ -304,12 +317,4 @@ define sshd::ssh_authorized_key(
|
|||
}
|
||||
}
|
||||
}
|
||||
case $target {
|
||||
'absent': { info("not setting any target for ssh_authorized_key: $name") }
|
||||
default: {
|
||||
Ssh_authorized_key[$name]{
|
||||
target => $target,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue