Puppetlabs/firewall – “Could not find resource type ‘firewall'”

puppet

I'm fairly new to puppet, so this might just be me not seeing the obvious.

I want to use the puppetlabs-firewall module and wrote a small module of my own. The init.pp looks like this:

class cmmfirewall {
  resources { 'firewall':
    purge => true,
  }
  Firewall {
    before  => Class['cmmfirewall::postv4', 'cmmfirewall::postv6'],
    require => Class['cmmfirewall::prev4', 'cmmfirewall::prev6'],
  }
  class { ['cmmfirewall::prev4', 'cmmfirewall::postv4']: }
  class { ['cmmfirewall::prev6', 'cmmfirewall::postv6']: }
}

When I apply this class to a node I get the following message:

err: Failed to apply catalog: Parameter name failed on Resources[firewall]: Could not find resource type 'firewall' at /etc/puppet/environments/testing/modules/cmmfirewall/manifests/init.pp:42

My puppet.conf on the agent looks like this:

# File managed by Puppet

[main]
    vardir = /var/lib/puppet
    ssldir = $vardir/ssl
    logdir = /var/log/puppet
    rundir = /var/run/puppet
    modulepath = /etc/puppet/modules:/opt/puppet/share/puppet/modules
    user  = puppet
    group = puppet
    archive_files = true
    archive_file_server = handsoff.dc0.mynetwork.de

[agent]
    certname = test3.dc0.mynetwork.de
    server = handsoff.dc0.mynetwork.de
    report = true
    classfile = $vardir/classes.txt
    localconfig = $vardir/localconfig
    graph = true
    pluginsync = true
    runinterval = 300

So as you can see, pluginsync should be activated, but both of the folders in the modulepath /etc/puppet/modules:/opt/puppet/share/puppet/modulesare empty. So my guess would be the problem is somewhere there and pluginsync isn't working as i expect it to work.

Can someone point me in the right direction on where to look for the error, please?

Best Answer

Ok, actually the moment I copied the puppetlabs-firewall module to my common folder (which gets includes in both environments, testing and production) it worked.

Now I just really would like to now why. Here is the puppetmaster config file. Maybe someone can tell my why it behaves the way it does.

### File managed with puppet ###
## Module:           'puppet'

[main]
    # The Puppet log directory.
    # The default value is '$vardir/log'.
    logdir = /var/log/puppet

    # Where Puppet PID files are kept.
    # The default value is '$vardir/run'.
    rundir = /var/run/puppet

    # Where SSL certificates are kept.
    # The default value is '$confdir/ssl'.
    ssldir = $vardir/ssl

    # Allow services in the 'puppet' group to access key (Foreman + proxy)
    privatekeydir = $ssldir/private_keys { group = service }
    hostprivkey = $privatekeydir/$certname.pem { mode = 640 }

    # Puppet 3.0.x requires this in both [main] and [master] - harmless on agents
    autosign       = $confdir/autosign.conf { mode = 664 }

    show_diff     = false

### Next part of the file is managed by a different template ###
## Module:           'puppet'

[agent]
    # The file in which puppetd stores a list of the classes
    # associated with the retrieved configuratiion.  Can be loaded in
    # the separate ``puppet`` executable using the ``--loadclasses``
    # option.
    # The default value is '$statedir/classes.txt'.
    classfile = $vardir/classes.txt

    # Where puppetd caches the local configuration.  An
    # extension indicating the cache format is added automatically.
    # The default value is '$confdir/localconfig'.
    localconfig = $vardir/localconfig

    # Disable the default schedules as they cause continual skipped
    # resources to be displayed in Foreman - only for Puppet >= 3.4
    default_schedules = false

    report        = true
    pluginsync    = true
    masterport    = 8140
    environment   = production
    certname      = handsoff.dc0.mynetwork.de
    server        = handsoff.dc0.mynetwork.de
    listen        = false
    splay         = false
    runinterval   = 300
    noop          = false
    configtimeout = 120

### Next part of the file is managed by a different template ###
## Module:           'puppet'

[master]
    autosign       = $confdir/autosign.conf { mode = 664 }
    reports        = foreman
    external_nodes = /etc/puppet/node.rb
    node_terminus  = exec
    ca             = true
    ssldir         = /var/lib/puppet/ssl
    certname       = handsoff.dc0.mynetwork.de
    strict_variables = false

[production]
    modulepath     = /etc/puppet/environments/production/modules:/etc/puppet/environments/common:/usr/share/puppet/modules
    config_version = 
[testing]
    modulepath     = /etc/puppet/environments/testing/modules:/etc/puppet/environments/common:/usr/share/puppet/modules
    config_version =