ansible / proposals

Repository for sharing and tracking progress on enhancement proposals for Ansible.
Creative Commons Zero v1.0 Universal
92 stars 19 forks source link

Possibility to assign an IPv4 and IPv6 address to ansible_host #165

Closed vlcty closed 5 years ago

vlcty commented 5 years ago

Proposal: Possibility to assign an IPv4 and IPv6 address to ansible_host

Author: Josef Stautner <@vlcty>

Date: 2019-06-01

Motivation

The support and deployment of IPv6 enabled networks and hosts is growing. My hosts are also using IPv6 whenever possible. Yet most of the setups needs some sort if IPv4 connectivity. To smooth the transition I'd like to tell ansible an IPv4 and IPv6 address for each host. Currently you can only set an IPv4 or an IPv6 address.

Problems

You have to choose which IP version you want to support in your network. If you choose IPv4 you will have a hard time in the near future moving on to IPv6.

Solution proposal

Dependencies (optional)

None that I know of.

Testing (optional)

Test cases would be:

Documentation (optional)

This feature should be documented: https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html

Anything else?

I've not tested what happens when I set a hostname instead of the IP. I assume that the mechanism would already work. However I don't like the idea of hostnames in ansible. I configure the DNS servers I query with ansible. If something fails or I've to recover from a desaster I can't rely on DNS.

agaffney commented 5 years ago

The ansible_host value is blindly passed to whatever connection method is being used. Each individual connection method would need to have support for specifying multiple possible IP addresses, which isn't really practical. An alternate method would be to have ansible test a connection using each address in the list, but there's no good way to know whether a connection failed because of the IP provided or something like an auth failure or sunspots.

vlcty commented 5 years ago

I'm gonna use IPv6 then.