Merge "Update cloud image Ubuntu18.04 mininet ovs"
[releng/builder.git] / jenkins-init-scripts / ubuntu-docker-ovs.sh
1 #!/bin/sh
2
3 # make sure we don't require tty for sudo operations
4 cat <<EOF >/etc/sudoers.d/89-jenkins-user-defaults
5 Defaults:jenkins !requiretty
6 jenkins     ALL = NOPASSWD: ALL
7 EOF
8
9 # Add 'hostname' into /etc/hosts during node spinup time to avoid sudo returning
10 # an 'unable to resolve host' message or some Java API's returning an unknown
11 # host exception. The workaround on adding "myhostname" into /etc/nss-switch.conf
12 # does not work on Ubuntu flavours.
13 sed -i "/127.0.0.1/s/$/\t$(hostname)/" /etc/hosts
14
15 # Do the final install of OVS that the has to be done at boot time for
16 # some reason due to how the snapshots keep behaving.
17 dpkg --install /root/openvswitch-datapath-dkms* /root/openvswitch-common* /root/openvswitch-switch*
18
19 # add user jenkins to docker group
20 /usr/sbin/usermod -a -G docker jenkins
21
22 # pull docker images
23 docker pull alagalah/odlpoc_ovs230
24
25 # vim: sw=2 ts=2 sts=2 et :