From: Frank Brehm Date: Thu, 23 Nov 2023 09:17:44 +0000 (+0100) Subject: Setting tag for OS RHEL on VMs with RHEL X-Git-Tag: 1.8.0^2~6 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=a49888c5021e42fecd3c00b30bef071b4d880828;p=pixelpark%2Fcreate-terraform.git Setting tag for OS RHEL on VMs with RHEL --- 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