Merge pull request #26 from deimosfr/fix_1.4.1

fix issue with unmanaged service
This commit is contained in:
Sergei Antipov 2015-06-29 07:26:58 +05:00
commit 3aa9e72723
1 changed files with 16 additions and 0 deletions

View File

@ -4,6 +4,17 @@
- name: Restart mongodb service
service: name={{ mongodb_daemon_name }} state=restarted
when: mongodb_manage_service
- name: get pid of mongodb for non daemon mode
shell: "pidof mongod"
register: pidof_mongod
when: mongodb_manage_service == false
ignore_errors: yes
- name: start mongodb daemon
shell: "LC_ALL=C /usr/bin/mongod --config /etc/mongod.conf --fork"
when: mongodb_manage_service == false and pidof_mongod.rc == 1
- name: create administrative user siteUserAdmin
mongodb_user:
@ -52,3 +63,8 @@
- name: Restart mongodb service
service: name={{ mongodb_daemon_name }} state=restarted
when: mongodb_manage_service
- name: stop mongodb if was not started
shell: "kill {{ pidof_mongod.stdout }}"
when: mongodb_manage_service == false and pidof_mongod.rc == 0