dev/provisioning/bootstrap-puppet.sh
changeset 28 b0b56e0f8c7f
child 428 76a47f714766
equal deleted inserted replaced
27:a2342f26c9de 28:b0b56e0f8c7f
       
     1 #!/usr/bin/env bash
       
     2 # This bootstraps Puppet on CentOS 7.x
       
     3 # It has been tested on CentOS 7.0 64bit
       
     4 
       
     5 set -e
       
     6 
       
     7 REPO_URL="http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm"
       
     8 
       
     9 if [ "$EUID" -ne "0" ]; then
       
    10   echo "This script must be run as root." >&2
       
    11   exit 1
       
    12 fi
       
    13 
       
    14 if which puppet > /dev/null 2>&1; then
       
    15   echo "Puppet is already installed."
       
    16   exit 0
       
    17 fi
       
    18 
       
    19 # Install wget
       
    20 echo "Installing wget..."
       
    21 yum install -y wget > /dev/null
       
    22 
       
    23 
       
    24 # Install puppet labs repo
       
    25 echo "Configuring PuppetLabs repo..."
       
    26 repo_path=$(mktemp)
       
    27 wget --output-document="${repo_path}" "${REPO_URL}" 2>/dev/null
       
    28 rpm -i "${repo_path}" >/dev/null
       
    29 
       
    30 # Install Puppet...
       
    31 echo "Installing puppet"
       
    32 yum install -y puppet > /dev/null
       
    33 
       
    34 echo "Puppet installed!"