# The env of the daemonized puppet as per /proc/pid/environ:
cat /proc/$(cat /var/run/puppetlabs/agent.pid)/environ
LANG=en_US.UTF-8PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Given this manifest ....
# The env of the daemonized puppet as per /proc/pid/environ:
cat /proc/$(cat /var/run/puppetlabs/agent.pid)/environ
LANG=en_US.UTF-8PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Given this manifest ....
#!/bin/bash | |
# The Puppet Enterprise High Availability documentation states: | |
# | |
# Run the forget command whenever a replica node is destroyed, | |
# even if you plan to replace it with a replica with the same name. | |
# | |
# Some users prefer to forget and reuse (instead of destroy and replace) a replica. | |
# As an alternative, when `/opt/puppetlabs/bin/puppet-enterprise-uninstaller` isn't available, | |
# this script uninstalls Puppet Enterprise on the Replica. |
# PUP-7814: HTTPS file sources with non-puppet-trusted certs cannot be used | |
# TODO: Rewrite to accept and pass other File resource attributes to the resulting file. | |
# TODO: Identify a dependable alternative to grep on Windows. | |
define https_file ( | |
String $cert, | |
String $path = $name, | |
String $temp = "${path}.download", | |
Pattern[/^https/] $source, |
$puppet_service = GWMI Win32_service | Where Name -eq 'puppet' | Select Name,ProcessId,State,Status | |
$pxpagent_service = GWMI Win32_service | Where Name -eq 'pxp-agent' | Select Name,ProcessId,State,Status | |
$puppet_process = Get-Process | Where Name -eq 'puppet' | Select Id | |
$pxpagent_process = Get-Process | Where Name -eq 'pxp-agent' | Select Id | |
Write-Host Puppet Service $puppet_service | |
Write-Host PXP-Agent Service $pxpagent_service | |
if (($pxpagent_service.State -NotLike 'Running') -or ($pxpagent_service.Status -NotLike 'OK')) { | |
Write-Host |
Verify the server
setting in puppet.conf
on the Agent is set to the Master (or the Load Balancer of the Master).
Verify that the Puppet Agent
service is running on the Agent.
If you find a correlated "Puppet Agent service terminated unexpectedly" event ...
PuppetDB only stores one catalog and factset per node (but n number of reports), so deleting older catalog and fact queue files older than an hour (given runinterval=30
) could allow PuppetDB to catch up on the queue, and would not have an impact on the data in PostgreSQL. To delete older catalogs and factsets (that would have been replaced by newer catalogs and factsets) from the PuppetDB queue:
find /opt/puppetlabs/server/data/puppetdb/stockpile/cmd/q -name "*_catalog_9_*.json.gz" -mmin +60 -delete
find /opt/puppetlabs/server/data/puppetdb/stockpile/cmd/q -name "*_facts_5_*.json.gz" -mmin +60 -delete
Verify the server
setting in puppet.conf
on the Agent is set to the Master (or the Load Balancer of the Master).
Note the datetime stamp of the files in puppet/ssl
on the Agent
Review the Application and System logs.
Execute puppet agent -t
as root on Linux or an Administrator on Windows.
Execute puppet cert list
or puppetserver ca list
on the Master
#!/usr/bin/env ruby | |
# Change into the Support Script output directory, and execute this script. | |
# Or, pass the directory as the parameter. | |
require 'json' | |
# Convert JAVA_ARGS string to a Hash. | |
def java_args_to_hash(s) |
#!/bin/bash | |
[ "$PT_noop" = "true" ] && NOOP_FLAG="--noop" || unset NOOP_FLAG | |
puppet_command="/opt/puppetlabs/bin/puppet agent --onetime --verbose --no-daemonize --no-splay --no-usecacheonfailure --no-use_cached_catalog $NOOP_FLAG" | |
# Sometimes it takes more than one run ... | |
# Retries until idempotent or error. | |
# | |
# Waits for up to five minutes for an in-progress puppet run to complete. |