I'm trying to setup my sshd_config file using Ansible. For design reasons (we have both virtual and physical machines, with different NICs) the management interface is not fixed, so in my template I cannot just put
{{ ansible_eth0.ipv4.address }}
because I don't know in advance which interface is going to be management interface so, I need discovering it. I know the IP is always going to be inside a range (e.g. 192.168.1.0/24).
How can I discover which interface has that IP and then use it in the template?