From 51ff83de30db6934e243226ce05c6394b8986a12 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 6 Feb 2019 14:53:10 +1100 Subject: Add Ansible playbook for node configuration This will replace all of the existing node provisioning/configuration. CentOS 7 nodes are currently supported. Signed-off-by: Martin Schwenke --- .../roles/storage/templates/gpfs_primary_secondary.j2 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 ansible/node/roles/storage/templates/gpfs_primary_secondary.j2 (limited to 'ansible/node/roles/storage/templates/gpfs_primary_secondary.j2') diff --git a/ansible/node/roles/storage/templates/gpfs_primary_secondary.j2 b/ansible/node/roles/storage/templates/gpfs_primary_secondary.j2 new file mode 100644 index 0000000..aec7a37 --- /dev/null +++ b/ansible/node/roles/storage/templates/gpfs_primary_secondary.j2 @@ -0,0 +1,19 @@ +{# #} +{# Count dedicated storage nodes #} +{# #} +{% set num_storage_nodes = 0 %} +{% for hostname, n in nodes | dictsort %} +{% if n.has_shared_storage and not n.is_ctdb_node %} +{% set num_storage_nodes = num_storage_nodes + 1 %} +{% endif %} +{% endfor %} +{# #} +{# Write a single line containing "primary secondary" #} +{# #} +{% if num_storage_nodes >= 2 %} +{{ groups['storage-nodes'][0] }} {{ groups['storage-nodes'][1] }} +{% elif num_storage_nodes == 1 %} +{{ groups['storage-nodes'][0] }} {{ groups['nas-nodes'][0] }} +{% else %} +{{ groups['nas-nodes'][0] }} {{ groups['nas-nodes'][1] }} +{% endif %} -- cgit