Each of our depots has a small Debian gateway that the handheld scanners talk to. Our playbook templates the scanner API's configuration, and one line in it has been the same for four years: bind_address: {{ ansible_default_ipv4.address }}. Every gateway had one network card on the depot LAN, so the default IPv4 address and the LAN address were the same thing.
In November we opened two new depots with a new gateway build. These have two network cards. enp1s0 is on the depot LAN. enp2s0 is a dedicated internet line for carrier traffic, and the default route goes out through it, because that is where everything outside the depot needs to go. The playbook ran green on both, our post deploy smoke test passed, and on the first morning not one scanner could connect.
ansible_default_ipv4 is not the main address of the machine, whatever the name suggests. Ansible fills it in by asking the kernel which route it would take to reach a public address, 8.8.8.8, and reporting the interface and address of that route.…