voxpupuli/puppet-system

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

Closed this issue · 1 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: all
  • Ruby: all
  • Distribution: latest
  • Module version: all

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

Fixed by #38