Added ec2_public_ipv4 to host_aliases in ssh::known_hosts
This commit is contained in:
parent
b94a2e8d11
commit
02a834f9da
1 changed files with 9 additions and 4 deletions
|
@ -12,14 +12,19 @@ class ssh::known_hosts {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$shortname = inline_template("<%= homename.split('.')[0] %>")
|
||||||
|
|
||||||
|
if $::ec2_public_ipv4 {
|
||||||
|
$aliases = [ $shortname, $::ipaddress, $::ec2_public_ipv4 ]
|
||||||
|
} else {
|
||||||
|
$aliases = [ $shortname, $::ipaddress ]
|
||||||
|
}
|
||||||
|
|
||||||
@@sshkey { $homename:
|
@@sshkey { $homename:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
type => rsa,
|
type => rsa,
|
||||||
key => $sshrsakey,
|
key => $sshrsakey,
|
||||||
host_aliases => [
|
host_aliases => $aliases,
|
||||||
inline_template("<%= homename.split('.')[0] %>"),
|
|
||||||
$::ipaddress,
|
|
||||||
],
|
|
||||||
require => File["/etc/ssh/ssh_known_hosts"],
|
require => File["/etc/ssh/ssh_known_hosts"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue