]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Calling create-motd with all necessary parameters
authorFrank Brehm <frank.brehm@pixelpark.com>
Tue, 4 Jan 2022 13:23:00 +0000 (14:23 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Tue, 4 Jan 2022 13:23:00 +0000 (14:23 +0100)
lib/cr_tf/handler.py

index d7b24a07ea7070a0e18d6c702df73ebc75f4cea5..fe69ff633514a0e249f24eae6b9755bfa5fc03e7 100644 (file)
@@ -67,7 +67,7 @@ from .terraform.disk import TerraformDisk
 
 from .xlate import XLATOR
 
-__version__ = '3.6.6'
+__version__ = '3.6.7'
 LOG = logging.getLogger(__name__)
 
 _ = XLATOR.gettext
@@ -2738,10 +2738,13 @@ class CreateTerraformHandler(BaseHandler):
         purpose = self.re_doublequote.sub('\\\"', vm.purpose)
 
         commands.append("chmod +x /tmp/create-motd")
-        commands.append((
-            "/tmp/create-motd --purpose '{p} ({t})' --hardware 'vmware (x86_64)' --owner '{o}' "
-            "--zone 'VMWare' --customer '{c}'  | tee /etc/motd").format(
-                p=purpose, t=vm.puppet_tier, o=vm.customer, c=vm.puppet_customer))
+        cmd = ("/tmp/create-motd --purpose '{p}' --hardware 'vmware (x86_64)' --owner '{o}' "
+                "--zone 'VMWare' --customer '{c}'  --email '{m}' --tier '{t}' "
+                "--environment '{e}'").format( p=purpose, t=vm.puppet_tier, o=vm.customer,
+                c=vm.puppet_customer, m=vm.puppet_contact, e=vm.puppet_env)
+        if vm.puppet_project:
+            cmd += " --project '{pr}'".format(pr=vm.puppet_project)
+        commands.append(cmd)
         commands.append("rm -f /tmp/create-motd")
 
         # ## Backup - Legato networker