Force ansible to use IPv4 / IPv6?

3,346 views
Skip to first unread message

John Oliver

unread,
Jan 12, 2015, 7:04:52 PM1/12/15
to ansible...@googlegroups.com
I've run into a minor problem where one of my hosts has an AAAA record for an address assigned via DHCP6, but it isn't acquiring that address.  I can connect via the IPv4 address just fine.  I'm looking for a switch to tell ansible / ansible-playbook to force a connection over one protocol so I don't have to come up with some lower-level hack, forget about it, and have it cause another problem tomorrow :-)

Greg Andrews

unread,
Jan 12, 2015, 9:42:50 PM1/12/15
to ansible...@googlegroups.com
Off the top of my head:

  1. Do the IPv4 and IPv6 addresses have different hostnames in DNS?  If so, use the hostname for the address that's usable.
  2. In the ansible machine's .ssh/config file, you can enter something like this:
HOST problem-hostname
    AddressFamily inet

According to my man page for ssh_config, "inet" is IPv4 and "inet6" is IPv6.

  -Greg

On Mon, Jan 12, 2015 at 4:04 PM, John Oliver <jno...@gmail.com> wrote:
I've run into a minor problem where one of my hosts has an AAAA record for an address assigned via DHCP6, but it isn't acquiring that address.  I can connect via the IPv4 address just fine.  I'm looking for a switch to tell ansible / ansible-playbook to force a connection over one protocol so I don't have to come up with some lower-level hack, forget about it, and have it cause another problem tomorrow :-)

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2eff39ce-0f31-4d36-9a29-58f8bf37d5ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Bamford

unread,
Jan 13, 2015, 2:49:18 AM1/13/15
to ansible...@googlegroups.com
Should be able to do this with ssh-config.

Don't forget to tell your client to fix their brain-dead DNS! :-)

On 13 January 2015 at 02:04, John Oliver <jno...@gmail.com> wrote:
I've run into a minor problem where one of my hosts has an AAAA record for an address assigned via DHCP6, but it isn't acquiring that address.  I can connect via the IPv4 address just fine.  I'm looking for a switch to tell ansible / ansible-playbook to force a connection over one protocol so I don't have to come up with some lower-level hack, forget about it, and have it cause another problem tomorrow :-)

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2eff39ce-0f31-4d36-9a29-58f8bf37d5ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Tom Bamford

@Planet
ATPLANET (Pty) Ltd

Reply all
Reply to author
Forward
0 new messages