terraform-provider-lxd
terraform-provider-lxd copied to clipboard
Support multiple ip addresses on single interface
We have a setup where two ipv6 subnets are used on single interface, example:
+----------------------+---------+---------------------+---------------------------------------------+-----------+-----------+--------------------+
| vault0 | RUNNING | 10.30.10.49 (eth0) | fd19:cafe:510:0:216:3eff:fef3:6194 (eth0) | CONTAINER | 0 | node1 |
| | | | 3ac7:ffa:841:7d19:116:4eff:5ef3:1194 (eth0) | | | |
+----------------------+---------+---------------------+---------------------------------------------+-----------+-----------+--------------------+
lxd_container output will return only one ipv6 address, the public one; the private one won't be returned.
Is it acceptable to convert ip_address, ipv4_address and ipv6_address output type to list so that multiple addresses can be returned ? To preserve compatibility this field can stay as is if only one address is detected.
It would probably be best to create two new attributes, ipv4_addresses and ipv6_addresses that are lists of all the system IPs. This would maintain backward compatibility yet still expose all the addresses.
I'd be happy to review a PR, but may not get to this myself for a while.