3 # vim: ts=4 sw=4 sts=4 et tw=72 :
5 # force any errors to cause the script and job to end in failure
9 # Assumes that python is already installed by basebuild
11 # Install dependencies for robotframework and robotframework-sshlibrary
12 yum install -y yum-utils unzip sshuttle nc libffi-devel openssl-devel
15 yum install -y docker supervisor bridge-utils
16 systemctl enable docker
18 # configure docker networking so that it does not conflict with LF
20 cat <<EOL > /etc/sysconfig/docker-network
21 # /etc/sysconfig/docker-network
22 DOCKER_NETWORK_OPTIONS='--bip=10.250.0.254/24'
24 # configure docker daemon to listen on port 5555 enabling remote
26 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
28 # docker group doesn't get created by default for some reason
32 ubuntu_docker_mtu_fix(){
33 echo "---> Fixing docker's mtu settings"
35 cat <<'EOL' > /etc/systemd/system/docker.service
37 Description=Docker Application Container Engine
38 Documentation=https://docs.docker.com
39 After=network.target docker.socket
40 Requires=docker.socket
44 # the default is not to use systemd for cgroups because the delegate issues still
45 # exists and systemd currently does not support the cgroup feature set required
46 # for containers run by docker
48 ExecStart=/usr/bin/dockerd --mtu 1454 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
49 ExecReload=/bin/kill -s HUP $MAINPID
50 # Having non-zero Limit*s causes performance problems due to accounting overhead
51 # in the kernel. We recommend using cgroups to do container-local accounting.
55 # Uncomment TasksMax if your systemd version supports it.
56 # Only systemd 226 and above support this version.
59 # set delegate yes so that systemd does not reset the cgroups of docker containers
61 # kill only the docker process, not all processes in the cgroup
65 WantedBy=multi-user.target
67 systemctl start docker
68 echo "---> Checking MTU"
69 docker network inspect bridge
70 echo "---> MTU set to 1454"
74 # Assumes that python is already installed by basebuild
77 sudo add-apt-repository -y ppa:jonathonf/python-3.6
79 sudo apt-get install -y python3.6 python3.6-dev
81 # Install dependencies for robotframework and robotframework-sshlibrary
82 apt install -y unzip sshuttle netcat libffi-dev libssl-dev
83 wget https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz
84 tar xvzf geckodriver-v0.18.0-linux64.tar.gz -C /usr/local/bin
85 export PATH=$PATH:/usr/local/bin
88 apt install -y docker.io
90 # Fixing Docker MTU settings
95 # Install docker-compose
96 curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/1.15.0/docker-compose-$(uname -s)-$(uname -m)"
97 chmod +x /usr/local/bin/docker-compose
101 echo "---> Detecting OS"
102 ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
105 fedora|centos|redhat)
106 echo "---> RH type system detected"
110 echo "---> Ubuntu system detected"
114 echo "---> Unknown operating system"
118 # execute steps for all systems