1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Cleaner for systemd, to diagnose #942 ?

This commit is contained in:
A Holt 2018-07-22 11:01:31 -04:00 committed by GitHub
parent f62b60f288
commit aad50e0c4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,10 +16,10 @@
owner: mongodb
with_items:
- { path: '/var/run/mongodb' }
- { path: "{{ mongodb_db_path }}" }
- { path: "{{ mongodb_db_path }}" } # == /library/dbdata/mongodb/
- { path: '/var/log/mongodb' }
- name: Populate & position /etc/mongod.conf, /etc/systemd/system/mongodb.service
- name: Populate & position /etc/mongod.conf, mongodb.service
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
@ -27,25 +27,26 @@
group: root
mode: 0644
with_items:
- { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' }
- { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}" }
- { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' }
- name: "systemctl daemon-reload" in case mongodb.service changed
systemd:
state: restarted
daemon_reload: yes
- name: Restart service if enabled
service:
name: "{{ item.name }}"
name: mongodb
enabled: yes
state: restarted
with_items:
- { name: mongodb }
when: mongodb_enabled
- name: Stop service if not enabled
service:
name: "{{ item.name }}"
name: mongodb
enabled: no
state: stopped
with_items:
- { name: mongodb }
when: not mongodb_enabled
- name: Add 'mongodb' to list of services at /etc/iiab/iiab.ini