linux-system-roles/network

ipv6.dns-search not allowed for method = ignore

Closed this issue · 3 comments

Hello! We found out that ipv6.dns-search is not allowed for ignore as ipv6.method for a bridge interface.

To reproduce (on centos8 with NM):

---
- hosts: localhost
  vars:
    network_connections:
      - name: br-example
        type: bridge
        ip:
          dhcp4: false
          auto6: false
          dns:  8.8.8.8
          dns_search: google.com
          address:
            - 10.2.2.77/26
	state: up
  roles:
    - network

The error:

TASK [network : Configure networking connection profiles] ********************************************************************************************************
fatal: [localhost]: FAILED! => {"_invocation": {"module_args": {"__debug_flags": "", "connections": [{"ip": {"address": ["10.2.2.77/26"], "auto6": false, "dhcp4": false, "dns": "8.8.8.8", "dns_search": "google.com"}, "name": "br-admin", "state": "up", "type": "bridge"}], "force_state_change": false, "ignore_errors": false, "provider": "nm"}}, "changed": false, "msg": "fatal error: created connection failed to normalize: nm-connection-error-quark: ipv6.dns-search: this property is not allowed for 'method=ignore' (7)", "stderr": "\n", "stderr_lines": [""]}

Please help, thank you!

tyll commented

@liangwen12year please take a look

Hello! We found out that ipv6.dns-search is not allowed for ignore as ipv6.method for a bridge interface.

To reproduce (on centos8 with NM):

---
- hosts: localhost
  vars:
    network_connections:
      - name: br-example
        type: bridge
        ip:
          dhcp4: false
          auto6: false
          dns:  8.8.8.8
          dns_search: google.com
          address:
            - 10.2.2.77/26
	state: up
  roles:
    - network

The error:

TASK [network : Configure networking connection profiles] ********************************************************************************************************
fatal: [localhost]: FAILED! => {"_invocation": {"module_args": {"__debug_flags": "", "connections": [{"ip": {"address": ["10.2.2.77/26"], "auto6": false, "dhcp4": false, "dns": "8.8.8.8", "dns_search": "google.com"}, "name": "br-admin", "state": "up", "type": "bridge"}], "force_state_change": false, "ignore_errors": false, "provider": "nm"}}, "changed": false, "msg": "fatal error: created connection failed to normalize: nm-connection-error-quark: ipv6.dns-search: this property is not allowed for 'method=ignore' (7)", "stderr": "\n", "stderr_lines": [""]}

Please help, thank you!

The network role's understanding about if a configuration is valid relates to how NetworkManager treats it, becasue the network role called libnm's nm_connection_verify() when settiing up a connection. In NetworkManager, ipv6.dns-search is not allowed when ipv6.method is ignore.

The next step: allow configuring the above dns search setting for ipv4 nameserver only and silently ignore the dns search setting for ipv6 nameserver.