diff --git a/README.md b/README.md index 46e3b65..d8e1eb6 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,8 @@ More extensive example: SelectType: "select/cons_res" SelectTypeParameters: "CR_Core" SlurmctldHost: "slurmctl" + # Use a list to configure master and backups Slurmctld hosts + # SlurmctldHost: ['slurmctl1', 'slurmctl2'] SlurmctldLogFile: "/var/log/slurm/slurmctld.log" SlurmctldPidFile: "/var/run/slurmctld.pid" SlurmdLogFile: "/var/log/slurm/slurmd.log" diff --git a/templates/slurm.conf.j2 b/templates/slurm.conf.j2 index e1bc114..f0761cc 100644 --- a/templates/slurm.conf.j2 +++ b/templates/slurm.conf.j2 @@ -11,8 +11,14 @@ ControlMachine=localhost {% for key in __slurm_config_merged | sort %} {% set val = __slurm_config_merged[key] %} {% if val is not none and val != omit %} +{% if key == 'SlurmctldHost' and val is iterable and val is not string and val is not mapping %} +{% for slurmctldhost in val %} +SlurmctldHost={{ slurmctldhost }} +{% endfor %} +{% else %} {{ key }}={{ 'YES' if val is sameas true else ('NO' if val is sameas false else val) }} {% endif %} +{% endif %} {% endfor %} # Nodes