-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.sh
27 lines (25 loc) · 856 Bytes
/
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
#!/bin/sh
command -v puppet > /dev/null && { echo "Puppet is installed! skipping" ; exit 0; }
ID=$(cat /etc/os-release | awk -F= '/^ID=/{print $2}' | tr -d '"')
VERS=$(cat /etc/os-release | awk -F= '/^VERSION_ID=/{print $2}' | tr -d '"')
case "${ID}" in
centos|rhel)
wget https://yum.puppet.com/puppet5/puppet5-release-el-${VERS}.noarch.rpm
rpm -Uvh puppet5-release-el-${VERS}.noarch.rpm
yum install -y puppet-agent
;;
fedora)
rpm -Uvh https://yum.puppet.com/puppet5/puppet5-release-fedora-${VERS}.noarch.rpm
yum install -y puppet-agent
;;
debian|ubuntu)
wget https://apt.puppetlabs.com/puppet5-release-$(lsb_release -cs).deb
dpkg -i puppet5-release-$(lsb_release -cs).deb
apt-get -qq update
apt-get install -y puppet-agent
;;
*)
echo "Distro '${ID}' not supported" 2>&1
exit 1
;;
esac