-
Notifications
You must be signed in to change notification settings - Fork 2
/
provision.sh
executable file
·37 lines (27 loc) · 1.34 KB
/
provision.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
#!/bin/sh
# Only update puppet and install modules once.
if [ ! -f /etc/yum.repos.d/puppetlabs.repo ]
then
# Add PuppetLabs repo
sudo rpm -ivh https://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-10.noarch.rpm
# Ensure packages in the PuppetLabs repo are visible
yum makecache
# Hack the priority of PuppetLabs repo so their packages can be installed too
sed -i 's/enabled=1/&\npriority=1/' /etc/yum.repos.d/puppetlabs.repo
yum update -y puppet
puppet module install puppetlabs-java
# The concat plugin that is available in forge.puppetlabs.com has a bug we don't want.
git clone git://github.com/puppetlabs/puppetlabs-concat /etc/puppet/modules/concat
# Not using hiera, but don't want warnings.
touch /etc/puppet/hiera.yaml
# Update module path to include our local modules
PUPPET_MODULE_PATH=$(puppet config print modulepath):$(pwd)/puppet/modules
fi
# Do the fun stuff. Install and configure Storm as well as clean up a few issues with the VM
puppet apply --modulepath="$PUPPET_MODULE_PATH" puppet/manifests/default.pp $@
# If the user is in an interactive shell, inform them they need to re-log or source.
if [[ $_ == $0 ]]
then
echo "To get storm into your path, please either log in again, or run the following command in this window:"
echo ". /etc/profile.d/storm-path.sh"
fi