File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919- name : wait MongoDB port is listening
2020 wait_for : host="{{ mongodb_conf_bind_ip }}"port="{{ mongodb_conf_port }}" delay=10 timeout=60 state=started
21- # when: systemd.stat.exists == true
21+ when : " ' systemd' in systemd.stdout "
2222
2323- include : auth_initialization.yml
2424 when : mongodb_conf_auth
Original file line number Diff line number Diff line change 22
33- include_vars : " {{ansible_distribution}}.yml"
44
5- - name : Check if systemd is present
6- stat : path=/bin/systemd
5+ - name : Check if running on systemd
6+ command : cat /proc/1/cmdline
77 register : systemd
88
99- name : Add systemd configuration if present
1010 copy : src=mongodb.service dest=/lib/systemd/system/mongodb.service owner=root group=root mode=0640
11- when : systemd.stat.exists == true
11+ when : " ' systemd' in systemd.stdout "
1212
1313- name : Add symlink for systemd
1414 file : src=/lib/systemd/system/mongodb.service dest=/etc/systemd/system/multi-user.target.wants/mongodb.service state=link
15- when : systemd.stat.exists == true
15+ when : " ' systemd' in systemd.stdout "
1616 notify : reload systemd
1717
1818- meta : flush_handlers
19- when : systemd.stat.exists == true
19+ when : " ' systemd' in systemd.stdout "
2020
2121- name : Add APT key
2222 apt_key : url=http://docs.mongodb.org/10gen-gpg-key.asc id=7F0CEB10
3232- name : reload systemd
3333 shell : systemctl daemon-reload
3434 changed_when : false
35- when : systemd.stat.exists == true
35+ when : " ' systemd' in systemd.stdout "
3636
3737- name : Install additional packages
3838 apt : pkg={{item}}
Original file line number Diff line number Diff line change 22
33- include : install.deb.yml
44 when : ansible_os_family == 'Debian'
5+ tags : [mongodb]
56
67- include : configure.yml
8+ tags : [mongodb]
79
810- include : replication.yml
911 when : mongodb_conf_replSet != ""
12+ tags : [mongodb]
1013
1114- include : mms-agent.yml
1215 when : mongodb_mms_api_key != ""
16+ tags : [mongodb]
You can’t perform that action at this time.
0 commit comments