3

In order to set up a manual ipv6 address in RHEL7 using nmcli, one would do:

nmcli con modify eth1 ipv6.method manual ipv6.addresses "abba::cafe/64"

However, I can't figure out how to do the same with ansible's nmcli module. I have the following task:

- name: "setup ipv6 address (eth1)"
  nmcli:
    conn_name: "eth1"
    type: ethernet
    ip6: "{{ networking_ipv6_eth1_addr }}"
    gw6: "{{ networking_ipv6_eth1_gw }}"
    state: present

The problem is there's no method parameter, which in some cases results in an error when the ipv6.method value is incompatible with setting a manual IPv6 address:

Error: Failed to modify connection 'eth1': ipv6.addresses: this property is not allowed for 'method=ignore

I could probably fix this by setting ipv6.method to auto in a shell task before this one (it doesn't throw the error), and to manual after, but that is an awful solution.

Is there a proper way to achieve this?

André Fernandes
  • 2,335
  • 3
  • 25
  • 33

2 Answers2

0

The parameter exists it's called method6

See HERE

W4hf
  • 715
  • 1
  • 5
  • 12
-1
nmcli con modify eth1 ipv6.addresses "" ipv6.gateway "" ipv6.method disabled
ParkMan
  • 1
  • 1