Skip to content

Commit 2d7dd64

Browse files
author
Clayton O'Neill
committed
Switch backup server IP to use getaddrinfo
By using getaddrinfo() instead of the Resolv module, this can work with non-DNS based host lookups such as /etc/hosts.
1 parent bf21b6f commit 2d7dd64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

manifests/client/user.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
## Get Key for remote backup user
3939
if $push_ssh_key {
4040
$server_user_exploded = "${server_user}@${server}"
41-
$backup_server_ip = inline_template("<% _erbout.concat(Resolv::DNS.open.getaddress('${server}').to_s) %>")
41+
$backup_server_ip = inline_template("<%= Addrinfo.getaddrinfo('${server}', 'ssh', nil, :STREAM).first.ip_address %>")
4242
sshkeys::set_authorized_key { "${server_user_exploded} to ${client_user}":
4343
local_user => $client_user,
4444
remote_user => $server_user_exploded,

0 commit comments

Comments
 (0)