Hi, since I make use of the ansible facts containing the list of IP addresses to bind services to IPs I want to make sure that the IP addresses are always returned the same way, - regardless how often you run the playbook - or if you choose to add additional interfaces or IP addresses (aliases) in the future.
I didn't find specific information about how the content of
ansible_all_ipv4_addresses and
ansible_all_ipv6_addresses
is put together.
My questions are:
- Is there documentation that does not require to read the code [1]?
- How is the order of the IP addresses determined is it deterministic?
- Will this remain unchanged in future ansible versions?
- Do any of the filters
ansible_all_ipv4_addresses| ipv4('address') | ipv4('public')
ansible_all_ipv6_addresses| ipv6('public') | ipv6('address')
have an influence on the order?
- Are there best practices when adding new interfaces or aliases to ensure
that the order of IPs in these facts does not get affected?
(I make use of the first N IPs)
Since my role [2] supports multiple platforms I also
care if the answer to these questions are platform specific.
Relevant platforms:
- Debian / Ubuntu
- FreeBSD
- OpenBSD
- CentOS
- Fedora
thanks!
nusenu
[1]
https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/network/linux.py
[2] https://github.com/nusenu/ansible-relayor
--
https://mastodon.social/@nusenu
twitter: @nusenu_
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/9132d1cc-a757-3141-512d-fceedcf42abc%40riseup.net.
For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: OpenPGP digital signature
