PerilousApricot
PerilousApricot

Reputation: 643

Why can't puppet find my class?

I'm trying to implement the recipe found here https://github.com/puppetlabs/puppetlabs-firewall#readme and I appear to be making a rookie puppet mistake I can't see. I have a module called mwsettings which itself can be found okay (the mwsettings/init.pp stores a helper for loading some templates and that works), but the following code in my site.pp

Firewall {
  notify  => Exec['persist-firewall'],
  before  => Class['mwsettings::postfirewall'],
  require => Class['mwsettings::prefirewall'],
}

Blows up with

Error: Failed to apply catalog: Could not find dependency Class[Mwsettings::Prefirewall] for Firewall[100 accept mysql - XXXXXXXX]

when my code later in site.pp invokes

firewall { "100 accept mysql - $name":
    proto => 'tcp',
    action => 'accept',
    dport => 3306,
    source => $name,
}

But, it appears I have the manifest set up properly for prefirewall:

# cat modules/mwsettings/manifests/prefirewall.pp 
class mwsettings::prefirewall {
  Firewall {
    require => undef,
  }
<snip>

Am I missing something incredibly trivial here? Since it's my first rodeo with puppet, I'm not even entirely sure how to debug this.

Thanks!

Upvotes: 3

Views: 11068

Answers (1)

Ger Apeldoorn
Ger Apeldoorn

Reputation: 1232

You are referring to a class that you haven't declared.

If you add this it should work :

include mwsettings::prefirewall

include mwsettings::postfirewall

Upvotes: 7

Related Questions