-
Notifications
You must be signed in to change notification settings - Fork 15
/
srv001.sh
39 lines (30 loc) · 1.44 KB
/
srv001.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
#! /bin/bash
#
# Provisioning script for srv001
#------------------------------------------------------------------------------
# Bash settings
#------------------------------------------------------------------------------
# Enable "Bash strict mode"
set -o errexit # abort on nonzero exitstatus
set -o nounset # abort on unbound variable
set -o pipefail # don't mask errors in piped commands
#------------------------------------------------------------------------------
# Variables
#------------------------------------------------------------------------------
# Location of provisioning scripts and files
export readonly PROVISIONING_SCRIPTS="/vagrant/provisioning/"
# Location of files to be copied to this server
export readonly PROVISIONING_FILES="${PROVISIONING_SCRIPTS}/files/${HOSTNAME}"
#------------------------------------------------------------------------------
# "Imports"
#------------------------------------------------------------------------------
# Utility functions
source ${PROVISIONING_SCRIPTS}/util.sh
# Actions/settings common to all servers
source ${PROVISIONING_SCRIPTS}/common.sh
#------------------------------------------------------------------------------
# Provision server
#------------------------------------------------------------------------------
log "Starting server specific provisioning tasks on ${HOSTNAME}"
# TODO: insert code here, e.g. install Apache, add users (see the provided
# functions in utils.sh), etc.