mirror of
https://github.com/iiab/iiab.git
synced 2025-02-15 04:32:11 +00:00
merge main.yml and main2.yml
This commit is contained in:
parent
19b6dd4c71
commit
a9db72af81
2 changed files with 24 additions and 45 deletions
|
@ -31,24 +31,30 @@
|
||||||
- debug:
|
- debug:
|
||||||
var: is_raspbian
|
var: is_raspbian
|
||||||
|
|
||||||
#- name: EXIT 'mongodb' ROLE & CONTINUE, IF 'is_debian and not is_raspbian' i.e. TRUE DEBIAN (where MongoDB no longer exists)
|
- name: Install MongoDB if 'mongodb_installed' not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml
|
||||||
# fail: # FORCE IT RED THIS ONCE!
|
include_tasks: install.yml
|
||||||
# msg: ATTEMPTED MongoDB INSTALLATION WITH (TRUE) DEBIAN, which is no longer supported. Nevertheless IIAB will continue (consider this a warning!)
|
when: mongodb_installed is undefined
|
||||||
# when: is_debian_10 and (ansible_architecture == "aarch64")
|
|
||||||
# #when: (is_debian and not is_raspbian) and (not is_debian_8) and (not is_debian_9) # Test for Debian 10+
|
|
||||||
# ignore_errors: yes
|
|
||||||
|
|
||||||
# ELSE...
|
- name: Disable & Stop 'mongodb' service, if not mongodb_enabled
|
||||||
|
systemd:
|
||||||
|
name: mongodb
|
||||||
|
enabled: no
|
||||||
|
state: stopped
|
||||||
|
when: not mongodb_enabled
|
||||||
|
|
||||||
- name: Install/Enable/Disable/Record MongoDB (main2.yml) if is_raspbian or not is_debian, i.e. not True Debian
|
#'mongodb' systemd service - started on demand by sugarizer
|
||||||
include_tasks: main2.yml
|
# Just recording that mongodb should be running
|
||||||
# when: is_raspbian or not is_debian
|
|
||||||
|
|
||||||
# THE block: APPROACH BELOW WORKS JUST LIKE main2.yml ABOVE.
|
- name: Add 'mongodb' variable values to {{ iiab_ini_file }}
|
||||||
# BUT IT VISUALLY POLLUTES: MANY BLUE "skipping:" MESSAGES IN ANSIBLE'S OUTPUT.
|
ini_file:
|
||||||
|
path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini
|
||||||
# - block: # ENTIRE BLOCK CONDITIONED ON 'when: is_raspbian or not is_debian'
|
section: mongodb
|
||||||
#
|
option: "{{ item.option }}"
|
||||||
# [MOVED TO main2.yml]
|
value: "{{ item.value | string }}"
|
||||||
#
|
with_items:
|
||||||
# when: is_raspbian or not is_debian # CONDITION FOR ENTIRE ABOVE block:
|
- 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 }}"
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
- name: Install MongoDB if 'mongodb_installed' not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml
|
|
||||||
include_tasks: install.yml
|
|
||||||
when: mongodb_installed is undefined
|
|
||||||
|
|
||||||
- name: Disable & Stop 'mongodb' service, if not mongodb_enabled
|
|
||||||
systemd:
|
|
||||||
name: mongodb
|
|
||||||
enabled: no
|
|
||||||
state: stopped
|
|
||||||
when: not mongodb_enabled
|
|
||||||
|
|
||||||
#'mongodb' systemd service - started on demand by sugarizer
|
|
||||||
# Just recording that mongodb should be running
|
|
||||||
|
|
||||||
- name: Add 'mongodb' variable values to {{ iiab_ini_file }}
|
|
||||||
ini_file:
|
|
||||||
path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini
|
|
||||||
section: mongodb
|
|
||||||
option: "{{ item.option }}"
|
|
||||||
value: "{{ item.value | string }}"
|
|
||||||
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 }}"
|
|
Loading…
Reference in a new issue