From 9a61fd5e0a7e2cc8c631a1e2d9869d1be4e34e57 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 16 Dec 2019 18:14:22 +0100 Subject: [PATCH] Using DNS search domains and options on calling postinstall-scripts/conf-resolver --- lib/cr_tf/handler.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/cr_tf/handler.py b/lib/cr_tf/handler.py index 90029f4..45565bf 100644 --- a/lib/cr_tf/handler.py +++ b/lib/cr_tf/handler.py @@ -60,7 +60,7 @@ from .terraform.disk import TerraformDisk from .xlate import XLATOR -__version__ = '3.3.4' +__version__ = '3.4.1' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -2616,7 +2616,18 @@ class CreateTerraformHandler(BaseHandler): commands.append("usermod -c 'root {}' root".format(vm.fqdn)) commands.append("chmod +x /tmp/conf-resolver") - commands.append("/tmp/conf-resolver") + cmd = '/tmp/conf-resolver' + if self.verbose: + cmd += ' --verbose' + for ns in vm.nameservers: + cmd += ' --ns {!r}'.format(ns) + for dom in vm.searchdomains: + cmd += ' --search {!r}'.format(dom) + if vm.dns_options: + cmd += ' --options {!r}'.format(vm.dns_options) + else: + cmd += ' --options {!r}'.format('') + commands.append(cmd) commands.append("rm -f /tmp/conf-resolver") purpose = self.re_doublequote.sub('\\\"', vm.purpose) -- 2.39.5