]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Setting tag for OS RHEL on VMs with RHEL
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 23 Nov 2023 09:17:44 +0000 (10:17 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 23 Nov 2023 09:17:44 +0000 (10:17 +0100)
lib/cr_tf/handler/files.py

index 38cae7ce17a4a3eec3f6f9d4b54efb7dad28bd8b..f079276207ca2c88d2ce6469552be6ca30f4b947 100644 (file)
@@ -28,7 +28,7 @@ from ..errors import AbortExecution
 
 from ..xlate import XLATOR
 
-__version__ = '0.5.0'
+__version__ = '0.5.1'
 LOG = logging.getLogger(__name__)
 
 _ = XLATOR.gettext
@@ -681,6 +681,10 @@ class CrTfHandlerFilesMixin():
             content += tpl.format(tpl_vm.tf_name)
         content += '  enable_disk_uuid       = "true"\n\n'
 
+        if vm.is_rhel:
+            content += '  tags = [\n    "${{vsphere_tag.{}.id}}"\n  ]\n\n'.format(
+                self.config.vsphere_tag_os_rhel_id)
+
         content += textwrap.indent(textwrap.dedent('''\
         lifecycle {
           ignore_changes = all