From e9e838da118a6026eb5a2b074faeb70bdb6788f9 Mon Sep 17 00:00:00 2001 From: Jacopo De Amicis Date: Mon, 25 Sep 2023 02:28:08 +0200 Subject: [PATCH] Indent slurm_parallelcluster_slurmdbd.conf Jinja template Add trick to have the logic for the renderization of the template indented without affecting the final output. This improves the comprehension of the logic embedded in the template (although slightly visually impacting). Signed-off-by: Jacopo De Amicis --- .../slurm_parallelcluster_slurmdbd.conf | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/cookbooks/aws-parallelcluster-slurm/files/default/head_node_slurm/slurm/templates/slurm_parallelcluster_slurmdbd.conf b/cookbooks/aws-parallelcluster-slurm/files/default/head_node_slurm/slurm/templates/slurm_parallelcluster_slurmdbd.conf index eceda7363d..39f34414ee 100644 --- a/cookbooks/aws-parallelcluster-slurm/files/default/head_node_slurm/slurm/templates/slurm_parallelcluster_slurmdbd.conf +++ b/cookbooks/aws-parallelcluster-slurm/files/default/head_node_slurm/slurm/templates/slurm_parallelcluster_slurmdbd.conf @@ -1,16 +1,17 @@ -# slurm_parallelcluster_slurmdbd.conf is managed by the pcluster processes. -# Do not modify. -# Please add user-specific slurmdbd configuration options in slurmdbd.conf -{% if scaling_config.Database.Uri is defined %} -DbdHost={{ head_node_config.head_node_hostname }} -StorageHost={{ scaling_config.Database.Uri | uri_host }} -StoragePort={{ scaling_config.Database.Uri | uri_port }} -{% if scaling_config.Database.DatabaseName is defined %} -StorageLoc={{ scaling_config.Database.DatabaseName }} -{% else %} -{# Dashes in StorageLoc cause issues with the database creation #} -StorageLoc={{ cluster_name | replace("-", "_") }} -{% endif %} -StorageUser={{ scaling_config.Database.UserName }} -StoragePass=dummy -{% endif %} +{# Adding comments at the beginning of each line is a trick to indent the template without affecting the output #} +{##}# slurm_parallelcluster_slurmdbd.conf is managed by the pcluster processes. +{##}# Do not modify. +{##}# Please add user-specific slurmdbd configuration options in slurmdbd.conf +{##}{% if scaling_config.Database.Uri is defined %} +{# #}DbdHost={{ head_node_config.head_node_hostname }} +{# #}StorageHost={{ scaling_config.Database.Uri | uri_host }} +{# #}StoragePort={{ scaling_config.Database.Uri | uri_port }} +{# #}{% if scaling_config.Database.DatabaseName is defined %} +{# #}StorageLoc={{ scaling_config.Database.DatabaseName }} +{# #}{% else %} +{# #}{# Dashes in StorageLoc cause issues with the database creation #} +{# #}StorageLoc={{ cluster_name | replace("-", "_") }} +{# #}{% endif %} +{# #}StorageUser={{ scaling_config.Database.UserName }} +{# #}StoragePass=dummy +{##}{% endif %}