mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
# 3. ENABLE/DISABLE
|
|
|
|
# 2019-07-08: mongodb_install is completely ignored. FYI mongodb_enabled: False
|
|
# works but is ineffective, as Sugarizer starts mongodb's systemd svc on its own
|
|
|
|
- name: Enable & Restart 'mongodb' systemd service if mongodb_enabled, incl daemon-reload (in case mongodb.service changed?)
|
|
systemd:
|
|
name: mongodb
|
|
daemon_reload: yes
|
|
enabled: yes
|
|
state: restarted
|
|
when: mongodb_enabled | bool
|
|
|
|
- name: Disable 'mongodb' service, if not mongodb_enabled
|
|
systemd:
|
|
name: mongodb
|
|
daemon_reload: yes
|
|
enabled: no
|
|
state: stopped
|
|
when: not mongodb_enabled
|
|
|
|
|
|
# 4. DOCUMENT IN /etc/iiab/iiab.ini
|
|
|
|
- name: Add 'mongodb' variable values to {{ iiab_ini_file }}
|
|
ini_file:
|
|
path: "{{ iiab_ini_file }}"
|
|
section: mongodb
|
|
option: "{{ item.option }}"
|
|
value: "{{ item.value }}"
|
|
with_items:
|
|
- option: name
|
|
value: MongoDB
|
|
- option: description
|
|
value: '"MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling."'
|
|
- option: enabled
|
|
value: "{{ mongodb_enabled }}"
|
|
|