Skip to content

Commit

Permalink
Merge pull request #26 from deimosfr/fix_1.4.1
Browse files Browse the repository at this point in the history
fix issue with unmanaged service
  • Loading branch information
UnderGreen committed Jun 29, 2015
2 parents 5dc2d56 + 9bb1648 commit 3aa9e72
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tasks/auth_initialization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit 3aa9e72

Please sign in to comment.