camptocamp/puppet-bind

named-checkconf -jz /etc/named.conf' is not qualified

Closed this issue · 1 comments

puppet 3.8 on Centos 6 with manifest

node 'test' {
  include bind
}

Gives this error

==> default: Error: Parameter onlyif failed on Exec[reload bind9]: 'named-checkconf -jz /etc/named.conf' is not qualified and no path was specified. Please qualify the command or specify a path. at /tmp/vagrant-puppet/modules-b3c8b8ed0d71478610d0a1236238b87e/bind/manifests/base.pp:44

Then I changed this:

  exec {'reload bind9':
    command     => $bind::params::service_restart,
    onlyif      => "named-checkconf -jz ${bind::params::config_base_dir}/${bind::params::named_conf_name}",
    refreshonly => true,
    require     => Package['bind9'],
  }

to this

exec {'reload bind9':
    command     => $bind::params::service_restart,
    onlyif      => "/usr/sbin/named-checkconf -jz ${bind::params::config_base_dir}/${bind::params::named_conf_name}",
    refreshonly => true,
    require     => Package['bind9'],
  }

Hello,

You should add the following bloc in a top-level scope:

Exec {
  path => '/usr/bin:/bin:/usr/sbin:/sbin:.....'
}

We never put full path in our modules in order to ensure they actually work (with the mentioned bloc) anywhere, even for people with specific installation location.

Cheers,

C.