]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Setting location on fixing hostname
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 15 Aug 2024 12:21:48 +0000 (14:21 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 15 Aug 2024 12:21:48 +0000 (14:21 +0200)
lib/create_terraform/handler/files.py

index bd20857837d6dea3dcfb9812a338226f76446a58..d0a54a4076e27b074ae3b51b4d6cccd3fbcd857e 100644 (file)
@@ -28,7 +28,7 @@ from ..errors import AbortExecution
 
 from ..xlate import XLATOR
 
-__version__ = '0.5.5'
+__version__ = '0.5.6'
 LOG = logging.getLogger(__name__)
 
 _ = XLATOR.gettext
@@ -778,6 +778,8 @@ class CrTfHandlerFilesMixin():
             files.append('init-puppet')
         files.append('update-all-packages')
 
+        zone = "{z}/{c}".format(z=vm.vsphere, c=vm.cluster)
+
         for sname in files:
 
             if self.verbose > 1:
@@ -842,7 +844,6 @@ class CrTfHandlerFilesMixin():
 
         commands.append("echo '------------------------------'")
         purpose = self.re_doublequote.sub('\\\"', vm.purpose)
-        zone = "{z}/{c}".format(z=vm.vsphere, c=vm.cluster)
         commands.append("chmod -v +x /tmp/create-motd")
         cmd = (
             "/tmp/create-motd --purpose '{p}' --hardware 'vmware (x86_64)' --owner '{o}' "
@@ -882,7 +883,7 @@ class CrTfHandlerFilesMixin():
 
         commands.append("echo '------------------------------'")
         commands.append("chmod -v +x /tmp/fix-etc-hosts")
-        commands.append("/tmp/fix-etc-hosts --no-ipv6")
+        commands.append("/tmp/fix-etc-hosts --no-ipv6 --location 'VMWare {}'".format(zone))
 
         content += '  provisioner "remote-exec" {\n'
         content += '    inline = [\n'