Bug #11369

puppet resource returns title and not name

Added by Garrett Honeycutt over 1 year ago. Updated over 1 year ago.

Status:AcceptedStart date:12/13/2011
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
Affected Puppet version:2.7.6 Branch:
Keywords:resource

Description

This was tested on CentOS 5.7 using Puppet Enterprise 2.0

This lists the package as apache and if you copy and paste this into a manifest and run it, then it would fail.

[root@puppet ~]# puppet resource package apache name=httpd
package { 'apache':
  ensure => '2.2.3-53.el5.centos',
}

People expect the following

[root@puppet ~]# puppet resource package apache name=httpd
package { 'httpd':
  ensure => '2.2.3-53.el5.centos',
}

History

#1 Updated by Garrett Honeycutt over 1 year ago

Submitting this during a class. This is the second class in a row to bring this up.

#2 Updated by Alan Green over 1 year ago

Good afternoon, gents!

I think I would appreciate/expect the following:

[root@puppet ~]# puppet resource package apache name=httpd
package { 'apache':
  ensure => '2.2.3-53.el5.centos',
}

Then when inquiring the status of the resource “apache” (of type package):

[root@puppet ~]# puppet resource package apache
package { 'apache':
  ensure => '2.2.3-53.el5.centos',
  name => 'httpd'

}

Or something of the like.

Thanks!

#3 Updated by Garrett Honeycutt over 1 year ago

That’s not possible to infer what the name is based on an arbitrary title. However, as we discussed in class, the output should reflect that the name attribute has been set.

So the output should look like the following, which would allow you to take the output and create a valid manifest.

[root@puppet ~]# puppet resource package apache name=httpd
package { 'apache':
  ensure => '2.2.3-53.el5.centos',
  name   => 'httpd',
}

#4 Updated by Garrett Honeycutt over 1 year ago

  • Status changed from Unreviewed to Accepted
  • Keywords set to resource

Also available in: Atom PDF