Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following Puppet module:

class resolvconf {
    $packages = ['resolvconf', 'dnsmasq']
    package { $packages: ensure => installed, }

    file { '/etc/resolvconf/resolv.conf.d/base':
        ensure  => file,
        owner   => root,
        group   => root,
        content => '

    service { 'dnsmasq':
        require   => Package[resolvconf],
        ensure    => running,
        subscribe => File['/etc/resolvconf/resolv.conf.d/base']

However, when I run the provisioning, I get the following error:

err: /Stage[main]/Resolvconf/File[/etc/resolvconf/resolv.conf.d/base]/ensure: change from absent to file failed: Could not set 'file on ensure: No such file or directory - /etc/resolvconf/resolv.conf.d/base.puppettmp_4012 at /tmp/vagrant-puppet/modules-0/resolvconf/manifests/init.pp:13

I understand this to mean that /etc/resolvconf/resolv.conf.d/base does not exist yet, or can't be created. This problem seems to eventually go away after a number of re-provisionings or a reboot, so it would seem to be some sort of a dependency problem that I could resolve with the appropriate dependency or exec statement.

In addition, because of this failed dependency, the following will hang indefinitely:

notice: /Stage[main]/Resolvconf/Service[dnsmasq]: Dependency File[/etc/resolvconf/resolv.conf.d/base] has failures: true
warning: /Stage[main]/Resolvconf/Service[dnsmasq]: Skipping because of failed dependencies

or at least until I hit CTRL-C.

What do I need to change in the module or manifest to allow the script to run correctly the first time through?

share|improve this question

migrated from Aug 10 '12 at 23:28

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

Add a line to require the package in your file resource like this:

file { '/etc/resolvconf/resolv.conf.d/base':
    ensure  => file,
    owner   => root,
    group   => root,
    content => '...
    require => Package['resolvconf'],

Using a require basically forced puppet to perform the package install first.

This of course assumes that the installation of the resolvconf package creates the required directories, which I believe it does happen.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.