voxpupuli / puppet-system

Manage Linux system resources and services from hiera configuration
https://forge.puppet.com/puppet/system
Apache License 2.0
63 stars 47 forks source link

network/dns template is completely wrong (options, search) #37

Closed otheus closed 5 years ago

otheus commented 7 years ago

Affected Puppet, Ruby, OS and module versions/distributions

Problem description

Problem affects any users of system::network::dns: with search or options.

The template is incorrect and produces bad results. The results of the following hiera:

system::network::dns:
  nameservers: [ 8.8.8.8 ] 
  domains:
    - internal.domain.eu
    - domain.eu
  options:
    - optionA
    - optionB

produces the following resolv.conf, which is incorrect format of a resolv.conf:

# File managed by Puppet
nameserver 8.8.8.8
search internal.domain.eu
search domain.eu
options optionA
options optionB

This is incorrect behavior and will result in the first search and first options from being ignored. That is, in the above case, the internal.domain.edu domain will not be searched.

Rather, according to resolv.conf(5) man page, the produced file should be:

# File managed by Puppet
nameserver 8.8.8.8
search internal.domain.eu domain.eu
options optionA optionB
otheus commented 5 years ago

Fixed by https://github.com/voxpupuli/puppet-system/pull/38