Skip to content

Instantly share code, notes, and snippets.

@csm10495
Created April 27, 2020 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csm10495/330b77357d8a8ed1b80f0bbf2e4aea3c to your computer and use it in GitHub Desktop.
Save csm10495/330b77357d8a8ed1b80f0bbf2e4aea3c to your computer and use it in GitHub Desktop.
install_puppet_agent.sh
#!/bin/bash -v
# Helps to install a puppet 6 agent (pointing to a puppet server/master) on CentOS / RHEL
set -e
alias sudo="sudo --preserve-env=PATH env "
# allow other installs
sudo yum install epel-release -y
sudo rpm -Uvh https://yum.puppet.com/puppet6-release-el-7.noarch.rpm
sudo yum install -y puppet-agent
source /etc/profile.d/puppet-agent.sh
sudo bash -c 'cat << EOF >> /etc/puppetlabs/puppet/puppet.conf
[main]
certname = csm-puppet-agent1.eastus.cloudapp.azure.com # Replace with this system's FQDN
server = csm-puppet-master.eastus.cloudapp.azure.com # Replace with the master's FQDN
environment = production
runinterval = 1h
EOF'
sudo `which puppet` resource service puppet ensure=running enable=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment