forked from CiscoSystems/puppet_openstack_builder
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·38 lines (33 loc) · 913 Bytes
/
setup.sh
File metadata and controls
executable file
·38 lines (33 loc) · 913 Bytes
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/bash
#
# This script sets up the base config for all nodes
# It requires that you provide it with the ip address
# of your build server
# export build_server_ip=10.0.0.1
# bash setup.sh
#
set -u
set -x
set -e
# Vendors can optionally include customisations
# leaving this blank will use the community packages
# and stackforge repositories
export vendor_name="${vendor:-}"
if [ -n "${vendor_name}" ]; then
source ./$vendor_name.install.sh
fi
apt-get update
apt-get install -y git rubygems puppet
# use the domain name if one exists
if [ "`hostname -d`" != '' ]; then
domain=`hostname -d`
else
# otherwise use the domain
domain='domain.name'
fi
# puppet's fqdn fact explodes if the domain is not setup
if grep 127.0.1.1 /etc/hosts ; then
sed -i -e "s/127.0.1.1.*/127.0.1.1 $(hostname).$domain $(hostname)/" /etc/hosts
else
echo "127.0.1.1 $(hostname).$domain $(hostname)" >> /etc/hosts
fi;