mongodb_replicaset/test: properly kill the nodes

The `pids` module returns the list of the PID in a `pids` key.

This change ensures we correctly wait for the end of the previous mongod
instances before we start the next ones.

In addition, we remove an unnecessary `ignore_errors`.

See: #61938

Original PR: https://github.com/ansible/ansible/pull/62627
(cherry picked from commit cee55ab718)
pull/62825/head
Gonéri Le Bouder 5 years ago committed by Toshio Kuratomi
parent fc1d7f9e5a
commit 2a68bc0c29

@ -89,7 +89,7 @@
wait_for: wait_for:
path: "/proc/{{ item }}/status" path: "/proc/{{ item }}/status"
state: absent state: absent
with_items: "{{ pids_of_mongod }}" with_items: "{{ pids_of_mongod.pids }}"
- set_fact: - set_fact:
current_replicaset: "{{ mongodb_replicaset1 }}" current_replicaset: "{{ mongodb_replicaset1 }}"

@ -36,7 +36,6 @@
chdir: "{{ remote_tmp_dir }}" chdir: "{{ remote_tmp_dir }}"
with_items: "{{ mongodb_nodes | sort }}" with_items: "{{ mongodb_nodes | sort }}"
when: mongod_auth == True when: mongod_auth == True
ignore_errors: yes
- name: Wait for mongod to start responding - name: Wait for mongod to start responding
wait_for: wait_for:

Loading…
Cancel
Save