mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +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
|
owner: mongodb
|
||||||
with_items:
|
with_items:
|
||||||
- { path: '/var/run/mongodb' }
|
- { path: '/var/run/mongodb' }
|
||||||
- { path: "{{ mongodb_db_path }}" }
|
- { path: "{{ mongodb_db_path }}" } # == /library/dbdata/mongodb/
|
||||||
- { path: '/var/log/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:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
|
@ -27,25 +27,26 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' }
|
|
||||||
- { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}" }
|
- { 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
|
- name: Restart service if enabled
|
||||||
service:
|
service:
|
||||||
name: "{{ item.name }}"
|
name: mongodb
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
with_items:
|
|
||||||
- { name: mongodb }
|
|
||||||
when: mongodb_enabled
|
when: mongodb_enabled
|
||||||
|
|
||||||
- name: Stop service if not enabled
|
- name: Stop service if not enabled
|
||||||
service:
|
service:
|
||||||
name: "{{ item.name }}"
|
name: mongodb
|
||||||
enabled: no
|
enabled: no
|
||||||
state: stopped
|
state: stopped
|
||||||
with_items:
|
|
||||||
- { name: mongodb }
|
|
||||||
when: not mongodb_enabled
|
when: not mongodb_enabled
|
||||||
|
|
||||||
- name: Add 'mongodb' to list of services at /etc/iiab/iiab.ini
|
- name: Add 'mongodb' to list of services at /etc/iiab/iiab.ini
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue