Answer the question
In order to leave comments, you need to log in
How to pull out the network interface name of a remote server using Ansible?
Hello!
There is a ready-made iptables config, which is uploaded to remote vps using ansible.
But different servers may have different network interface names ens0, eth0, etc.
Here is the best way to implement a mechanism for reading the interface name from the vps, then using it in the template module for the iptables file.
Help build the right procedure.
Thank you!
Answer the question
In order to leave comments, you need to log in
The facts have ansible_interfaces array
https://docs.ansible.com/ansible/latest/user_guide...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question