Linux Foundation Administrators | 1dc9dd5 | 2018-01-26 09:09:09 -0800 | [diff] [blame] | 1 | #!/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 |
| 6 | set -xeu -o pipefail |
| 7 | |
| 8 | rh_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 |
| 19 | DOCKER_NETWORK_OPTIONS='--bip=10.250.0.254/24' |
| 20 | EOL |
| 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 | |
| 32 | ubuntu_changes() { |
| 33 | echo "---> Ubuntu changes" |
| 34 | } |
| 35 | |
| 36 | OS=$(/usr/bin/facter operatingsystem) |
| 37 | case "$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 | ;; |
| 47 | esac |
| 48 | |
| 49 | echo "***************************************************" |
| 50 | echo "* PLEASE RELOAD THIS VAGRANT BOX BEFORE USE *" |
| 51 | echo "***************************************************" |