Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Defined resource not being found

I'm trying to migrate code from Puppet 3.7 to 4.1 and have an issue with a defined resource type that was working. I get the error "Invalid resource type resolv::resolvConf".

It was previously contained in a class but I started to try things to resolve the error, like breaking the defined resource into its own file and various renaming to get past the error now I have this:

Directory structure: Module: /etc/puppetlabs/code/environments/fab8site/modules/resolv/manifests/resolv_conf.pp

Content:

# resolv_conf.pp

class resolv::resolv_conf {

  $searchpath  = "gfoundries.com"
  $domainname  = "gfoundries.com"
  $nameservers = $environment ? {
    "production"  => undef,
    "fab8prod"    => ["10.11.35.236","10.11.39.236"],
    "fab8staging" => ["10.10.35.236","10.10.39.236"],
    "fab8site"    => ["10.10.35.236","10.10.39.236"],
    "fab8gdc"     => ["10.10.35.236","10.10.39.236"],
    "fab8idc"     => ["10.10.35.236","10.10.39.236"],
  }

  resolv::resolvConf {'gfoundries':
    domainname  => $domainname,
    searchpath  => $searchpath,
    nameservers => $nameservers,
  }
}

Defined resource type: /etc/puppetlabs/code/environments/fab8site/modules/resolv/manifests/resolvConf.pp

Content:

# resolvConf.pp

define resolv::resolvConf ($domainname = "$domain", $searchpath, $nameservers) {
  file { "/etc/resolv.conf":
    owner   => root,
    group   => root,
    mode    => 644,
    content => template("resolv/resolv.conf.erb"),
  }
}

Init.pp: /etc/puppetlabs/code/environments/fab8site/modules/resolv/manifests/init.pp

Content:

# init.pp

class resolv {

}

What have I missed?