network.managed (windows) cannot set interface without DNS servers
I want to use network.managed to set up interfaces without specifying DNS servers:
"Local Area Connection 2":
network.managed:
- dns_proto: static
- dns_servers: []
#- enabled: True
#- gateway:
- ip_proto: static
- ip_addrs:
- 10.10.1.4/16
but no variant seems to work - it insists on having DNS servers listed:
ID: Local Area Connection 2
Function: network.managed
Result: False
Comment: The following SLS configuration errors were detected: The dns_servers param is required to set static DNS servers.
Changes:
Thanks for reporting this, @Supermathie.
@Supermathie, when I originally looked at this I didn't realize that you were setting dns_proto: static. This means that you want to provide your own dns servers rather than get them over dhcp. I'm guessing that you want static addresses in which case you set ip_proto: static. If you want static dns servers you will need to provide them or get them over dhcp with dns_proto: dhcp.
@jfindlay In this case I don't want to set any DNS servers but the module is forcing me to provide them.
@Supermathie, with the proposed patch, you may disable DNS by leaving dns_proto None.
"Local Area Connection 2":
network.managed:
- dns_proto: None
- ip_proto: static
- ip_addrs:
- 10.10.1.4/16
@Supermathie, I am sorry that the fix I submitted in #19968 was incomplete. I will have to work on this some more before submitting a correct fix, thanks.
Was this fixed? I'm still seeing this issue present.
@omgitsedwin This is a fairly old issue. Can you open a new one with all of your relevant details so we can get some eyes on it?
Done, thanks. See #49730.