You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- name: Check if external_backup_server_user is set
1
+
- name: Check if single_node is defined
2
2
fail:
3
-
msg: 'external_backup_server_user variable was deprecated in OpenCRVS 1.5. Please rename the variable to backup_server_remote_target_directory'
4
-
when: external_backup_server_user is defined
3
+
msg: |
4
+
Configuration error: single_node variable is not defined.
5
+
Please add 'single_node: true' or 'single_node: false' under the 'all.vars' section.
6
+
when: single_node is not defined
5
7
6
-
- name: Check if external_backup_server_remote_directory is set
7
-
fail:
8
-
msg: 'external_backup_server_remote_directory variable was deprecated in OpenCRVS 1.5. Please rename the variable to backup_server_remote_target_directory'
9
-
when: external_backup_server_remote_directory is defined
8
+
- name: Get all Node groups
9
+
set_fact:
10
+
child_groups: "{{ groups.keys() | difference(['all', 'ungrouped']) | list }}"
11
+
12
+
- name: Display child groups
13
+
debug:
14
+
msg: "Detected Node groups: {{ child_groups }}"
10
15
11
-
- name: 'Check mandatory variables are defined'
12
-
assert:
13
-
that:
14
-
- mongodb_admin_username is defined
15
-
- mongodb_admin_password is defined
16
-
- elasticsearch_superuser_password is defined
17
-
- encrypted_disk_size is defined
16
+
- name: Fail if single_node is set to False and worker nodes are not present
17
+
fail:
18
+
msg: |
19
+
Configuration mismatch detected!
20
+
single_node is set to 'false' but only {{ child_groups | length }} group found: {{ child_groups }}
21
+
For multi-node setup (single_node: false), you need at least 2 groups (e.g., master and workers).
22
+
when:
23
+
- single_node == false
24
+
- child_groups | length == 1
18
25
19
-
- name: 'Prevent single-node configuration in production'
26
+
- name: Fail if single_node is set to True and multiple groups are present
20
27
fail:
21
-
msg: 'The production environment should always use more than one node. Please check the inventory file for production.'
22
-
when: >
23
-
(single_node | default(false)) == false and (
24
-
'docker-workers' not in groups or
25
-
groups['docker-workers'] | length == 0
26
-
)
28
+
msg: |
29
+
Configuration mismatch detected!
30
+
single_node is set to 'true' but multiple groups found: {{ child_groups }}
31
+
For single-node setup (single_node: true), only one group should be present.
0 commit comments