mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 03:32:12 +00:00
Cleaner for systemd, to diagnose #942 ?
This commit is contained in:
parent
f62b60f288
commit
aad50e0c4e
1 changed files with 10 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue