From: Nathan Cutler Date: Thu, 9 Feb 2017 13:31:59 +0000 (+0100) Subject: setup-openstack.sh: edit /etc/init.d/dnsmasq after installing dnsmasq X-Git-Tag: 1.1.0~211^2~60 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=99a36741021d59fa90e14789868b8fdd4edf898a;p=teuthology.git setup-openstack.sh: edit /etc/init.d/dnsmasq after installing dnsmasq Signed-off-by: Nathan Cutler --- diff --git a/teuthology/openstack/setup-openstack.sh b/teuthology/openstack/setup-openstack.sh index ec52e3a85e..a96695ddfd 100755 --- a/teuthology/openstack/setup-openstack.sh +++ b/teuthology/openstack/setup-openstack.sh @@ -374,11 +374,11 @@ function setup_dnsmasq() { local dev=$2 if ! test -f /etc/dnsmasq.d/resolv ; then + resolver=$(grep nameserver /etc/resolv.conf | head -1 | perl -ne 'print $1 if(/\s*nameserver\s+([\d\.]+)/)') + sudo apt-get -qq install -y --force-yes dnsmasq resolvconf # FIXME: this opens up dnsmasq to DNS reflection/amplification attacks, and can be reverted # FIXME: once we figure out how to configure dnsmasq to accept DNS queries from all subnets sudo perl -pi -e 's/--local-service//' /etc/init.d/dnsmasq - resolver=$(grep nameserver /etc/resolv.conf | head -1 | perl -ne 'print $1 if(/\s*nameserver\s+([\d\.]+)/)') - sudo apt-get -qq install -y --force-yes dnsmasq resolvconf echo resolv-file=/etc/dnsmasq-resolv.conf | sudo tee /etc/dnsmasq.d/resolv echo nameserver $resolver | sudo tee /etc/dnsmasq-resolv.conf # restart is not always picking up changes