Last active
April 25, 2017 19:09
-
-
Save andreyev/32d175147f7b31e73d1a2b84880e0906 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Usage: curl https://gist.githubusercontent.com/andreyev/32d175147f7b31e73d1a2b84880e0906/raw/puppet-installer.sh | bash -s -- PUPPETENV | |
| PUPPETENV=$1 | |
| which puppet || { | |
| OS_MAJ_VERSION=$(rpm -qa \*-release | grep -Ei "centos" | cut -d"-" -f3) | |
| [[ -z "$OS_MAJ_VERSION" ]] && { echo "Distro not supported"; exit 1;} | |
| yum install -y https://yum.puppetlabs.com/puppetlabs-release-pc1-el-"$OS_MAJ_VERSION".noarch.rpm | |
| yum install -y puppet | |
| } | |
| NOW=$(date +%Y%m%d%H%M%S) | |
| test -s /etc/puppetlabs/puppet/puppet.conf && mv /etc/puppetlabs/puppet/puppet.conf{,-$NOW} | |
| cat << EOF > /etc/puppetlabs/puppet/puppet.conf | |
| [main] | |
| environment = ${PUPPETENV} | |
| server = puppet.adtsys.com.br | |
| EOF | |
| /opt/puppetlabs/bin/puppet agent -t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment