Merge pull request #4 from deimosfr/master

fix regression on non systemd debian
This commit is contained in:
Sergei Antipov 2015-02-26 20:11:22 +05:00
commit ec4de12ae7
3 changed files with 8 additions and 10 deletions

View File

@ -11,3 +11,4 @@
- name: reload systemd
shell: systemctl daemon-reload
when: systemd.stat.exists == true

View File

@ -13,17 +13,12 @@
template: src=logrotate.conf.j2 dest=/etc/logrotate.d/mongodb.conf
when: mongodb_logrotate
#- name: reload systemd
# shell: systemctl daemon-reload
# when: systemd.stat.exists == true
# changed_when: false
- name: ensure mongodb started and enabled
service: name={{ mongodb_daemon_name }} state=started enabled=yes
- name: wait MongoDB port is listening
wait_for: host="{{ mongodb_conf_bind_ip }}"port="{{ mongodb_conf_port }}" delay=5 state=started
when: systemd.stat.exists == true
wait_for: host="{{ mongodb_conf_bind_ip }}"port="{{ mongodb_conf_port }}" delay=10 timeout=60 state=started
#when: systemd.stat.exists == true
- include: auth_initialization.yml
when: mongodb_conf_auth

View File

@ -3,7 +3,7 @@
- include_vars: "{{ansible_distribution}}.yml"
- name: Check if systemd is present
stat: path=/lib/systemd/system/
stat: path=/bin/systemd
register: systemd
- name: Add systemd configuration if present
@ -28,9 +28,11 @@
- name: Install MongoDB package
apt: pkg={{mongodb_package}} state=present
notify: reload systemd
- meta: flush_handlers
- name: reload systemd
shell: systemctl daemon-reload
changed_when: false
when: systemd.stat.exists == true
- name: Install additional packages
apt: pkg={{item}}