salt icon indicating copy to clipboard operation
salt copied to clipboard

[Windows] network.managed cannot set interface with blank DNS servers

Open omgitsedwin opened this issue 8 years ago • 2 comments

Description of Issue/Question

Windows allows leaving the DNS servers empty if DNS is not used. However, Salt requires DNS servers when using network.managed states. This seems to be an old issue #18513.

Setup

The following .sls:

Local Area Connection:
  network:
    - managed
    - dns_proto: static
    - dns_servers: []
    - ip_proto: static
    - ip_addrs:
      - 10.8.1.32/24

results in:

          ID: Local Area Connection
    Function: network.managed
      Result: False
     Comment: The following SLS configuration errors were detected: The dns_servers param is required to set static DNS servers.
     Started: 19:38:09.632453
    Duration: 32.004 ms
     Changes:   

Likewise:

Local Area Connection:
  network:
    - managed
    - dns_proto: None
    - ip_proto: static
    - ip_addrs:
      - 10.8.1.32/24

results in:

          ID: Local Area Connection
    Function: network.managed
      Result: False
     Comment: dns_proto must be one of the following: static, dhcp.
     Started: 19:48:42.866864
    Duration: 0.5 ms
     Changes:   

Steps to Reproduce Issue

Any way to get around putting in DNS servers for Windows minion in .sls file?

Versions Report

Salt Version:
           Salt: 2018.3.2
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Aug  4 2017, 00:39:18)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4
 
System Versions:
           dist: centos 7.4.1708 Core
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-693.el7.x86_64
         system: Linux
        version: CentOS Linux 7.4.1708 Core

omgitsedwin avatar Sep 20 '18 19:09 omgitsedwin

@twangboy @dwoz FYI.

garethgreenaway avatar Sep 21 '18 16:09 garethgreenaway

The above PR should fix this issue. It will be in 2017.7.9 and 2018.3.4.

twangboy avatar Sep 24 '18 21:09 twangboy