David

Module layout looks ok from the above... 

It's probably worth checking what your puppet master modulepath is set to 
in puppet.conf, as notice you're using /etc/puppet/git/modules, rather than 
the normal /etc/puppet/modules. 

HTH
Gavin 

On Thursday, 16 January 2014 11:16:02 UTC, David Jarosch wrote:
>
> Hey guys,
>
> I'm having some problems dividing my init.pp into components like 
> package.pp, config.pp and service.pp. Unfortunately I'm getting several 
> error's after running puppet-lint like:
>
> ERROR: nrpe::package not in autoload module layout on line 1
> ERROR: nrpe::service not in autoload module layout on line 1
> ERROR: Syntax error (try running `puppet parser validate <file>`) on line 3
> ERROR: nrpe::config not in autoload module layout on line 1
>
> etc.
>
> Puppet parser show's following error:
>
> puppet parser validate /etc/puppet/git/modules/nrpe/manifests/init.pp
> Error: Could not parse for environment production: Could not match 
>  '::nrpe::package': at /etc/puppet/git/modules/nrpe/manifests/init.pp:2
>
> On client machine:
>
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Could not find class nrpe
>
> Here my code, maybe someone of you can give me a hint where to look at:
>
> *init.pp*
>
> ### INSTALLS NRPE INCLUDING DEFINING SERVER AND SETTING UP PLUGINS ###
> class nrpe {
>   class { '::nrpe::package': } ->
>   class { '::nrpe::config': }  ->
>   class { '::nrpe::service': } ->
>   Class['nrpe']
> }
>
> *package.pp*
>
> class nrpe::package {
>   package { 'nagios-nrpe-server':
>     ensure      => 'latest',
>     require     => Class['apt::update'],
>   }
>
>   ### INSTALL NRPE PLUGINS WITHOUT ADDITIONAL RECOMMENDED PACKAGES
>   exec { 'nagios-nrpe-plugin':
>     unless      => '/usr/bin/dpkg -l |grep nagios-nrpe-plugin',
>     require     => Class['nrpe::package'],
>     command     => '/usr/bin/apt-get install nagios-nrpe-plugin -y 
> --no-install-recommends';
>   }
>
>   ### INSTALL ICINGA PLUGINS WITHOUT ADDITIONAL RECOMMENDED PACKAGES
>   exec { 'nagios-plugins':
>     unless      => '/usr/bin/dpkg -l |grep nagios-plugins',
>     require     => Class['nrpe::package'],
>     command     => '/usr/bin/apt-get install nagios-plugins -y 
> --no-install-recommends';
>   }
> }
>
> *config.pp*
>
> class nrpe::config {
>   file {
>     '/etc/nagios/nrpe.cfg':
>       source    => 'puppet:///modules/nrpe/nrpe.cfg',
>       require   => Class['nrpe::package'],
>       notify    => Class['nrpe::service'],
>       mode      => '0644',
>       owner     => 'nagios',
>       group     => 'nagios';
>
>     '/etc/init.d/nrpe':
>       source    => 'puppet:///modules/nrpe/nrpe_init.d',
>       require   => Class['nrpe::package'],
>       notify    => Class['nrpe::service'],
>       mode      => '0755',
>       owner     => 'root',
>       group     => 'root';
>
>     '/etc/nagios/nrpe.d/nrpe_all.cfg':
>       source    => 'puppet:///modules/nrpe/nrpe_all',
>       require   => Class['nrpe::package'],
>       notify    => Class['nrpe::service'],
>       mode      => '0644',
>       owner     => 'nagios',
>       group     => 'nagios';
>
>     '/usr/lib/nagios/plugins/check_linux_raid':
>       source    => 'puppet:///modules/nrpe/plugins/check_linux_raid',
>       require   => Class['nrpe::package'],
>       notify    => Class['nrpe::service'],
>       mode      => '0755',
>       owner     => 'nagios',
>       group     => 'nagios';
>
>     '/usr/lib/nagios/plugins/check_md_raid':
>       source    => 'puppet:///modules/nrpe/plugins/check_md_raid',
>       require   => Class['nrpe::package'],
>       notify    => Class['nrpe::service'],
>       mode      => '0755',
>       owner     => 'nagios',
>       group     => 'nagios';
>   }
> }
>
> *service.pp*
>
> class nrpe::service {
>   service { 'nrpe':
>     ensure      => running,
>     enable      => true,
>     require     => Class['nrpe::config'],
>   }
> }
>
> *Folderstructure on Puppetmaster:*
>
> /etc/puppet/git/modules/nrpe/manifests# tree -d /etc/puppet/git/modules/
> /etc/puppet/git/modules/
> ├── nrpe
> │   ├── files
> │   │   ├── nrpe_all
> │   │   ├── nrpe_cache.cfg
> │   │   ├── nrpe.cfg
> │   │   ├── nrpe_init.d
> │   │   ├── nrpe_var
> │   │   ├── plugins
> │   │   │   ├── check_linux_raid
> │   │   │   ├── check_md_raid
> │   │   │   ├── check_memcached.pl
> │   │   │   └── check_mongodb.py
> │   ├── manifests
> │   │   ├── config.pp
> │   │   ├── init.pp
> │   │   ├── package.pp
> │   │   ├── service.pp
> │   ├── Modulefile
> │   ├── README
> │   ├── spec
> │   │   └── spec_helper.rb
> │   └── tests
> │       └── init.pp
>
>
> Cheers,
> David
>

-- 
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/ffd8b23f-6b63-4772-8c97-9b5917d6da0e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to