Skip to content

Commit 56e0be6

Browse files
committed
Merge pull request #28 from atrepca/centos-6-bootstrap-updates
Changes to the centos_6_x.sh bootstrap script:
2 parents 562c350 + 9595eda commit 56e0be6

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

centos_6_x.sh

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
11
#!/usr/bin/env bash
2-
# This bootstraps Puppet on CentOS 6.x
3-
# It has been tested on CentOS 6.4 64bit
2+
# Bootstrap Puppet on CentOS 6.x
3+
# Tested on CentOS 6.5 64bit
44

55
set -e
66

7-
REPO_URL="http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"
7+
PUPPETLABS_RELEASE_RPM="http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"
88

9-
if [ "$EUID" -ne "0" ]; then
10-
echo "This script must be run as root." >&2
9+
if [ "${EUID}" -ne "0" ]; then
10+
/bin/echo "This script must be run as root." >&2
1111
exit 1
12-
fi
13-
14-
if which puppet > /dev/null 2>&1; then
15-
echo "Puppet is already installed."
12+
elif /usr/bin/which puppet > /dev/null 2>&1; then
13+
/bin/echo "Puppet is already installed."
1614
exit 0
1715
fi
1816

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
17+
# Install Puppet Labs repo
18+
/bin/echo "Configuring Puppet Labs repo..."
19+
/bin/rpm --quiet -i "${PUPPETLABS_RELEASE_RPM}"
2920

30-
# Install Puppet...
31-
echo "Installing puppet"
32-
yum install -y puppet > /dev/null
21+
# Install Puppet
22+
/bin/echo "Installing Puppet..."
23+
/usr/bin/yum install -q -y puppet
3324

34-
echo "Puppet installed!"
25+
/bin/echo "Puppet installed!"

0 commit comments

Comments
 (0)