From 705ea295b3c4e716ea0e7d370775b50c7ff58617 Mon Sep 17 00:00:00 2001 From: Ruben Laguna Date: Wed, 4 May 2016 11:09:05 +0200 Subject: [PATCH] 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. --- tasks/configure.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks/configure.yml b/tasks/configure.yml index 80678f6..33c3fef 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -47,6 +47,9 @@ service: name={{ mongodb_daemon_name }} state=restarted 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 set_fact: wait_for_host: 127.0.0.1