Merge "Update cloud image Ubuntu18.04 mininet ovs"
[releng/builder.git] / jenkins-init-scripts / mininet-ubuntu.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 # disable the firewall
10 /bin/bash ./disable_firewall.sh
11
12 # Add 'hostname' into /etc/hosts during node spinup time to avoid sudo returning
13 # an 'unable to resolve host' message or some Java API's returning an unknown
14 # host exception. The workaround on adding "myhostname" into /etc/nss-switch.conf
15 # does not work on Ubuntu flavours.
16 sed -i "/127.0.0.1/s/$/\t$(hostname)/" /etc/hosts