Skip to content

Instantly share code, notes, and snippets.

@jhoblitt
Created July 23, 2019 04:18
Show Gist options
  • Save jhoblitt/e8a0b1dc940966afe0f34aacaa650674 to your computer and use it in GitHub Desktop.
Save jhoblitt/e8a0b1dc940966afe0f34aacaa650674 to your computer and use it in GitHub Desktop.

puppet master

  • generate new ssh key pair to use as github deploy keys; install per site/pm deploy key on lsst-it/lsst-puppet-hiera-private repo
  • stop local agent (service)
  • cp in sshkey for hiera
  • check /etc/hosts to see if puppet-master is resolvable
  • remove enc configuration from puppet.conf
  • change env to IT_1141_hiera_redux
  • rm old code/hiera paths (due to dir path changes)
  • manually update r10k conf (first run only)
  • restart puppetserver to ensure nothing is cached
  • add custom facts
  • run puppet agent in --noop mode
  • run puppet agent
  • restart puppet agent (service)

generic agent

  • stop local agent (service)
systemctl stop puppet
systemctl status puppet
  • change env to IT_1141_hiera_redux
  • check /etc/hosts to see if puppet-master is resolvable
  • add custom facts
mkdir -p /etc/facter/facts.d
cat > /etc/facter/facts.d/role.txt <<END
role=graylog
site=po
END

cat /etc/facter/facts.d/role.txt

- run puppet agent in --noop mode

```sh
puppet agent --test --noop

Look for:

Info: Using configured environment 'IT_1141_hiera_redux'
  • run puppet agent
puppet agent --test
  • restart puppet agent (service)
# This file can be used to override the default puppet settings.
# See the following links for more details on what settings are available:
# - https://puppet.com/docs/puppet/latest/config_important_settings.html
# - https://puppet.com/docs/puppet/latest/config_about_settings.html
# - https://puppet.com/docs/puppet/latest/config_file_main.html
# - https://puppet.com/docs/puppet/latest/configuration.html
[master]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code
certname = puppet-master.us.lsst.org
#node_terminus = exec
#external_nodes = /etc/puppetlabs/code/enc//bin/lsst_enc.py
#external_nodes = /tmp/my_shitty_enc.sh
dns_alt_names = gs-puppet-master.po.us.lsst.org,puppet-master.us.cl.lsst.org
[main]
#environment = production
environment = IT_1141_hiera_redux
[agent]
#server = puppet-master.dev.lsst.org
server = puppet-master.us.lsst.org
runinterval = 3600
cachedir: "/var/cache/r10k"
sources:
control:
remote: "https://github.com/lsst-it/lsst-itconf"
basedir: "/etc/puppetlabs/code/environments"
lsst_hiera_private:
remote: "git@github.com:lsst-it/lsst-puppet-hiera-private.git"
basedir: "/etc/puppetlabs/code/hieradata/private"
lsst_hiera_public:
remote: "https://github.com/lsst-it/lsst-puppet-hiera.git"
basedir: "/etc/puppetlabs/code/hieradata/public"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment