X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jenkins-scripts%2Fubuntu-docker-ovs.sh;h=743255b6975c2575f00207d485e7411f14f7b767;hb=f93289b1fc422b77fcd00cfebe848c4eac982284;hp=4c579478e97e0029e994ee97ee153e3d90e515f8;hpb=80d013c4eb5babdc164955e438abf3a01691982e;p=releng%2Fbuilder.git diff --git a/jenkins-scripts/ubuntu-docker-ovs.sh b/jenkins-scripts/ubuntu-docker-ovs.sh index 4c579478e..743255b69 100755 --- a/jenkins-scripts/ubuntu-docker-ovs.sh +++ b/jenkins-scripts/ubuntu-docker-ovs.sh @@ -1,5 +1,17 @@ #!/bin/bash +# make sure we don't require tty for sudo operations +cat </etc/sudoers.d/89-jenkins-user-defaults +Defaults:jenkins !requiretty +jenkins ALL = NOPASSWD: ALL +EOF + +# Add 'hostname' into /etc/hosts during node spinup time to avoid sudo returning +# an 'unable to resolve host' message or some Java API's returning an unknown +# host exception. The workaround on adding "myhostname" into /etc/nss-switch.conf +# does not work on Ubuntu flavours. +sed -i "/127.0.0.1/s/$/\t$(hostname)/" /etc/hosts + # Do the final install of OVS that the has to be done at boot time for # some reason due to how the snapshots keep behaving. dpkg --install /root/openvswitch-datapath-dkms* && \ @@ -11,16 +23,4 @@ dpkg --install /root/openvswitch-{common,switch}* # pull docker images docker pull alagalah/odlpoc_ovs230 - -# make sure we don't require tty for sudo operations -cat </etc/sudoers.d/89-jenkins-user-defaults -Defaults:jenkins !requiretty -jenkins ALL=NOPASSWD: /usr/bin/ovs-vsctl -jenkins ALL=NOPASSWD: /usr/bin/ovs-ofctl -jenkins ALL=NOPASSWD: /usr/bin/ovs-dpctl -jenkins ALL=NOPASSWD: /sbin/ip -jenkins ALL=NOPASSWD: /var/run/netns -EOF - # vim: sw=2 ts=2 sts=2 et : -