voxpupuli / puppet-network

Types and providers to manage network interfaces
https://forge.puppet.com/puppet/network
Apache License 2.0
66 stars 107 forks source link

Option to set DNS? #235

Open mcblum opened 6 years ago

mcblum commented 6 years ago

Thanks for working this! I've read through the docs a couple times and I can't seem to actually find a way to set DNS servers. Am I just being dense?

alexjfisher commented 6 years ago

I've not tested it, but looking through the code, you might be able to use the options parameter?

network_config { 'eth0':
...
  options => {'DNS1' => '4.2.2.2'},
}
mcblum commented 6 years ago

@alexjfisher thanks! will give it a try later today.

trenta commented 5 years ago

This won't work for a network bond because the options variable is passed to the BONDING_OPTS parameter.

alexfouche commented 1 year ago

i resolved this issue with, for example


$intf = 'eth0'
$ns = ['127.0.0.1' '1.1.1.1']

network_config { $intf:
    options => {'dns-nameservers' => $ns.join('')},
}