File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111
1212- name : reload systemd
1313 shell : systemctl daemon-reload
14+ when : systemd.stat.exists == true
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
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}}
You can’t perform that action at this time.
0 commit comments