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.