What is wrong with this class?

22 views
Skip to first unread message

Stuart Cracraft

unread,
Nov 14, 2013, 4:46:24 PM11/14/13
to puppet...@googlegroups.com
 
somefile.pp
 
class mumble {
}
 
class mumble::testcontents inherits mumble {
  file { "/tmp/testfile":
     path => "/tmp/testfile,
     ensure => present,
    mode => 0640,
    content => "I am a test file.",
 
 
 
puppet parser validate passed it.
 
puppet apply says it is run
 
yet no /tmp/testfile appears
 
the puppet master is running and this is being done on the puppet master.
the agent on the puppet master is running.
 

Jo Rhett

unread,
Nov 15, 2013, 4:27:06 AM11/15/13
to puppet...@googlegroups.com
There's no call to invoke your class, and there's no closing bracket on the testcontents class.  I think you only need to put the closing bracket, and then outside of the class invoke it. You also don't need inheritance.  So like

somefile.pp:
class { 'mumble::testcontents': } # this is your invocation

class mumble {}
…etc

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/26c6e69c-76e4-4ff6-a4ed-b07aa6ae7957%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
Jo Rhett
Net Consonance : net philanthropy to improve open source and internet projects.




jcbollinger

unread,
Nov 15, 2013, 9:17:58 AM11/15/13
to puppet...@googlegroups.com


Other than the problems Jo pointed out, it is a bit inconsistent to combine "ensure => present" with any specified 'content'.  If you intend for the target to be a regular file, then you should "ensure => 'file'", and if you don't care whether it's a regular file then it doesn't make sense to specify content.


John

Stuart Cracraft

unread,
Nov 15, 2013, 2:30:51 PM11/15/13
to puppet...@googlegroups.com
 
This is all working now so it's in good shape. Able to get it up yesterday.
 
Good stuff!
Reply all
Reply to author
Forward
0 new messages