On Tuesday, April 26, 2016 at 9:38:24 AM UTC-5, Tony Davis wrote:
>
> Hi, I'm fairly new to puppet but I've been trying to create some puppet 
> modules to help me maintain my various PCs/laptops at home. I have created 
> the following module:
>
> my module init.pp contains
>
>
> class bleachbit {
>   include bleachbit::install
>   include bleachbit::cronadd
> }
>
> install.pp has
>
> class bleachbit::install {
>   package { 'bleachbit':
>     ensure => installed,
>     notify => Cronadd['bleachbit'],
>   }
> }
>
> cronadd.pp has
>
> class bleachbit::cronadd {
>   cron { 'bleachbit':
>     ensure  => present,
>     command => '/usr/bin/bleachbit',
>     user    => 'root',
>     weekday => '*',
>     minute  => '10',
>     hour    => '11',
>     subscribe => Package['bleachbit'],
>   }
> }
>
> site.pp has 
>
> node 'Microserver' {
>     include bleachbit
>     include testfile
> }
>
> when I run "puppet apply manifests" bleachbit is installed fine but the 
> cronadd subclass is completely ignored.
>
>

That seems surprising.  Indeed, *very* surprising.  If Puppet's catalog 
builder sees an 'include' statement naming a class that it cannot find, 
then it will error out.  As a result, I'm inclined to think that there is 
some sort of confusion about which file is where.  In particular, I suspect 
that you have multiple versions of class bleachbit floating around, and the 
one Puppet chooses is not the one you've presented.

 

>  I have checked the syntax with puppet-lint
> and it seems fine. Also, if create cronadd as a separate module, it works 
> fine.
>
>

I'm not sure off-hand whether I should expect puppet-lint to catch it, but 
the class bleachbit::install that you presented is broken.  It contains a 
resource reference to a non-existent resource, 

Cronadd['bleachbit']. I suspect you meant Class['cronadd::bleachbit'] there.  
The manifest set you presented would not be accepted by the catalog builder.

 I don't understand what the problem is. Running with --debug gives no clues.
>
>

And I don't think you've given us enough clues to really nail down an 
answer, but if 'puppet apply --debug' truly issues no complaints then it 
cannot be operating on the manifest set you presented.  That could 
certainly create some confusion.


John

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/58d1d036-532d-4d42-ac10-5ebbfa5a880f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to