From 2c37e2b706797b7f1e2669aeed695677c04acc89 Mon Sep 17 00:00:00 2001 From: Jakob Guldberg Aaes Date: Tue, 14 Nov 2023 09:04:46 +0100 Subject: [PATCH] use builtin ansible-managed system. This allows for easy modification of the message --- templates/generic.conf.j2 | 4 +--- templates/gres.conf.j2 | 4 +--- templates/logrotate.j2 | 3 +++ templates/slurm.conf.j2 | 4 +--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/templates/generic.conf.j2 b/templates/generic.conf.j2 index c9815ee..b7a65e1 100644 --- a/templates/generic.conf.j2 +++ b/templates/generic.conf.j2 @@ -1,6 +1,4 @@ -## -## This file is maintained by Ansible - ALL MODIFICATIONS WILL BE REVERTED -## +{{ ansible_managed | comment }} {% set conf = lookup('vars', item.config) %} {% for key in conf | sort %} diff --git a/templates/gres.conf.j2 b/templates/gres.conf.j2 index 68d4958..c2a1020 100644 --- a/templates/gres.conf.j2 +++ b/templates/gres.conf.j2 @@ -1,6 +1,4 @@ -## -## This file is maintained by Ansible - ALL MODIFICATIONS WILL BE REVERTED -## +{{ ansible_managed | comment }} {% set conf = lookup('vars', item.config) %} {% for gres in conf %} diff --git a/templates/logrotate.j2 b/templates/logrotate.j2 index ceb7a4d..fa4f94b 100644 --- a/templates/logrotate.j2 +++ b/templates/logrotate.j2 @@ -1,6 +1,9 @@ +{{ ansible_managed | comment }} + ## # Slurm Logrotate Configuration ## + # TODO: this ignores the actual *LogFile values {{ '/var/log/slurm-llnl' if __slurm_debian else '/var/log/slurm' }}/*.log { compress diff --git a/templates/slurm.conf.j2 b/templates/slurm.conf.j2 index e1bc114..b6644b5 100644 --- a/templates/slurm.conf.j2 +++ b/templates/slurm.conf.j2 @@ -1,6 +1,4 @@ -## -## This file is maintained by Ansible - ALL MODIFICATIONS WILL BE REVERTED -## +{{ ansible_managed | comment }} {% if 'ControlMachine' not in __slurm_config_merged and 'SlurmctldHost' not in __slurm_config_merged %} # Default, define SlurmctldHost or ControlMachine to override