-
Notifications
You must be signed in to change notification settings - Fork 1
/
puppet.sh
39 lines (28 loc) · 801 Bytes
/
puppet.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# This bootstraps Puppet on CentOS 7.x
# It has been tested on CentOS 7.0 64bit
set -e
REPO_URL="http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm"
if [ "$EUID" -ne "0" ]; then
echo "This script must be run as root." >&2
exit 1
fi
if which puppet > /dev/null 2>&1; then
echo "Puppet is already installed."
exit 0
fi
# Install wget
echo "Installing wget..."
yum install -y wget > /dev/null
# Install puppet labs repo
echo "Configuring PuppetLabs repo..."
repo_path=$(mktemp)
wget --output-document="${repo_path}" "${REPO_URL}" 2>/dev/null
rpm -i "${repo_path}" >/dev/null
# Install Puppet...
echo "Installing puppet"
yum install -y puppet > /dev/null
echo "Puppet installed!"
echo "Installing Git"
yum installed -y git > /dev/null
echo "Git installed!"