1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Merge pull request #2189 from holta/scaff2

Scaffolding 2.0 for supermodel playbooks e.g. wordpress, munin, captiveportal
This commit is contained in:
A Holt 2020-01-23 23:50:14 -05:00 committed by GitHub
commit 9d4dd4c4fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 289 additions and 206 deletions

View file

@ -33,10 +33,28 @@
setup:
filter: ansible_local
# 2020-01-21: checks 46+46 vars...for now...expect validate_vars.yml to change!
- name: Pre-check that IIAB's "XYZ_install" + "XYZ_enabled" vars (1) are defined, (2) are boolean-not-string variables, and (3) contain plausible values
- name: Pre-check that IIAB's "XYZ_install" + "XYZ_enabled" vars (1) are defined, (2) are boolean-not-string variables, and (3) contain plausible values. Also checks that "XYZ_install" is True when "XYZ_installed" is defined.
include_tasks: validate_vars.yml
# SEE: https://github.com/iiab/iiab/blob/master/roles/nginx/README.md
- name: "apache_install is currently '{{ apache_install }}' and apache_enabled is currently '{{ apache_enabled }}'. Now let's set 'apache_install: True' and 'apache_enabled: True' if NGINX is set not to be enabled OR if any of {DokuWiki, Elgg, Lokole, Moodle, Nextcloud, Node-RED} are set to install."
set_fact:
apache_install: True
apache_enabled: True
when: not nginx_enabled or dokuwiki_install or elgg_install or lokole_install or moodle_install or nextcloud_install or nodered_install
#
#- name: "Verify 'apache_install: True' and 'apache_enabled: True' if any of {DokuWiki, Elgg, Lokole, Moodle, Nextcloud, Node-RED} are set to install"
# assert:
# that: apache_install and apache_enabled or not (dokuwiki_install or elgg_install or lokole_install or moodle_install or nextcloud_install or nodered_install)
# fail_msg: "PLEASE CONFIRM 'apache_install: True' AND 'apache_enable: True' IF YOU'RE TRYING TO INSTALL ANY OF {dokuwiki, elgg, lokole, moodle, nextcloud, nodered} e.g. IN: /etc/iiab/local_vars.yml"
# quiet: yes
#
#- name: "Verify 'apache_install: True' and 'apache_enabled: True' if 'nginx_enabled: False' -- e.g. for Apache testing of older playbooks lacking full NGINX support"
# assert:
# that: apache_install and apache_enabled or nginx_enabled
# fail_msg: "PLEASE CONFIRM 'apache_install: True' AND 'apache_enable: True' IF 'nginx_enabled: False' e.g. IN: /etc/iiab/local_vars.yml"
# quiet: yes
- name: Set top-level variables from local_facts for convenience
set_fact:
xo_model: "{{ ansible_local.local_facts.xo_model }}"
@ -47,8 +65,8 @@
set_fact:
rpi_model: "rpi"
is_rpi: True
# no_net_restart: True
# nobridge: True
#no_net_restart: True
#nobridge: True
when: ansible_local.local_facts.os == "raspbian"
- name: Set exFAT_enabled if xo_model != "none"
@ -78,11 +96,11 @@
get_url:
url: "{{ iiab_download_url }}/heart-beat.txt"
dest: /tmp/heart-beat.txt
# timeout: "{{ download_timeout }}"
#timeout: "{{ download_timeout }}"
# @jvonau recommends: 100sec is too much (keep 10sec default)
ignore_errors: True
# async: 10
# poll: 2
#async: 10
#poll: 2
register: internet_access_test
- name: Set internet_available if download succeeded and not disregard_network
@ -109,12 +127,6 @@
gui_port: 443
when: adm_cons_force_ssl | bool
# SEE: https://github.com/iiab/iiab/blob/master/roles/nginx/README.md
- name: "Set 'apache_enabled: True' if any of {DokuWiki, Elgg, Lokole, Moodle, Nextcloud, Node-RED} are set to install"
set_fact:
apache_enabled: True
when: dokuwiki_install or elgg_install or lokole_install or moodle_install or nextcloud_install or nodered_install
- name: Turn on both vars for MySQL (mandatory in Stage 3!)
set_fact:
mysql_install: True