Fix checking mongodb replication status
backport: stein, rocky
The reason it did not work before was that the other handlers had never been called
after [0], tasks from start.yml were move to handler which cannot act
like tasks, also bootstrap tasks must run after 'Restart mongodb container'.
This commit adds a notify after 'Restart mongodb container' for triger
task 'bootstrap_cluster.yml'.
[0] 40b635b9c5
Change-Id: I4e2fbe9a8f20afcc4e25a01e23e5231e74eeeec4
This commit is contained in:
parent
cb0cb441c2
commit
6bb01bd7b1
@ -25,6 +25,7 @@
|
||||
notify:
|
||||
- Waiting for the mongodb startup
|
||||
- Checking current replication status
|
||||
- Bootstrap cluster
|
||||
|
||||
- name: Waiting for the mongodb startup
|
||||
wait_for: host={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} port={{ mongodb_port }}
|
||||
@ -37,5 +38,6 @@
|
||||
delegate_to: "{{ groups['mongodb'][0] }}"
|
||||
run_once: True
|
||||
|
||||
- include_tasks: "bootstrap_cluster.yml"
|
||||
- name: Bootstrap cluster
|
||||
include_tasks: "bootstrap_cluster.yml"
|
||||
when: mongodb_replication_status.stdout != "1"
|
||||
|
Loading…
Reference in New Issue
Block a user