From 7e5a192ca25b6db5ae20588f223281a62a92a5aa Mon Sep 17 00:00:00 2001 From: "tommaso.piccioli" Date: Wed, 16 Dec 2015 14:59:00 +0100 Subject: [PATCH] stop mongod before update --- mongodb-org-3/tasks/mongodb.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mongodb-org-3/tasks/mongodb.yml b/mongodb-org-3/tasks/mongodb.yml index d8809a12..f0cb3e3f 100644 --- a/mongodb-org-3/tasks/mongodb.yml +++ b/mongodb-org-3/tasks/mongodb.yml @@ -1,4 +1,9 @@ --- +- name: Ensure mongod is stopped and disabled + service: name=mongod state=stopped enabled=no + when: ( mongodb_start_server is defined ) and ( mongodb_start_server == 'no' ) and ( mongodb_install_conf ) + tags: mongodb + - name: Install the mongodb apt key #apt_key: id=7F0CEB10 state=present raw: apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 @@ -48,7 +53,3 @@ when: ( mongodb_start_server is defined ) and ( mongodb_start_server == 'yes' ) and ( mongodb_install_conf ) tags: mongodb -- name: Ensure mongod is stopped and disabled - service: name=mongod state=stopped enabled=no - when: ( mongodb_start_server is defined ) and ( mongodb_start_server == 'no' ) and ( mongodb_install_conf ) - tags: mongodb