]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Using DNS search domains and options on calling postinstall-scripts/conf-resolver
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 16 Dec 2019 17:14:22 +0000 (18:14 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 16 Dec 2019 17:14:22 +0000 (18:14 +0100)
lib/cr_tf/handler.py

index 90029f4f3be526855ade84f1f9c918e6af0ee8e9..45565bfa0d06d3b6832979848a4d2a2e57e9f088 100644 (file)
@@ -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)