Hi all.
Can anybody explain me, how to get remote node ip and use it in .erb template file, if this node has several ip address.
Example: server has ip 192.168.156.68 and 10.248.41.70. I need to get 192.168.156.68
In my manifest file i write:
if $::ipaddress =~ /^192\.168\.\d{1,3}\.\d{1,3}/ {
notice("ok")
}
else {
warning("don't know what to do with IP address $::ipaddress")
}
and in template file : ListenAddress <%= @ipaddress %>
In result i got ListenAddress = 10.248.41.70.
But i need ListenAddress = 192.168.156.68
In puppet docs speaks that $::ipaddress get ip with default gateway.
Can you explain me how to get 192.168.156.68