Search code examples
puppetdhcp

puppetlabs-dhcp: Could not find dependency File[/etc/dhcp/dhcpd.conf]


I'm pretty new to puppet and I'm trying to use the module puppetlabs-dhcp (v0.3.0) with puppet master/agent v3.7.2. I'm using a very simple class declaration following the example given by the README file. When I try to run the class on the node using puppet agent -t the run fails with the error

Error: Failed to apply catalog: Could not find dependency File[/etc/dhcp/dhcpd.conf] for Service[isc-dhcp-server] at /etc/puppet/modules/dhcp/manifests/init.pp:173

I tried adding a file resource before the dhcp class declaration but the file stays blank. None of the configurations are taken into account. I checked the dependencies:

  • concat > 1.0.1 (using 2.0.2)
  • stdlib > 2.0.0 (using 4.13.1)

Here is the dhcp portion of the node in site.pp:

class {'dhcp':
  dnsdomain      => [
    'jecks.lab',
    '0.0.10.IN-ADDR.ARPA',],
  nameservers    => ['10.0.0.2'],
  ntpservers     => ['us.pool.ntp.org'],
  interfaces     => ['eth0','eth1'],
}   
dhcp::pool{'ops.jecks.lab':
  network => '10.0.0.0',
  mask    => '255.255.255.0',
  range   => ['10.0.0.100','10.0.0.254'],
  gateway => '10.0.0.1',
}
dhcp::host {'debian-main':
  mac => 'xxxxxxxxxxxxxx',
  ip  => '10.0.0.3',
}

What am I doing wrong? I assumed the dhcpd.conf file was created using concat from the parameters given in the class declaration.


Solution

  • This is a bug in puppetlabs-dhcp 0.3.0 when using concat 2.x that was fixed in 0.4.0. Using a newer version of the dhcp module or downgrading concat to 1.x would fix it.

    Note that the puppetlabs-dhcp module moved to the Vox Pupuli community organisation a while ago, so you can find updates at puppet/dhcp on the Forge. The latest at the time of writing is 1.0.1, rather than 0.3.0.