Skip to content

Commit 67821d9

Browse files
authored
Merge pull request #25 from OpenNebula/ha-fixes
Fixes to FE HA framework
2 parents 83c85db + 27b4656 commit 67821d9

File tree

5 files changed

+12
-60
lines changed

5 files changed

+12
-60
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ __pycache__/
66
!/inventory/example.yml
77
.vscode
88
.ansible/
9+
inventory/reference/local-ha.yml

inventory/reference/group_vars/all.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ ansible_python_interpreter: /usr/bin/python3
44
validation:
55
# Check if OpenNebula services are running
66
core_services: true
7-
run_ha_verifications: true
8-
one_config_path:
9-
- /etc/one
10-
- /var/lib/one/remotes/etc
7+
run_ha_verifications: true
118
# List of services to check enabled, stop and restart
129
service_list:
1310
- name: opennebula.service
@@ -60,3 +57,8 @@ validation:
6057
interface_name: 'br-test'
6158
fencing_check_retries: 8
6259
fencing_check_delay: 60
60+
fe_ha:
61+
one_config_path:
62+
- /etc/one
63+
- /var/lib/one/remotes/etc
64+
one_zone_name: OpenNebula

inventory/reference/local-ha.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

playbooks/validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
- hosts: "{{ frontend_group | d('frontend') }}"
7373
roles:
7474
- role: fe_ha
75-
when: validation.run_ha_verifications == true
75+
when: validation.run_ha_verifications == true
7676

7777

7878
# Run network tests on the hypervisor hosts

roles/fe_ha/tasks/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# Get zone details from the first FE, Assuming state set to 3 is the leader state
3030
- name: Get Zone
3131
ansible.builtin.shell:
32-
cmd: onezone show "{{ one_zone_name }}" -j | jq -r '.ZONE.SERVER_POOL.SERVER | .[] |select(.STATE == "3") | .NAME'
32+
cmd: onezone show "{{ validation.fe_ha.one_zone_name }}" -j | jq -r '.ZONE.SERVER_POOL.SERVER | .[] |select(.STATE == "3") | .NAME'
3333
register: zone_details
3434
ignore_errors: true
3535
when: hostvars[groups[frontend_group | d('frontend')][0]]['ansible_host'] == ansible_host
@@ -42,7 +42,7 @@
4242
file_type: file
4343
recurse: true
4444
register: found_files
45-
loop: "{{ validation.one_config_path }}"
45+
loop: "{{ validation.fe_ha.one_config_path }}"
4646

4747
- name: Set combined list
4848
set_fact:
@@ -78,9 +78,9 @@
7878
loop: "{{ groups.frontend }}"
7979
run_once: true
8080

81-
- name: Save /etc/one content checks
81+
- name: Save file content checks
8282
set_fact:
83-
verification_result: "{{ verification_result | combine({'Check Content /etc/one diretory for file diffs at all FE nodes. Diff files': diff_files }) }}"
83+
verification_result: "{{ verification_result | combine({'Check Content of the config diretory for file diffs at all FE nodes. Diff files': diff_files }) }}"
8484
run_once: true
8585

8686
### Leader failover tests

0 commit comments

Comments
 (0)