Skip to content

Instantly share code, notes, and snippets.

@awaxa
Last active April 14, 2017 20:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awaxa/c821e0b3c0e0ece9d5a767c3b85765df to your computer and use it in GitHub Desktop.
Save awaxa/c821e0b3c0e0ece9d5a767c3b85765df to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# before running this script:
# manually assign a hostname in System Preferences/Sharing
# optionally, set external facts github_token_ro and github_token_rw
set -evx
sudo mkdir -p /etc/puppetlabs/{puppet,facter/facts.d}
export PATH=$PATH:$HOME/.gem/ruby/2.0.0/bin
gem install puppet --user-install --no-rdoc --no-ri
sudo puppet config set --section main certname "$(facter hostname).local"
sudo puppet config set --section agent server puppet.awaxa.com
echo -e '---\nextension_requests:\n pp_role: workstation' | sudo tee /etc/puppetlabs/puppet/csr_attributes.yaml
caffeinate -d sudo puppet agent -t --waitforcert 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment