Ensure service is started

Since the service could have been stopped manually (outside Ansible) we should ensure that the service is started before waiting for the port to come up.
This commit is contained in:
Ruben Laguna 2016-05-04 11:09:05 +02:00
parent 084f09a789
commit 705ea295b3
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@
service: name={{ mongodb_daemon_name }} state=restarted service: name={{ mongodb_daemon_name }} state=restarted
when: config_result|changed and mongodb_manage_service when: config_result|changed and mongodb_manage_service
- name: Ensure service is started
service: name={{ mongodb_daemon_name }} state=started
- name: Set fact about wait_for host address - name: Set fact about wait_for host address
set_fact: set_fact:
wait_for_host: 127.0.0.1 wait_for_host: 127.0.0.1