ansible_slurm/templates/slurm.conf.j2
Nate Coraor d18c8f91ea Don't set a pid file on EL, and use omit instead of None as the
default since "{{ None }}" actually becomes an empty string (there isn't
a way to set a variable to None/null from a template block as far as I
can tell).
2019-03-27 16:24:43 -04:00

33 lines
1.1 KiB
Django/Jinja

##
## This file is maintained by Ansible - ALL MODIFICATIONS WILL BE REVERTED
##
{% if 'ControlMachine' not in __slurm_config_merged and 'SlurmctldHost' not in __slurm_config_merged %}
# Default, define SlurmctldHost or ControlMachine to override
ControlMachine=localhost
{% endif %}
# Configuration options
{% for key in __slurm_config_merged | sort %}
{% set val = __slurm_config_merged[key] %}
{% if val is not none and val != omit %}
{{ key }}={{ 'YES' if val is sameas true else ('NO' if val is sameas false else val) }}
{% endif %}
{% endfor %}
# Nodes
{% for i in slurm_nodes %}
NodeName={{ i.name }}{% for k in i | sort if k != 'name' %} {{ k }}={{ 'YES' if i[k] is sameas true else ('NO' if i[k] is sameas false else i[k]) }}{% endfor %}
{% else %}
NodeName=localhost State=UNKNOWN
{% endfor %}
# Partitions
{% for i in slurm_partitions %}
PartitionName={{ i.name }}{% for k in i | sort if k != 'name' %} {{ k }}={{ 'YES' if i[k] is sameas true else ('NO' if i[k] is sameas false else i[k]) }}{% endfor %}
{% else %}
PartitionName=debug Default=YES Nodes={{ (slurm_nodes[0] | default({})).name | default('localhost') }} State=UP
{% endfor %}