Tuesday, November 24, 2020

Puppet executable missing puppet gem

 

PROBLEM:

[root@MoM 2019.8.4]# puppet agent -t;

Traceback (most recent call last):

        1: from /opt/puppetlabs/server/apps/bolt-server/bin/puppet:23:in `<main>'

/opt/puppetlabs/server/apps/bolt-server/bin/puppet:23:in `load': cannot load such file -- /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/puppet-6.19.1/bin/puppet (LoadError)

[root@MoM 2019.8.4]#

SOLUTION:

Check the PATH environment variable.  If the problem persists after changing PATH, then do:


cp -p /opt/puppetlabs/puppet/bin/puppet /opt/puppetlabs/puppet/bin/puppet.orig

 

/opt/puppetlabs/puppet/bin/gem install puppet -v 6.19.1

 

[root@MoM 2019.8.4]# puppet agent -t;

Info: Using configured environment 'production'

Info: Retrieving pluginfacts

Info: Retrieving plugin

Info: Retrieving locales

Info: Loading facts

Info: Caching catalog for MoM.wrk.fs.usda.gov

Info: Applying configuration version '1606189208'

Notice: Applied catalog in 33.42 seconds

[root@MoM 2019.8.4]#

EOS

Monday, November 16, 2020

Warning: MCollective and Activemq have been removed from PE 2019.0+, but the puppet_enterprise::profile::master::mcollective class is still being applied.

 PROBLEM:

$ puppet agent -t

Info: Using configured environment 'production'

Info: Retrieving pluginfacts

Info: Retrieving plugin

Info: Retrieving locales

Info: Loading facts

Info: Caching catalog for fsxopsx1697.wrk.fs.usda.gov

Info: Applying configuration version '1605550196'

Warning: MCollective and Activemq have been removed from PE 2019.0+, but the puppet_enterprise::profile::master::mcollective class is still being applied. Please remove this class from your classification.

Warning: /Stage[main]/Puppet_enterprise::Profile::Master::Mcollective/Notify[puppet_enterprise::profile::master::mcollective-still-applied]/message: defined 'message' as 'MCollective and Activemq have been removed from PE 2019.0+, but the puppet_enterprise::profile::master::mcollective class is still being applied. Please remove this class from your classification.'

Warning: MCollective and Activemq have been removed from PE 2019.0+, but the puppet_enterprise::profile::mcollective::peadmin class is still being applied. Please remove this class from your classification.

Warning: /Stage[main]/Puppet_enterprise::Profile::Mcollective::Peadmin/Notify[puppet_enterprise::profile::mcollective::peadmin-still-applied]/message: defined 'message' as 'MCollective and Activemq have been removed from PE 2019.0+, but the puppet_enterprise::profile::mcollective::peadmin class is still being applied. Please remove this class from your classification.'

Notice: Applied catalog in 32.16 seconds

SOLUTION:

Query the node groups into q.hocon to find which Node Groups have mcollective classes

$ grep -i mcollective q.hocon

$ curl -k -X GET https://$(hostname -f):4433/classifier-api/v1/groups --cert /etc/puppetlabs/puppet/ssl/certs/$(hostname -f).pem --key /etc/puppetlabs/puppet/ssl/private_keys/$(hostname -f).pem --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem -H "Content-Type: application/json" | python -m json.tool > q.hocon

$ vim q.hocon

EOS

Friday, November 13, 2020

Class[Puppet_enterprise]: has no parameter named 'mcollective_middleware_hosts' on node mom.com

 PROBLEM:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Class[Puppet_enterprise]: has no parameter named 'mcollective_middleware_hosts' on node mom.com

Warning: Not using cache on failed catalog

Error: Could not retrieve catalog; skipping run

SOLUTION:
https://puppet.com/docs/pe/2018.1/removing_mcollective.html
Essentially, go into the console >> PE Infrastructure >> Classes >> Class: puppet_enterprise
and remove mcollective parameter (for Puppet>5), or set it to "disabled" for Puppet 5.

Wednesday, July 15, 2020

Console started, but browser won't connect. Curl gets 404

PROBLEM:

Chrome nor Firefox wouldn't load console login screen.

Curling the url on port 80 give 404 errors, port 443 gives 303 errors (or visa versa)

SOLUTION:

Did this from L-Ubuntu commandline, and it started working:

wget https://192.168.1.138     -O /dev/tty --no-check-certificqate

EOS


Monday, June 15, 2020

Client Error: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]/ensure: change from '5.5.18-1.el7' to '5.5.17'

PROBLEM:

[root@client ~]# puppet agent -t

Info: Using configured environment 'production'

Info: Retrieving pluginfacts

Info: Retrieving plugin

Info: Retrieving locales

Info: Loading facts

Info: Caching catalog for client.com

Info: Applying configuration version '1592088269'

Error: Could not update: Execution of '/bin/yum -d 0 -e 0 -y downgrade puppet-agent-5.5.17' returned 1: Error: Nothing to do

Error: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]/ensure: change from '5.5.18-1.el7' to '5.5.17' failed: Could not update: Execution of '/bin/yum -d 0 -e 0 -y downgrade puppet-agent-5.5.17' returned 1: Error: Nothing to do

Notice: Applied catalog in 3.95 seconds

[root@client ~]#  

SOLUTION:

https://puppet.com/docs/pe/latest/installing_agents.html

Add classes to the PE Master node group for each agent platform used in your environment. For example, pe_repo::platform::el_7_x86_64.

 

If that doesn't work, try deploying the production environment.

puppet access login --service-url https://$(hostname -f):4433/rbac-api --lifetime 5d

puppet code deploy production --wait



Saturday, June 13, 2020

Error 500 on SERVER: Server Error: Could not find class puppet_agent for mom.com on node mom.com

PROBLEM:
[root@MoM]# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find class puppet_agent for mom.com on node mom.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
SOLUTION:
Deploy the production environment.
puppet access login --service-url https://$(hostname -f):4433/rbac-api --lifetime 5d                              puppet code deploy production --wait
puppet agent -t

Also, make sure these lines are in Puppetfile:  
   mod 'puppetlabs-puppet_agent'
   mod 'puppetlabs-stdlib'

Monday, April 27, 2020

Unrealted error for parent ID needed

PROBLEM:
[root:~]# cat Roles__puppet_node_group.rb
node_group { 'Roles':
  ensure               => 'present',
  classes              => {},
  environment          => 'production',
  override_environment => false,
  parent               => '00000000-0000-4000-8000-000000000000',
  rule                 => [''],
}
[root:~]# puppet apply Roles__puppet_node_group.rb

Error: node_manager failed with error type 'schema-violation': The object(s) in your submitted request did not conform to the schema. The problem is: ([:environment-trumps (not (instance? Boolean "false"))])
SOLUTION:
Specify the parent ID instead of the parent name.  For example:
[root@fsxopsx1697 ~]# cat /nfsroot/work/sysinfra/puppet/2018.1.13.el6/backup/fsxopsx0618/Roles__puppet_node_group.rb
node_group { 'Roles':
  ensure               => 'present',
  classes              => {},
  environment          => 'production',
  override_environment => false,
  parent               => '00000000-0000-4000-8000-000000000000',
  rule                 => [''],
}