The Puppet Labs Issue Tracker has Moved:

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using See the following page for information on filing tickets with JIRA:

Bug #8096

Shouldn't be able to declare both "name" and namevar for types that have namevars

Added by Nick Fagerlund almost 5 years ago. Updated over 4 years ago.

Status:AcceptedStart date:06/24/2011
Priority:NormalDue date:
Assignee:-% Done:


Target version:3.x
Affected Puppet version: Branch:

We've Moved!

Ticket tracking is now hosted in JIRA:


These both work:

file {'myfile':
  ensure => file,
  content => "hi there",
  path => "/tmp/pathfile",
  name => "/tmp/namefile",

exec {'myexec':
  logoutput => true,
  command => '/opt/local/bin/cowsay "from command"',
  name => '/opt/local/bin/cowsay "from name"',

Luke informed us that this used to throw an exception, though I haven’t tested to find out which versions that applies to.

Nigel and I think “name” just shouldn’t be allowed if there’s a declared namevar like “path;” it’s not introspectible, and amounts to a secret backdoor that leads to illegible Puppet code. Luke said he doesn’t have a philosophical problem with doing that, but he believes we should do a real deprecation instead of silently fixing it, since it’s a change in behavior that might cause some unknown amount of havoc out in the wild.

Related issues

Related to Puppet - Bug #8079: Metaparameter 'name' is not documented Closed 06/24/2011


#1 Updated by Nick Fagerlund almost 5 years ago

Also, spoiler alert, “name” always wins out over the namevar in the examples above.

#2 Updated by Henrik Lindberg almost 5 years ago

Is ‘name’ valid if no other namevar has been declared? Or, does that mean that the type is not name-able… ?

#3 Updated by Nick Fagerlund almost 5 years ago

If no other namevar has been declared, “name” IS the namevar. (I realize I’m replying to you twice! I just want to make sure context is findable from both places.)

#4 Updated by Nigel Kersten over 4 years ago

  • Target version set to 3.x

Also available in: Atom PDF