diff options
author | Martin Schwenke <martin@meltin.net> | 2019-02-06 14:53:10 +1100 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2019-03-25 16:52:25 +1100 |
commit | 51ff83de30db6934e243226ce05c6394b8986a12 (patch) | |
tree | f8dbbe3ceabc398a4596c968285a7245b3c70e01 /ansible/node/roles/storage/templates/gpfs_primary_secondary.j2 | |
parent | 7003df8ad2ec9eaa119439f21976e7117b1771e5 (diff) | |
download | autocluster-51ff83de30db6934e243226ce05c6394b8986a12.tar.gz autocluster-51ff83de30db6934e243226ce05c6394b8986a12.tar.xz autocluster-51ff83de30db6934e243226ce05c6394b8986a12.zip |
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 <martin@meltin.net>
Diffstat (limited to 'ansible/node/roles/storage/templates/gpfs_primary_secondary.j2')
-rw-r--r-- | ansible/node/roles/storage/templates/gpfs_primary_secondary.j2 | 19 |
1 files changed, 19 insertions, 0 deletions
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 %} |