-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.sh
executable file
·53 lines (41 loc) · 1.3 KB
/
init.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
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
####################################
# Run this script to install requirements
# and pull latest version of puppet code.
####################################
####################################
# Make sure only root can run our script
####################################
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
####################################
# Run without prompts whilst installing
####################################
sudo DEBIAN_FRONTEND=noninteractive
####################################
# Install required packages
####################################
sudo apt-get -y -q install puppet git-core
####################################
# Set puppet module folder
# TODO check if already set
####################################
sudo echo "modulepath=/var/puppet/modules" >> /etc/puppet/puppet.conf
####################################
# Create puppet files folder
####################################
if [ ! -d /etc/puppet/files ]
then
echo "Creating puppet files folder"
sudo mkdir /etc/puppet/files
fi
####################################
# Pull down the puppet configs
####################################
if [ ! -d /var/puppet ]
then
git clone git://github.com/muhleder/puppet.git /var/puppet
chmod 774 /var/puppet/install.sh
fi