Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
include interface info in ansible_interfaces #34395
gather_facts currently creates a list
The rationale for this change is copied verbatim from #30246:
I propose making the network interface facts available as a dictionary (similar to what's done for disk devices) in the existing ansible_interfaces (which is currently only a list of names).
This change can be implemented in a backwards-compatible way due to the sematics of Python iterators:
NOTE: of course the
Current implementation makes it non-trivial to iterate through the network interfaces and grab e.g. IP information. We can get around this by building an object in-play such as:
but this is ugly, and can cost significant time/memory if there are many interfaces.
CI failure in unit tests: https://app.shippable.com/github/ansible/ansible/runs/48884/5/tests
@dbckz we discussed in todays core dev meeting, that this will need to be placed in a new key and cannot replace the current key.
However, we won't be able to accept this until we add deprecation functionality for old keys. We will deprecate the old