During Puppet runs on my compile master, pe-puppetdb and pe-postgresql packages are installed. My compile master is not a PuppetDB node. I want to prevent these packages from being installed during Puppet runs and remove them from the node.
Error messages and logs
You might see this issue on any infrastructure node other than a monolithic master.
When Puppet runs:
On a compile master:
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for mfnrqpw1ziqu8y6.delivery.puppetlabs.net
Info: Applying configuration version '1510256290'
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-postgresql-pglogical]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-puppetdb]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-console-services]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-orchestration-services]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-activemq]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-razor-libs]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-razor-server]/ensure: created
Notice: Applied catalog in 69.24 seconds
On the master node in a split installation:
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for mom.puppetdebug.vlan
Info: Applying configuration version '1510268291'
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-postgresql-pglogical]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-puppetdb]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-console-services]/ensure: created
Notice: Applied catalog in 30.14 seconds
On the PuppetDB node in a split installation:
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for pdb-23417.puppetdebug.vlan
Info: Applying configuration version '1510268412'
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-console-services]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-client-tools]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-license]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-puppet-license-cli]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-puppetdb-termini]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-console-services-termini]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-puppetserver]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-orchestration-services]/ensure: created
Notice: /Stage[main]/Puppet_enterprise::Packages/Package[pe-activemq]/ensure: created
Version and installation information
PE version: 2016.4, 2017.3, 2018.1, 2019.2
OS: Any
Installation type:
2016.4, 2017.3, 2018.1, 2019.2: Monolithic with compile masters or a separate PE PostgreSQL, split
2019.2: compile masters or a separate PE PostgreSQL
Solution
The puppet_enterprise
module uses virtual resources to manage Puppet Enterprise (PE) packages for all infrastructure nodes (the master of masters, compile master, PuppetDB, and console). When a package resource collector is used on any PE infrastructure node, it adds all of the infrastructure packages to that node.
To resolve this issue, find the resource collectors present in the code base and update them to omit these PE packages. Remove the unnecessary packages from systems that are affected.
-
Find the package resource collectors causing the issue:
find $(puppet config print codedir) -name "*.pp" -exec grep -HE 'Package\s+<\|' {} \;
-
Add title filters to each resource collector applied to PE infrastructure nodes to make sure unnecessary packages are not added. This example includes all of the pe-packages. To avoid the issue, you will need to combine these filters with any search expression you are already using.
Package <| title != 'pe-postgresql-pglogical' and title != 'pe-java' and title != 'pe-puppetdb' and title != 'pe-console-services' and title != 'pe-client-tools' and title != 'pe-orchestration-services' and title != 'pe-activemq' and title != 'pe-puppet-enterprise-release' and title != 'pe-razor-server' and title != 'pe-razor-libs' and title != 'pe-backup-tools' and title != 'pe-console-services-termini' and title != 'pe-license' and title != 'pe-modules' and title != 'pe-puppetdb-termini' and title != 'pe-puppetserver' and title != 'pe-postgresql-common' and title != 'pe-postgresql11-pglogical' and title != 'pe-postgresql11-pgrepack' and title != 'pe-installer' and title != 'pe-bolt-server' and title != 'pe-ace-server' and title != 'pe-tasks' |>
-
Remove unnecessary packages from the affected nodes.
In our example, the compile master had pe-postgresql-pglogical, pe-puppetdb, pe-console-services, pe-orchestration-services, pe-activemq, pe-razor-libs, and pe-razor-server installed. In this case, remove them by running the following on the compile master:
# if $(grep -qE '^subname = //localhost' /etc/puppetlabs/puppetdb/conf.d/database.ini); then for package in pe-postgresql-pglogical pe-puppetdb; do puppet resource package $package ensure=absent; done; else /bin/echo "This server appears to be a PuppetDB node. Not removing packages."; fi
# if [ ! -s /etc/puppetlabs/console-services/conf.d/console.conf ]; then puppet resource package pe-console-services ensure=absent; else /bin/echo "ERROR: This server appears to be a Console node. Not removing packages."; fi
# if [ `ls /etc/puppetlabs/razor-server |wc -l` -le 2 ]; then for package in pe-razor-server pe-razor-libs; do puppet resource package $package ensure=absent; done; else /bin/echo "ERROR: This server appears to have Razor configured. Not removing packages."; fi
# if ! $(grep -qE 'Centrally managed by Puppet' /etc/puppetlabs/activemq/activemq.xml); then puppet resource package pe-activemq ensure=absent; else /bin/echo "This server appears to have a managed ActiveMQ configuration. Not removing package."; fi
# if [ "`puppet config print certname`" != "`puppet config print server`" ]; then puppet resource package pe-orchestration-services ensure=absent; else /bin/echo "This server appears to be a Puppet master of masters. Not removing package."; fi
How can we improve this article?
5 comments
In my case this affected my monolithic master.
Though maybe you're just letting us know you can see this on a monolithic master, (thank you!) I'll let the folks you're working with know just in case it's related to anything you're trying to fix right now.
This article should be updated for 2018.1.0 with the filter shown below. The one in the article is missing a few packages.
Package <| title != 'pe-activemq' and
title != 'pe-backup-tools' and
title != 'pe-client-tools' and
title != 'pe-console-services' and
title != 'pe-console-services-termini' and
title != 'pe-java' and
title != 'pe-license' and
title != 'pe-modules' and
title != 'pe-orchestration-services' and
title != 'pe-postgresql-pglogical' and
title != 'pe-puppet-enterprise-release' and
title != 'pe-puppetdb' and
title != 'pe-puppetdb-termini' and
title != 'pe-puppetserver' and
title != 'pe-razor-libs' and
title != 'pe-razor-server' and
title != 'pe-tasks' |>
Thanks Nate... I'll take care of it.
More packages missing for 2019.2.1
Please sign in to leave a comment.
Related articles