blob: d476f6687e4a2d6aa9b95755a0d3f92da38db1e1 [file] [log] [blame]
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -08001#!/bin/bash
2
3# vim: sw=4 ts=4 sts=4 et :
4
5# force any errors to cause the script and job to end in failure
6set -xeu -o pipefail
7
8rh_changes() {
9 echo "---> RH changes"
10 # install docker and enable it
11 echo "---> Installing docker"
12 yum install -y docker supervisor bridge-utils
13 systemctl enable docker
14
15 # configure docker networking so that it does not conflict with LF
16 # internal networks
17 cat <<EOL > /etc/sysconfig/docker-network
18# /etc/sysconfig/docker-network
19DOCKER_NETWORK_OPTIONS='--bip=10.250.0.254/24'
20EOL
21 # configure docker daemon to listen on port 5555 enabling remote
22 # managment
23 sed -i -e "s#='--selinux-enabled'#='--selinux-enabled -H unix:///var/run/docker.sock -H tcp://0.0.0.0:5555'#g" /etc/sysconfig/docker
24
25 # docker group doesn't get created by default for some reason
26 groupadd docker
27
28 # Install python dependencies
29 yum install -y python-{devel,virtualenv,setuptools,pip}
30}
31
32ubuntu_changes() {
33 echo "---> Ubuntu changes"
34}
35
36OS=$(/usr/bin/facter operatingsystem)
37case "$OS" in
38 CentOS|Fedora|RedHat)
39 rh_changes
40 ;;
41 Ubuntu)
42 ubuntu_changes
43 ;;
44 *)
45 echo "${OS} has no configuration changes"
46 ;;
47esac
48
49echo "***************************************************"
50echo "* PLEASE RELOAD THIS VAGRANT BOX BEFORE USE *"
51echo "***************************************************"