What's the preferred way of geo-locating an agent node?
Suppose, for the sake of argument, I managed a globally distributed infrastructure making heavy use of Debian. I'd like for each of my machines to be able to use the local Debian mirror as its apt repository source.
What I would ideally like to be able to do is
- determine the IP address that my agent uses to hit my puppetmaster (possibly NATed IPv4, hence unrelated to the
$ipaddressfact if I understand the implications of the latter correctly),
- then use a custom function to wrap a GeoIP lookup library (possibly
geoip) to determine the node's country,
- stick ...