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