$from_space = $from_hosts.join(' ')
- @@concat::fragment { "ssh::authorized_key::${name} ${target_user} ${from}":
- tag => "ssh::authorized_key::fragment::${collect_tag}::${target_user}",
- target => "/etc/ssh/userkeys/${target_user}",
- order => '200',
- content => @("EOF"),
- command="${command}",from="${from}",restrict ${key}
- | EOF
+ if $key {
+ @@concat::fragment { "ssh::authorized_key::${name} ${target_user} ${from}":
+ tag => "ssh::authorized_key::fragment::${collect_tag}::${target_user}",
+ target => "/etc/ssh/userkeys/${target_user}",
+ order => '200',
+ content => @("EOF"),
+ command="${command}",from="${from}",restrict ${key}
+ | EOF
+ }
+ } else {
+ notify{ "Warning, ssh key for ${name}, ${target_user} not defined (yet?).": }
}
@@ferm::rule { "ssh-${target_user}-${name}":