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
10 /bin/bash ./disable_firewall.sh
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