1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

merge main.yml and main2.yml

This commit is contained in:
Jerry Vonau 2020-08-26 09:18:16 -05:00
parent 19b6dd4c71
commit a9db72af81
2 changed files with 24 additions and 45 deletions

View file

@ -31,24 +31,30 @@
- debug:
var: is_raspbian
#- name: EXIT 'mongodb' ROLE & CONTINUE, IF 'is_debian and not is_raspbian' i.e. TRUE DEBIAN (where MongoDB no longer exists)
# fail: # FORCE IT RED THIS ONCE!
# msg: ATTEMPTED MongoDB INSTALLATION WITH (TRUE) DEBIAN, which is no longer supported. Nevertheless IIAB will continue (consider this a warning!)
# 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
- 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
# 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
include_tasks: main2.yml
# when: is_raspbian or not is_debian
#'mongodb' systemd service - started on demand by sugarizer
# Just recording that mongodb should be running
# THE block: APPROACH BELOW WORKS JUST LIKE main2.yml ABOVE.
# BUT IT VISUALLY POLLUTES: MANY BLUE "skipping:" MESSAGES IN ANSIBLE'S OUTPUT.
# - block: # ENTIRE BLOCK CONDITIONED ON 'when: is_raspbian or not is_debian'
#
# [MOVED TO main2.yml]
#
# when: is_raspbian or not is_debian # CONDITION FOR ENTIRE ABOVE block:
- 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 }}"

View file

@ -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 }}"