Skip to content

Instantly share code, notes, and snippets.

@cclloyd
Last active May 25, 2018 04:49
Show Gist options
  • Save cclloyd/00e353dee2a5799b220ce8c6540be9a7 to your computer and use it in GitHub Desktop.
Save cclloyd/00e353dee2a5799b220ce8c6540be9a7 to your computer and use it in GitHub Desktop.
Installation and config of a single machine for both puppetserver and use itself as puppet agent
sudo /opt/puppetlabs/bin/puppet resource service puppetserver ensure=running
sudo r10k deploy environment -p production --verbose
sudo /opt/puppetlabs/bin/puppet agent -t --verbose
# /etc/puppetlabs/puppet/hiera.yaml
---
:backends:
- yaml
:hierarchy:
- "nodes/{%::trusted.certname}"
- common
:yaml:
:datadir:
wget https://apt.puppetlabs.com/puppet5-release-xenial.deb;
sudo dpkg -i puppet5-release-xenial.deb;
sudo apt update;
sudo apt-get update
sudo apt-get install -y aptitude
sudo aptitude install -y puppetserver puppet-agent puppet-common ruby;
sudo gem install r10k;
sudo mkdir /etc/puppetlabs/r10k;
sudo touch /etc/puppetlabs/r10k.yaml;
# /etc/puppetlabs/puppet/puppet.conf
[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
server = example.com
[main]
dns_alt_names = example.com
certname = example.com
[agent]
server = example.com
# /etc/default/puppetserver
JAVA_ARGS="-Xms1024M -Xmx1024M -Djruby.logger.class=com.puppetlabs.jruby_utils.jruby.Slf4jLogger"
# /etc/puppetlabs/r10k/r10k.yaml
# The location to use for storing cached Git repos
:cachedir: '/var/cache/r10k'
# A list of git repositories to create
:sources:
# This will clone the git repository and instantiate an environment per
# branch in /etc/puppetlabs/code/environments
:my-org:
remote: 'https://github.com/cclloyd/cclloyd-provisioning'
basedir: '/etc/puppetlabs/code/environments'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment