blob: 4ae4b4110dba5ce105e1a5357d5d9131a0a75c71 [file] [log] [blame]
Andrew Grimbergebc710a2017-01-30 12:59:38 -08001#!/bin/bash
2
3# vim: ts=4 sw=4 sts=4 et tw=72 :
4
5rh_systems() {
6 # Assumes that python is already installed by basebuild
7
8 # Install dependencies for robotframework and robotframework-sshlibrary
9 yum install -y -q yum-utils unzip sshuttle nc libffi-devel openssl-devel
10
11 # Install 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
Andrew Grimbergebc710a2017-01-30 12:59:38 -080027}
28
29ubuntu_systems() {
30 # Assumes that python is already installed by basebuild
31
32 # Install dependencies for robotframework and robotframework-sshlibrary
33 apt install -y unzip sshuttle netcat libffi-dev libssl-dev
34
35 # Install docker
36 apt install -y docker.io
Andrew Grimbergebc710a2017-01-30 12:59:38 -080037}
38
39all_systems() {
40 echo 'No common distribution configuration to perform'
41}
42
43echo "---> Detecting OS"
44ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
45
46case "${ORIGIN}" in
47 fedora|centos|redhat)
48 echo "---> RH type system detected"
49 rh_systems
50 ;;
51 ubuntu)
52 echo "---> Ubuntu system detected"
53 ubuntu_systems
54 ;;
55 *)
56 echo "---> Unknown operating system"
57 ;;
58esac
59
60# execute steps for all systems
61all_systems