Use built-in ansible_default_ipv4 variable.
It turns out ansible already provides info about the default network interface in the ansible_default_ipv4 dict variable, so we can use that instead of using the 'ip route show' command.
Showing
Please
register
or
sign in
to comment