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',
|
$target = 'absent',
|
||||||
$options = '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:
|
ssh_authorized_key{$name:
|
||||||
type => $type,
|
type => $type,
|
||||||
key => $key,
|
key => $key,
|
||||||
user => $user,
|
user => $user,
|
||||||
|
target => $real_target,
|
||||||
}
|
}
|
||||||
|
|
||||||
case $options {
|
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