1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-14 20:22:08 +00:00

Interim solution to iiab_home_url not being softcoded

This commit is contained in:
root 2020-02-12 05:23:57 -05:00
parent 7b067ca2ab
commit ac8e160e52
9 changed files with 74 additions and 34 deletions

View file

@ -0,0 +1,21 @@
- name: Create dir {{ doc_root }}/home
file:
state: directory
path: "{{ doc_root }}/home" # /library/www/html
owner: "{{ apache_user }}"
group: "{{ apache_user }}"
mode: '0755'
- name: Install /etc/{{ apache_conf_dir }}/iiab-homepage.conf from template, for http://box redirect to http://box/home/
template:
src: iiab-homepage.conf
dest: "/etc/{{ apache_conf_dir }}/iiab-homepage.conf"
#- name: Symlink /etc/apache2/sites-enabled/iiab-homepage.conf to /etc/{{ apache_conf_dir }}/iiab-homepage.conf (debuntu)
- name: Enable iiab-homepage.conf via Apache
command: a2ensite: iiab-homepage.conf
# file:
# src: "/etc/{{ apache_conf_dir }}/iiab-homepage.conf"
# path: /etc/apache2/sites-enabled/iiab-homepage.conf
# state: link
# when: is_debuntu | bool

View file

@ -11,7 +11,6 @@
- name: WEB_SUPPORT
include_role:
name: web_support
#when: web_support_install | bool
when: apache_install or nginx_install
- name: HTTPD (Apache)

View file

@ -27,12 +27,10 @@
name: usb_lib
when: usb_lib_install | bool
# This is in Stage 4-SERVER-OPTIONS (rather than 3-BASE-SERVER) because var
# iiab_home_url changes, and may need to be re-run in the field/offline/etc.
- name: HOMEPAGE under Apache
include_role:
name: homepage
when: not nginx_enabled
# 2020-02-12: what was roles/homepage lives in roles/web_support & roles/httpd
# for now. Eventually softcoding of iiab_home_url should happen everywhere
# (incl Admin Console) to allow more field options, e.g. changing
# /library/www/html/home even when offline...
- name: CUPS
include_role:

View file

@ -1,19 +0,0 @@
- name: Create dir {{ doc_root }}/home
file:
path: "{{ doc_root }}/home"
owner: "{{ apache_user }}"
group: "{{ apache_user }}"
mode: 0755
state: directory
- name: Install /etc/{{ apache_conf_dir }}/iiab-homepage.conf from template, for http://box redirect to http://box/home/
template:
src: iiab-homepage.conf
dest: "/etc/{{ apache_conf_dir }}/iiab-homepage.conf"
- name: Symlink /etc/apache2/sites-enabled/iiab-homepage.conf to /etc/{{ apache_conf_dir }}/iiab-homepage.conf (debuntu)
file:
src: "/etc/{{ apache_conf_dir }}/iiab-homepage.conf"
path: /etc/apache2/sites-enabled/iiab-homepage.conf
state: link
when: is_debuntu | bool

View file

@ -147,6 +147,35 @@
- { src: 'roles/httpd/templates/010-iiab.conf.j2', dest: '/etc/{{ apache_conf_dir }}/010-iiab.conf' }
- { src: 'roles/httpd/templates/proxy_ajp.conf.j2', dest: '/etc/{{ apache_conf_dir }}/proxy_ajp.conf' }
- name: Install /etc/{{ apache_conf_dir }}/iiab-homepage.conf from template, for http://box redirect to http://box/home/
template:
src: iiab-homepage.conf
dest: "/etc/{{ apache_conf_dir }}/iiab-homepage.conf"
- name: "IN CASE NGINX IS DISABLED: Enable IIAB pages via Apache (e.g. on port 80) by running 'a2ensite 010-iiab.conf'"
command: a2ensite 010-iiab.conf
#when: apache_enabled | bool
# - name: Disable IIAB pages via Apache (e.g. on port 80) by running 'a2dissite 010-iiab.conf', if not apache_enabled"
# command: a2dissite 010-iiab.conf
# when: not apache_enabled
# MOVED FROM roles/homepage/tasks/main.yml (as NGINX-only IIAB's won't need it)
# and 'mkdir /library/www/html/home' is now done by roles/web_support for Admin
# Console which hard-codes that as a requirement as of 2020-02-12.
#
# './runrole --reinstall apache' is a decent solution today, for folks needing
# changes, but to make sure such things work in the field/offline/etc: soft-
# coding of iiab_home_url should probably be taken more seriously thruout IIAB!
#
- name: "IN CASE NGINX IS DISABLED: Enable iiab-homepage.conf via Apache (e.g. on port 80) by running 'a2ensite iiab-homepage.conf'"
command: a2ensite: iiab-homepage.conf
#when: apache_enabled | bool
# - name: Disable IIAB pages via Apache (e.g. on port 80) by running 'a2dissite iiab-homepage.conf', if not apache_enabled"
# command: a2dissite iiab-homepage.conf
# when: not apache_enabled
# - name: Enable & Stop '{{ apache_service }}' systemd service
# systemd:
# name: "{{ apache_service }}"

View file

@ -42,14 +42,6 @@
when: apache_installed is undefined
- name: "IN CASE NGINX IS DISABLED: Enable IIAB pages via Apache (e.g. on port 80) by running 'a2ensite 010-iiab.conf', if apache_enabled"
command: a2ensite 010-iiab.conf
when: apache_enabled | bool
- name: Disable IIAB pages via Apache (e.g. on port 80) by running 'a2dissite 010-iiab.conf', if not apache_enabled"
command: a2dissite 010-iiab.conf
when: not apache_enabled
- name: Enable & (Re)Start {{ apache_service }} systemd service, if apache_enabled
systemd:
name: "{{ apache_service }}"

View file

@ -0,0 +1,9 @@
# IIAB Home Page
# Redirect to home page on School Server
# Default [was] xs-portal [and is now generally] home
# RedirectMatch of root to homepage
# See the note in default_vars.yml
RedirectMatch ^/$ {{ iiab_home_url }}

View file

@ -21,6 +21,17 @@
- { regexp: '^max_input_time', line: 'max_input_time = 300 ; default is 60' }
# 2020-02-12: *REQUIRED* by iiab-admin-console/roles/js-menu/tasks/main.yml,
# which should probably instead softcode iiab_home_url as set in local_vars.yml
- name: Create dir {{ doc_root }}/home
file:
state: directory
path: "{{ doc_root }}/home" # /library/www/html
owner: "{{ apache_user }}"
group: "{{ apache_user }}"
mode: '0755'
- name: Create dir {{ doc_root }}/info for http://box/info offline docs
file:
state: directory