Skip to content

Commit 45508b9

Browse files
committed
fix regression on non systemd debian
1 parent 7c72426 commit 45508b9

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

handlers/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111

1212
- name: reload systemd
1313
shell: systemctl daemon-reload
14+
when: systemd.stat.exists == true

tasks/configure.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,12 @@
1313
template: src=logrotate.conf.j2 dest=/etc/logrotate.d/mongodb.conf
1414
when: mongodb_logrotate
1515

16-
#- name: reload systemd
17-
# shell: systemctl daemon-reload
18-
# when: systemd.stat.exists == true
19-
# changed_when: false
20-
2116
- name: ensure mongodb started and enabled
2217
service: name={{ mongodb_daemon_name }} state=started enabled=yes
2318

2419
- name: wait MongoDB port is listening
25-
wait_for: host="{{ mongodb_conf_bind_ip }}"port="{{ mongodb_conf_port }}" delay=5 state=started
26-
when: systemd.stat.exists == true
20+
wait_for: host="{{ mongodb_conf_bind_ip }}"port="{{ mongodb_conf_port }}" delay=10 timeout=60 state=started
21+
#when: systemd.stat.exists == true
2722

2823
- include: auth_initialization.yml
2924
when: mongodb_conf_auth

tasks/install.deb.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- include_vars: "{{ansible_distribution}}.yml"
44

55
- name: Check if systemd is present
6-
stat: path=/lib/systemd/system/
6+
stat: path=/bin/systemd
77
register: systemd
88

99
- name: Add systemd configuration if present
@@ -28,9 +28,11 @@
2828

2929
- name: Install MongoDB package
3030
apt: pkg={{mongodb_package}} state=present
31-
notify: reload systemd
3231

33-
- meta: flush_handlers
32+
- name: reload systemd
33+
shell: systemctl daemon-reload
34+
changed_when: false
35+
when: systemd.stat.exists == true
3436

3537
- name: Install additional packages
3638
apt: pkg={{item}}

0 commit comments

Comments
 (0)