Skip to content

Instantly share code, notes, and snippets.

@tkishel
Created August 18, 2017 16:28
Show Gist options
  • Save tkishel/1d782f1e8fa85445fcca6637ad2bff51 to your computer and use it in GitHub Desktop.
Save tkishel/1d782f1e8fa85445fcca6637ad2bff51 to your computer and use it in GitHub Desktop.
Puppet ENV Inspection
# 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 ....

exec { 'env vars':
  command => '/bin/env > /tmp/env',
}
# The env of `puppet agent -t`:
puppet agent -t; cat /tmp/env

_=/bin/env
APT_LISTBUGS_FRONTEND=none
APT_LISTCHANGES_FRONTEND=none
DEBIAN_FRONTEND=noninteractive
HISTCONTROL=ignoredups
HISTSIZE=1000
HOSTNAME=host.example.com
LANG=en_US.UTF-8
LESSOPEN=||/usr/bin/lesspipe.sh %s
LS_COLORS=...
MAIL=/var/spool/mail/root
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/bin:/opt/puppetlabs/bin:/root/bin
PWD=/etc/puppetlabs/code/environments/production
SHELL=/bin/bash
SHLVL=2
TERM=xterm
USERNAME=root
# The env of the daemonized puppet:
kill -s SIGUSR1 `cat /var/run/puppetlabs/agent.pid` ; cat /tmp/env

_=/bin/env
APT_LISTBUGS_FRONTEND=none
APT_LISTCHANGES_FRONTEND=none
DEBIAN_FRONTEND=noninteractive
LANG=en_US.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
PWD=/
SHLVL=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment