forked from MiamiOH/puppet-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·41 lines (35 loc) · 1.24 KB
/
bootstrap.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
40
41
#!/usr/bin/env bash
#
# Bootstrap script to install/config/start puppet on multi POSIX platforms
#
set -e
BOOTSTRAP_HOME=${BOOTSTRAP_HOME:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}
PLATFORM=${PLATFORM:-$1}
PUPPET_ENVIRONMENT=${PUPPET_ENVIRONMENT:-$2}
PUPPET_SERVER=${PUPPET_SERVER:-$3}
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root." >&2
exit 1
fi
# Install Puppet Using the Puppet Labs Package Repositories
case "${PLATFORM}" in
redhat_5|centos_5|centos_5_x) source "${BOOTSTRAP_HOME}/centos_5_x.sh" ;;
redhat_6|centos_6|centos_6_x) source "${BOOTSTRAP_HOME}/centos_6_x.sh" ;;
redhat_7|centos_7|centos_7_x) source "${BOOTSTRAP_HOME}/centos_7_x.sh" ;;
debian) source "${BOOTSTRAP_HOME}/debian.sh" ;;
ubuntu) source "${BOOTSTRAP_HOME}/ubuntu.sh" ;;
osx|mac_os_x)
PUPPET_ROOT_GROUP=${PUPPET_ROOT_GROUP:-"wheel"}
PUPPET_SERVICE=${PUPPET_SERVICE:-"com.puppetlabs.puppet"}
source "${BOOTSTRAP_HOME}/mac_os_x.sh"
;;
*)
echo "Unknown/Unsupported PLATFORM." >&2
echo "Usage: $0 {redhat_5|redhat_6|redhat_7|debian|ubuntu|osx} [environment] [server]" >&2
exit 1
esac
# Configure /etc/puppet/puppet.conf
source "${BOOTSTRAP_HOME}/configure.sh"
# Start the Puppet Agent Service
source "${BOOTSTRAP_HOME}/service.sh"
echo "Success!!"