I have installed puppet 3.1.1 from the Puppet Labs APT repository on Ubuntu 12.04. I installed the ploperations-puppet module from Puppet Forge to manage the puppet agent config and package installations on my client systems. I had some issues so I scaled back to write my own but still use the ploperations-puppetlabs_apt and stahnma-puppetlabs_yum modules to manage the repositories.
For the following tests the agent is on the master.
Now with the following site.pp
node default {
class { "puppetlabs_apt":
}
}
I get the following error:
# puppet agent --test
Info: Retrieving plugin
Notice: /File[/var/lib/puppet/lib/puppet]/ensure: removed
Notice: /File[/var/lib/puppet/lib/facter/puppet_path.rb]/ensure: removed
Notice: /File[/var/lib/puppet/lib/facter/util]/ensure: removed
Notice: /File[/var/lib/puppet/lib/facter/certname.rb]/ensure: removed
Notice: /File[/var/lib/puppet/lib/facter/root_home.rb]/ensure: removed
Notice: /File[/var/lib/puppet/lib/facter/puppet_vardir.rb]/ensure: removed
Notice: /File[/var/lib/puppet/lib/facter/pe_version.rb]/ensure: removed
Notice: /File[/var/lib/puppet/lib/facter/concat_basedir.rb]/ensure: removed
Notice: /File[/var/lib/puppet/lib/facter/confenv.rb]/ensure: removed
Notice: /File[/var/lib/puppet/lib/facter/puppet_semantic_version.rb]/ensure: removed
Info: Loading facts in /etc/puppet/modules/puppetlabs_yum/lib/facter/os_maj_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/os_maj_version.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class puppetlabs_apt at /etc/puppet/manifests/site.pp:3 on node mgmt.example.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Testing with the ricardogarcia-helloworld and the puppetlabs_yum module is successful. Furthermore, the following test with puppet apply
is successful(site.pp is identical to above):
# puppet apply /etc/puppet/manifests/site.pp
WARN: Fri Apr 19 16:43:32 +0000 2013: Not using Hiera::Puppet_logger. It does not report itself to be suitable.
DEBUG: Fri Apr 19 16:43:32 +0000 2013: Hiera YAML backend starting
DEBUG: Fri Apr 19 16:43:32 +0000 2013: Looking up puppetlabs_apt::enable_devel in YAML backend
DEBUG: Fri Apr 19 16:43:32 +0000 2013: Looking for data source mgmt.example.com
DEBUG: Fri Apr 19 16:43:32 +0000 2013: Cannot find datafile /etc/puppet/hieradata/mgmt.example.com.yaml, skipping
DEBUG: Fri Apr 19 16:43:32 +0000 2013: Looking for data source common
DEBUG: Fri Apr 19 16:43:32 +0000 2013: Hiera JSON backend starting
DEBUG: Fri Apr 19 16:43:32 +0000 2013: Looking up puppetlabs_apt::enable_devel in JSON backend
DEBUG: Fri Apr 19 16:43:32 +0000 2013: Looking for data source mgmt.example.com
DEBUG: Fri Apr 19 16:43:32 +0000 2013: Cannot find datafile /etc/puppet/hieradata/mgmt.example.com.json, skipping
DEBUG: Fri Apr 19 16:43:32 +0000 2013: Looking for data source common
DEBUG: Fri Apr 19 16:43:32 +0000 2013: Cannot find datafile /etc/puppet/hieradata/common.json, skipping
Notice: Finished catalog run in 0.16 seconds
Finally, debugging the master gives the follwoing output when the puppet agent is run:
# puppet master --debug --no-daemonize
Debug: Failed to load library 'selinux' for feature 'selinux'
Debug: Using settings: adding file resource 'libdir': 'File[/var/lib/puppet/lib]{:links=>:follow, :ensure=>:directory, :backup=>false, :loglevel=>:debug, :path=>"/var/lib/puppet/lib"}'
Debug: Using settings: adding file resource 'vardir': 'File[/var/lib/puppet]{:links=>:follow, :ensure=>:directory, :backup=>false, :loglevel=>:debug, :path=>"/var/lib/puppet"}'
Debug: Puppet::Type::User::ProviderPw: file pw does not exist
Debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist
Debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/uuidgen does not exist
Debug: Failed to load library 'ldap' for feature 'ldap'
Debug: Puppet::Type::User::ProviderLdap: feature ldap is missing
Debug: Puppet::Type::Group::ProviderPw: file pw does not exist
Debug: Puppet::Type::Group::ProviderDirectoryservice: file /usr/bin/dscl does not exist
Debug: Failed to load library 'ldap' for feature 'ldap'
Debug: Puppet::Type::Group::ProviderLdap: feature ldap is missing
Debug: Using settings: adding file resource 'server_datadir': 'File[/var/lib/puppet/server_data]{:links=>:follow, :group=>"puppet", :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"750", :loglevel=>:debug, :path=>"/var/lib/puppet/server_data"}'
Debug: Using settings: adding file resource 'hostpubkey': 'File[/var/lib/puppet/ssl/public_keys/mgmt.example.com.pem]{:links=>:follow, :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"644", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/public_keys/mgmt.example.com.pem"}'
Debug: Using settings: adding file resource 'rundir': 'File[/var/run/puppet]{:links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"1777", :loglevel=>:debug, :path=>"/var/run/puppet"}'
Debug: Using settings: adding file resource 'manifestdir': 'File[/etc/puppet/manifests]{:links=>:follow, :ensure=>:directory, :backup=>false, :loglevel=>:debug, :path=>"/etc/puppet/manifests"}'
Debug: Using settings: adding file resource 'publickeydir': 'File[/var/lib/puppet/ssl/public_keys]{:links=>:follow, :ensure=>:directory, :backup=>false, :owner=>"puppet", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/public_keys"}'
Debug: Using settings: adding file resource 'masterhttplog': 'File[/var/log/puppet/masterhttp.log]{:links=>:follow, :group=>"puppet", :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"660", :loglevel=>:debug, :path=>"/var/log/puppet/masterhttp.log"}'
Debug: Using settings: adding file resource 'bucketdir': 'File[/var/lib/puppet/bucket]{:links=>:follow, :group=>"puppet", :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"750", :loglevel=>:debug, :path=>"/var/lib/puppet/bucket"}'
Debug: Using settings: adding file resource 'privatedir': 'File[/var/lib/puppet/ssl/private]{:links=>:follow, :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"750", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/private"}'
Debug: Using settings: adding file resource 'hostcert': 'File[/var/lib/puppet/ssl/certs/mgmt.example.com.pem]{:links=>:follow, :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"644", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/certs/mgmt.example.com.pem"}'
Debug: Using settings: adding file resource 'hiera_config': 'File[/etc/puppet/hiera.yaml]{:links=>:follow, :ensure=>:file, :backup=>false, :loglevel=>:debug, :path=>"/etc/puppet/hiera.yaml"}'
Debug: Using settings: adding file resource 'logdir': 'File[/var/log/puppet]{:links=>:follow, :group=>"puppet", :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"750", :loglevel=>:debug, :path=>"/var/log/puppet"}'
Debug: Using settings: adding file resource 'localcacert': 'File[/var/lib/puppet/ssl/certs/ca.pem]{:links=>:follow, :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"644", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/certs/ca.pem"}'
Debug: Using settings: adding file resource 'fileserverconfig': 'File[/etc/puppet/fileserver.conf]{:links=>:follow, :ensure=>:file, :backup=>false, :loglevel=>:debug, :path=>"/etc/puppet/fileserver.conf"}'
Debug: Using settings: adding file resource 'hostcrl': 'File[/var/lib/puppet/ssl/crl.pem]{:links=>:follow, :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"644", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/crl.pem"}'
Debug: Using settings: adding file resource 'rrddir': 'File[/var/lib/puppet/rrd]{:links=>:follow, :group=>"puppet", :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"750", :loglevel=>:debug, :path=>"/var/lib/puppet/rrd"}'
Debug: Using settings: adding file resource 'manifest': 'File[/etc/puppet/manifests/site.pp]{:links=>:follow, :ensure=>:file, :backup=>false, :loglevel=>:debug, :path=>"/etc/puppet/manifests/site.pp"}'
Debug: Using settings: adding file resource 'certdir': 'File[/var/lib/puppet/ssl/certs]{:links=>:follow, :ensure=>:directory, :backup=>false, :owner=>"puppet", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/certs"}'
Debug: Using settings: adding file resource 'requestdir': 'File[/var/lib/puppet/ssl/certificate_requests]{:links=>:follow, :ensure=>:directory, :backup=>false, :owner=>"puppet", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/certificate_requests"}'
Debug: Using settings: adding file resource 'rest_authconfig': 'File[/etc/puppet/auth.conf]{:links=>:follow, :ensure=>:file, :backup=>false, :loglevel=>:debug, :path=>"/etc/puppet/auth.conf"}'
Debug: Using settings: adding file resource 'confdir': 'File[/etc/puppet]{:links=>:follow, :ensure=>:directory, :backup=>false, :loglevel=>:debug, :path=>"/etc/puppet"}'
Debug: Using settings: adding file resource 'yamldir': 'File[/var/lib/puppet/yaml]{:links=>:follow, :group=>"puppet", :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"750", :loglevel=>:debug, :path=>"/var/lib/puppet/yaml"}'
Debug: Using settings: adding file resource 'hostprivkey': 'File[/var/lib/puppet/ssl/private_keys/mgmt.example.com.pem]{:links=>:follow, :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"600", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/private_keys/mgmt.example.com.pem"}'
Debug: Using settings: adding file resource 'reportdir': 'File[/var/lib/puppet/reports]{:links=>:follow, :group=>"puppet", :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"750", :loglevel=>:debug, :path=>"/var/lib/puppet/reports"}'
Debug: Using settings: adding file resource 'statedir': 'File[/var/lib/puppet/state]{:links=>:follow, :ensure=>:directory, :backup=>false, :mode=>"1755", :loglevel=>:debug, :path=>"/var/lib/puppet/state"}'
Debug: Using settings: adding file resource 'ssldir': 'File[/var/lib/puppet/ssl]{:links=>:follow, :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"771", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl"}'
Debug: Using settings: adding file resource 'privatekeydir': 'File[/var/lib/puppet/ssl/private_keys]{:links=>:follow, :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"750", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/private_keys"}'
Debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring File[/var/lib/puppet/ssl/certs]
Debug: /File[/etc/puppet/auth.conf]: Autorequiring File[/etc/puppet]
Debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring File[/var/lib/puppet/ssl]
Debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet]
Debug: /File[/etc/puppet/manifests]: Autorequiring File[/etc/puppet]
Debug: /File[/var/log/puppet/masterhttp.log]: Autorequiring File[/var/log/puppet]
Debug: /File[/var/lib/puppet/ssl/private]: Autorequiring File[/var/lib/puppet/ssl]
Debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring File[/var/lib/puppet/ssl]
Debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring File[/var/lib/puppet/ssl]
Debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]
Debug: /File[/var/lib/puppet/ssl/private_keys/mgmt.example.com.pem]: Autorequiring File[/var/lib/puppet/ssl/private_keys]
Debug: /File[/var/lib/puppet/ssl/certs/mgmt.example.com.pem]: Autorequiring File[/var/lib/puppet/ssl/certs]
Debug: /File[/var/lib/puppet/bucket]: Autorequiring File[/var/lib/puppet]
Debug: /File[/var/lib/puppet/server_data]: Autorequiring File[/var/lib/puppet]
Debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet]
Debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring File[/var/lib/puppet/ssl]
Debug: /File[/var/lib/puppet/ssl/public_keys/mgmt.example.com.pem]: Autorequiring File[/var/lib/puppet/ssl/public_keys]
Debug: /File[/var/lib/puppet/yaml]: Autorequiring File[/var/lib/puppet]
Debug: /File[/etc/puppet/fileserver.conf]: Autorequiring File[/etc/puppet]
Debug: /File[/etc/puppet/manifests/site.pp]: Autorequiring File[/etc/puppet/manifests]
Debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring File[/var/lib/puppet/ssl]
Debug: /File[/etc/puppet/hiera.yaml]: Autorequiring File[/etc/puppet]
Debug: /File[/var/lib/puppet/reports]: Autorequiring File[/var/lib/puppet]
Debug: /File[/var/lib/puppet/rrd]: Autorequiring File[/var/lib/puppet]
Debug: Finishing transaction 70187171513100
Debug: Using settings: adding file resource 'csrdir': 'File[/var/lib/puppet/ssl/ca/requests]{:links=>:follow, :group=>"puppet", :ensure=>:directory, :backup=>false, :owner=>"puppet", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/ca/requests"}'
Debug: Using settings: adding file resource 'cacert': 'File[/var/lib/puppet/ssl/ca/ca_crt.pem]{:links=>:follow, :group=>"puppet", :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"660", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/ca/ca_crt.pem"}'
Debug: Using settings: adding file resource 'cacrl': 'File[/var/lib/puppet/ssl/ca/ca_crl.pem]{:links=>:follow, :group=>"puppet", :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"664", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/ca/ca_crl.pem"}'
Debug: Using settings: adding file resource 'signeddir': 'File[/var/lib/puppet/ssl/ca/signed]{:links=>:follow, :group=>"puppet", :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"770", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/ca/signed"}'
Debug: Using settings: adding file resource 'serial': 'File[/var/lib/puppet/ssl/ca/serial]{:links=>:follow, :group=>"puppet", :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"644", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/ca/serial"}'
Debug: Using settings: adding file resource 'cakey': 'File[/var/lib/puppet/ssl/ca/ca_key.pem]{:links=>:follow, :group=>"puppet", :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"660", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/ca/ca_key.pem"}'
Debug: Using settings: adding file resource 'caprivatedir': 'File[/var/lib/puppet/ssl/ca/private]{:links=>:follow, :group=>"puppet", :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"770", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/ca/private"}'
Debug: Using settings: adding file resource 'capass': 'File[/var/lib/puppet/ssl/ca/private/ca.pass]{:links=>:follow, :group=>"puppet", :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"660", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/ca/private/ca.pass"}'
Debug: Using settings: adding file resource 'cert_inventory': 'File[/var/lib/puppet/ssl/ca/inventory.txt]{:links=>:follow, :group=>"puppet", :ensure=>:file, :backup=>false, :owner=>"puppet", :mode=>"644", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/ca/inventory.txt"}'
Debug: Using settings: adding file resource 'cadir': 'File[/var/lib/puppet/ssl/ca]{:links=>:follow, :group=>"puppet", :ensure=>:directory, :backup=>false, :owner=>"puppet", :mode=>"770", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/ca"}'
Debug: Using settings: adding file resource 'capub': 'File[/var/lib/puppet/ssl/ca/ca_pub.pem]{:links=>:follow, :group=>"puppet", :ensure=>:file, :backup=>false, :owner=>"puppet", :loglevel=>:debug, :path=>"/var/lib/puppet/ssl/ca/ca_pub.pem"}'
Debug: /File[/var/lib/puppet/ssl/ca/ca_key.pem]: Autorequiring File[/var/lib/puppet/ssl/ca]
Debug: /File[/var/lib/puppet/ssl/ca/requests]: Autorequiring File[/var/lib/puppet/ssl/ca]
Debug: /File[/var/lib/puppet/ssl/ca/serial]: Autorequiring File[/var/lib/puppet/ssl/ca]
Debug: /File[/var/lib/puppet/ssl/ca/ca_pub.pem]: Autorequiring File[/var/lib/puppet/ssl/ca]
Debug: /File[/var/lib/puppet/ssl/ca/private/ca.pass]: Autorequiring File[/var/lib/puppet/ssl/ca/private]
Debug: /File[/var/lib/puppet/ssl/ca/ca_crt.pem]: Autorequiring File[/var/lib/puppet/ssl/ca]
Debug: /File[/var/lib/puppet/ssl/ca/ca_crl.pem]: Autorequiring File[/var/lib/puppet/ssl/ca]
Debug: /File[/var/lib/puppet/ssl/ca/inventory.txt]: Autorequiring File[/var/lib/puppet/ssl/ca]
Debug: /File[/var/lib/puppet/ssl/ca/private]: Autorequiring File[/var/lib/puppet/ssl/ca]
Debug: /File[/var/lib/puppet/ssl/ca/signed]: Autorequiring File[/var/lib/puppet/ssl/ca]
Debug: Finishing transaction 70187171795120
Debug: Using cached certificate for ca
Debug: Using cached certificate for ca
Debug: Using cached certificate for mgmt.example.com
Debug: Using settings: adding file resource 'config': 'File[/etc/puppet/puppet.conf]{:links=>:follow, :ensure=>:file, :backup=>false, :loglevel=>:debug, :path=>"/etc/puppet/puppet.conf"}'
Debug: Finishing transaction 70187170837620
Notice: Starting Puppet master version 3.1.1
Info: access[^/catalog/([^/]+)$]: allowing 'method' find
Info: access[^/catalog/([^/]+)$]: allowing $1 access
Info: access[^/node/([^/]+)$]: allowing 'method' find
Info: access[^/node/([^/]+)$]: allowing $1 access
Info: access[/certificate_revocation_list/ca]: allowing 'method' find
Info: access[/certificate_revocation_list/ca]: allowing * access
Info: access[^/report/([^/]+)$]: allowing 'method' save
Info: access[^/report/([^/]+)$]: allowing $1 access
Info: access[/file]: allowing * access
Info: access[/certificate/ca]: adding authentication any
Info: access[/certificate/ca]: allowing 'method' find
Info: access[/certificate/ca]: allowing * access
Info: access[/certificate/]: adding authentication any
Info: access[/certificate/]: allowing 'method' find
Info: access[/certificate/]: allowing * access
Info: access[/certificate_request]: adding authentication any
Info: access[/certificate_request]: allowing 'method' find
Info: access[/certificate_request]: allowing 'method' save
Info: access[/certificate_request]: allowing * access
Info: access[/]: adding authentication any
Info: Inserting default '/status' (auth true) ACL
Info: Caching node for mgmt.example.com
Debug: No plugins found in subpath '/etc/puppet/modules/ntp/lib' (file / directory does not exist)
Debug: No plugins found in subpath '/etc/puppet/modules/helloworld/lib' (file / directory does not exist)
Debug: No plugins found in subpath '/etc/puppet/modules/apt/lib' (file / directory does not exist)
Debug: No plugins found in subpath '/etc/puppet/modules/puppetlabs_apt/lib' (file / directory does not exist)
Info: Caching node for mgmt.example.com
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class puppetlabs_apt at /etc/puppet/manifests/site.pp:3 on node mgmt.example.com
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class puppetlabs_apt at /etc/puppet/manifests/site.pp:3 on node mgmt.example.com
Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Could not find declared class puppetlabs_apt at /etc/puppet/manifests/site.pp:3 on node mgmt.example.com
Debug: Finishing transaction 70187171703400
Debug: Received report to process from mgmt.example.com
Debug: Processing report from mgmt.example.com with processor Puppet::Reports::Store
I have also attempted using include puppetlabs_apt
in place of the class manner.
What else can I do to find out why the master can't find this module, but it can find other ones installed in the same location?
It looks like a permissions issue.
Making puppetlabs_apt world readable allowed the puppet master to find it. This explains the difference between master/agent and
puppet apply
.This is just another manifestation of bug #14333
Are you trying to use the puppetlabs-apt module from the forge? Forge modules are named as "moduleauthor/modulename", but when included, should just be "modulename".
If you change your code to the following, it should work: