kandra: Skip hostnames which are undef.

If zulip.conf is not fully configured, do not error out if one of
the $hostname values is undef.
This commit is contained in:
Alex Vandiver 2024-02-07 12:28:35 -05:00 committed by Tim Abbott
parent 3d63a87384
commit fa6f4cc039
1 changed files with 4 additions and 2 deletions

View File

@ -63,8 +63,10 @@ define kandra::user_dotfiles (
mode => '0644',
require => File["${homedir}/.ssh"],
}
$known_hosts.each |String $hostname| {
if $hostname == 'github.com' {
$known_hosts.each |Optional[String] $hostname| {
if $hostname == undef {
# pass
} elsif $hostname == 'github.com' {
$github_keys = file('kandra/github.keys')
exec { "${user} ssh known_hosts ${hostname}":
command => "echo '${github_keys}' >> ${homedir}/.ssh/known_hosts",