Ask Your Question

Defined resource not being found

asked 2015-06-05 18:01:15 -0600

wgoodric gravatar image

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


# resolv_conf.pp

class resolv::resolv_conf {

  $searchpath  = ""
  $domainname  = ""
  $nameservers = $environment ? {
    "production"  => undef,
    "fab8prod"    => ["",""],
    "fab8staging" => ["",""],
    "fab8site"    => ["",""],
    "fab8gdc"     => ["",""],
    "fab8idc"     => ["",""],

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

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


# 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


# init.pp

class resolv {


What have I missed?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-06-06 09:32:24 -0600

GregLarkin gravatar image

Uppercase letters are not allowed in class name and defined type names, according to this document:, so "resolvConf" is not a legal name.

However, that page was the same for the 3.7 release, so I'm not sure why it worked before. It might have been loosely enforced before, but the Puppet 4.0+ language parser is stricter than it used to be, so some edge cases may no longer work.

edit flag offensive delete link more


OK so I renamed resolvConf.pp to resolvconf.pp and changed the define to resolv::resolvconf in resolv_conf.pp and same issue: Invalid resource type resolv::resolvconf at /etc/puppetlabs/code/environments/fab8site/modules/resolv/manifests/resolv_conf.pp:16:3

wgoodric gravatar imagewgoodric ( 2015-06-08 12:47:28 -0600 )edit

Hmm, strange. Other things to check - what is the output of "puppet config print modulepath"? Please post a link to a pastebin of your puppet.conf, too.

GregLarkin gravatar imageGregLarkin ( 2015-06-08 17:19:26 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-06-05 18:01:15 -0600

Seen: 266 times

Last updated: Jun 06 '15