summaryrefslogtreecommitdiffstats
path: root/ansible/node/roles/storage/templates/gpfs_nodes.j2
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/node/roles/storage/templates/gpfs_nodes.j2')
-rw-r--r--ansible/node/roles/storage/templates/gpfs_nodes.j233
1 files changed, 33 insertions, 0 deletions
diff --git a/ansible/node/roles/storage/templates/gpfs_nodes.j2 b/ansible/node/roles/storage/templates/gpfs_nodes.j2
new file mode 100644
index 0000000..5a9ecd7
--- /dev/null
+++ b/ansible/node/roles/storage/templates/gpfs_nodes.j2
@@ -0,0 +1,33 @@
+# GPFS nodes file generated by autocluster
+{# #}
+{# Count dedicated storage nodes, find first CTDB node #}
+{# #}
+{% set num_storage_nodes = 0 %}
+{% set first_ctdb_node = "" %}
+{% for hostname, n in nodes | dictsort %}
+{% if n.has_shared_storage %}
+{% if n.is_ctdb_node %}
+{% if not first_ctdb_node %}
+{% set first_ctdb_node = hostname %}
+{% endif %}
+{% else %}
+{% set num_storage_nodes = num_storage_nodes + 1 %}
+{% endif %}
+{% endif %}
+{% endfor %}
+{# #}
+{# Generate GPFS nodes file lines #}
+{# #}
+{% for hostname, n in nodes | dictsort %}
+{% if n.is_ctdb_node %}
+{% if hostname == first_ctdb_node %}
+{{ hostname }}:manager-quorum:
+{% elif num_storage_nodes > 0 %}
+{{ hostname }}:manager:
+{% else %}
+{{ hostname }}:manager-quorum:
+{% endif %}
+{% elif n.has_shared_storage %}
+{{ hostname }}:manager-quorum:
+{% endif %}
+{% endfor %}