From a49888c5021e42fecd3c00b30bef071b4d880828 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 23 Nov 2023 10:17:44 +0100 Subject: [PATCH] Setting tag for OS RHEL on VMs with RHEL --- lib/cr_tf/handler/files.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cr_tf/handler/files.py b/lib/cr_tf/handler/files.py index 38cae7c..f079276 100644 --- a/lib/cr_tf/handler/files.py +++ b/lib/cr_tf/handler/files.py @@ -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 -- 2.39.5