lib/testlab/provisioners/bind.rb in testlab-1.15.1 vs lib/testlab/provisioners/bind.rb in testlab-1.16.0

- old
+ new

@@ -136,16 +136,22 @@ build_bind_zone_partial(node, file) end end def bind_install(node) - node.exec(%(sudo DEBIAN_FRONTEND="noninteractive" apt-get -y install bind9)) - node.exec(%(sudo rm -fv /etc/bind/{*.arpa,*.zone,*.conf*})) + node.bootstrap(<<-EOSHELL) + export DEBIAN_FRONTEND="noninteractive" + + (dpkg --status bind9 &> /dev/null || apt-get -qy install bind9) + rm -fv /etc/bind/{*.arpa,*.zone,*.conf*} + EOSHELL end def bind_reload(node) - node.exec(%(sudo chown -Rv bind:bind /etc/bind)) - node.exec(%(sudo rndc reload)) + node.bootstrap(<<-EOSHELL) + chown -Rv bind:bind /etc/bind + rndc reload + EOSHELL end def bind_provision(node) bind_install(node) build_bind_conf(node)