Grab a specific IP address from ansible facts

Use jinja2 filters to grab the 192.168.x.x address from a machine with multiple NICs:

{{ ansible_all_ipv4_addresses | ipaddr('192.168.0.0/16') | first }}

Of course, this assumes that you don’t have 2 NICs on the same subnet in the one system. If you want to deal with that, I’m sure there’s a way to do it, but unfortunately it’s not right here right now :)

 
1
Kudos
 
1
Kudos

Now read this

My obligatory Ubuntu ssh-agent post

There has been much wailing and gnashing of teeth regarding the default SSH/GPG agent in Ubuntu (the GNOME 3 “Passwords & Keys” app). It has several shortcomings and lacks some of the functionality that the standard tools have. There... Continue →