From 27079a112de15ca5a32e3fe5f98d2b48aec8da17 Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Thu, 29 Sep 2016 15:16:32 +0300 Subject: [PATCH] Enable generating topology.conf --- defaults/main.yml | 6 ++++++ tasks/common.yml | 5 +++++ templates/topology.conf.j2 | 4 ++++ 3 files changed, 15 insertions(+) create mode 100644 templates/topology.conf.j2 diff --git a/defaults/main.yml b/defaults/main.yml index 49f7f8c..62bffad 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -107,6 +107,12 @@ slurm_accounting_storage_enforce: "safe,qos" # If you wish to use a topology plugins (parameter TopologyPlugin=), # uncomment and edit the following: #slurm_topology_plugin: "topology/tree" +# If you use a topology plugin, you also need a topology.conf +# defined here, one element per line +#slurm_topologylist: +# - "SwitchName=s0 Nodes=c[0-18]" +# - "SwitchName=s1 Nodes=c[19-36]" +# - "SwitchName=s3 Switches=s[0,1]" slurm_clustername: "{{ siteName | default('test_cluster')}}" slurm_compute_nodes: "{{ nodeBase }}[1-4]" slurm_compute_realmemory: "126000" diff --git a/tasks/common.yml b/tasks/common.yml index f7f2984..43ed258 100644 --- a/tasks/common.yml +++ b/tasks/common.yml @@ -33,6 +33,11 @@ template: src=gres.conf.j2 dest=/etc/slurm/gres.conf owner=root mode=0644 notify: restart slurm + - name: Make from template topology.conf + template: src=topology.conf.j2 dest=/etc/slurm/topology.conf owner=root moder=0644 + notify: restart slurm + when: slurm_topology_plugin is defined + - name: Make from template slurm.conf template: src=slurm.conf.j2 dest=/etc/slurm/slurm.conf owner=root mode=0644 backup=yes notify: restart slurm diff --git a/templates/topology.conf.j2 b/templates/topology.conf.j2 new file mode 100644 index 0000000..93ca27d --- /dev/null +++ b/templates/topology.conf.j2 @@ -0,0 +1,4 @@ +# {{ ansible_managed }} +{% for topo in slurm_topologylist %} +{{ topo }} +{% endfor %}