mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
commit
e6711d26a6
9 changed files with 28 additions and 32 deletions
|
@ -41,6 +41,7 @@
|
|||
# Should we remove {xo_services, activity_server, ejabberd_xs, idmgr} as these
|
||||
# are officially now UNMAINTAINED in default_vars.yml and
|
||||
# https://github.com/iiab/iiab/blob/master/unmaintained-roles.txt etc?
|
||||
|
||||
- name: Set vars_checklist for 53 + 53 + up-to-53 vars ("XYZ_install" + "XYZ_enabled" + "XYZ_installed") to be checked
|
||||
set_fact:
|
||||
vars_checklist:
|
||||
|
@ -101,47 +102,41 @@
|
|||
- name: Assert that {{ vars_checklist | length }} "XYZ_install" vars are all... defined
|
||||
assert:
|
||||
that: "{{ item }}_install is defined"
|
||||
fail_msg: "PLEASE GIVE THIS VARIABLE A PROPER (UNQUOTED) BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
fail_msg: "VARIABLE MUST BE DEFINED: '{{ item }}_install' NEEDS A PROPER (UNQUOTED) ANSIBLE BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
quiet: yes
|
||||
loop: "{{ vars_checklist }}"
|
||||
#register: install_vars_defined
|
||||
|
||||
- name: Assert that {{ vars_checklist | length }} "XYZ_enabled" vars are all... defined
|
||||
assert:
|
||||
that: "{{ item }}_enabled is defined"
|
||||
fail_msg: "PLEASE GIVE THIS VARIABLE A PROPER (UNQUOTED) BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
fail_msg: "VARIABLE MUST BE DEFINED: '{{ item }}_enabled' NEEDS A PROPER (UNQUOTED) ANSIBLE BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
quiet: yes
|
||||
loop: "{{ vars_checklist }}"
|
||||
#register: enabled_vars_defined
|
||||
|
||||
- name: Assert that {{ vars_checklist | length }} "XYZ_install" vars are all... type boolean (NOT type string, which can invert logic!)
|
||||
assert:
|
||||
that: "{{ item }}_install | type_debug == 'bool'"
|
||||
fail_msg: "PLEASE GIVE THIS VARIABLE A PROPER (UNQUOTED) BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
fail_msg: "VARIABLE MUST BE BOOLEAN: '{{ item }}_install' now has type '{{ lookup('vars', item + '_install') | type_debug }}' and value '{{ lookup('vars', item + '_install') }}' -- PLEASE SET A PROPER (UNQUOTED) ANSIBLE BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
quiet: yes
|
||||
loop: "{{ vars_checklist }}"
|
||||
#register: install_vars_boolean
|
||||
|
||||
- name: Assert that {{ vars_checklist | length }} "XYZ_enabled" vars are all... type boolean (NOT type string, which can invert logic!)
|
||||
assert:
|
||||
that: "{{ item }}_enabled | type_debug == 'bool'"
|
||||
fail_msg: "PLEASE GIVE THIS VARIABLE A PROPER (UNQUOTED) BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
fail_msg: "VARIABLE MUST BE BOOLEAN: '{{ item }}_enabled' now has type '{{ lookup('vars', item + '_enabled') | type_debug }}' and value '{{ lookup('vars', item + '_enabled') }}' -- PLEASE SET A PROPER (UNQUOTED) ANSIBLE BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
quiet: yes
|
||||
loop: "{{ vars_checklist }}"
|
||||
#register: enabled_vars_boolean
|
||||
|
||||
- name: 'DISALLOW "XYZ_install: False" WITH "XYZ_enabled: True" ...for all {{ vars_checklist | length }} var pairs'
|
||||
assert:
|
||||
that: "{{ item }}_install or not {{ item }}_enabled"
|
||||
fail_msg: "IIAB DOES NOT SUPPORT UNINSTALLS. PLEASE VERIFY {{ item }}_install AND {{ item }}_enabled e.g. IN: /etc/iiab/local_vars.yml"
|
||||
#fail_msg: '{{ item }}_install or not {{ item }}_enabled {{ item }}_install is {{ {{ item }}_install }} {{ item }}_enabled is {{ {{ item }}_enabled }}' # Is there a way to output var values ?
|
||||
fail_msg: "DISALLOWED: '{{ item }}_install: False' WITH '{{ item }}_enabled: True' -- IIAB DOES NOT SUPPORT UNINSTALLS -- please verify those 2 variable values e.g. in /etc/iiab/local_vars.yml, and other places variables are defined?"
|
||||
quiet: yes
|
||||
loop: "{{ vars_checklist }}"
|
||||
#register: var_pairs_validation
|
||||
|
||||
- name: 'DISALLOW "XYZ_install: False" WHEN "XYZ_installed is defined" IN /etc/iiab/iiab_state.yml ...for up-to-{{ vars_checklist | length }} var pairs'
|
||||
assert:
|
||||
that: "{{ item }}_install or {{ item }}_installed is undefined"
|
||||
fail_msg: "{{ item }} ALREADY INSTALLED. IIAB DOES NOT SUPPORT UNINSTALLS. PLEASE SET '{{ item }}_install: True' e.g. IN: /etc/iiab/local_vars.yml"
|
||||
fail_msg: "DISALLOWED: '{{ item }}_install: False' (e.g. in /etc/iiab/local_vars.yml) WHEN '{{ item }}_installed' is defined (e.g. in /etc/iiab/iiab_state.yml) -- IIAB DOES NOT SUPPORT UNINSTALLS -- please verify those 2 files especially, and other places variables are defined?"
|
||||
quiet: yes
|
||||
loop: "{{ vars_checklist }}"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
- name: Assert that "captiveportal_enabled | type_debug == 'bool'" (boolean not string etc)
|
||||
assert:
|
||||
that: captiveportal_enabled | type_debug == 'bool'
|
||||
fail_msg: "PLEASE GIVE VARIABLE 'captiveportal_enabled' A PROPER (UNQUOTED) BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
fail_msg: "PLEASE GIVE VARIABLE 'captiveportal_enabled' A PROPER (UNQUOTED) ANSIBLE BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
quiet: yes
|
||||
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!
|
||||
|
||||
# Info needed to install Lokole
|
||||
lokole_version: 0.5.7
|
||||
lokole_version: 0.5.9
|
||||
lokole_admin_user: admin # lowercase seems nec here (even though uppercase Admin/changeme is IIAB's OOB recommendation!)
|
||||
lokole_admin_password: changeme
|
||||
lokole_install_path: "{{ content_base }}/lokole" # /library/lokole
|
||||
|
|
|
@ -29,3 +29,4 @@ mediawiki_abs_path: "{{ mediawiki_install_path }}/mediawiki-{{ mediawiki_version
|
|||
mediawiki_url: /wiki
|
||||
mediawiki_url2: /mediawiki
|
||||
mediawiki_full_url: "http://{{ iiab_hostname }}.{{ iiab_domain }}{{ mediawiki_url }}" # http://box.lan/wiki
|
||||
mediawiki_symlink: w # can also be mwlink. NO slashes as they are suppplied as needed in the code
|
||||
|
|
|
@ -18,15 +18,15 @@
|
|||
unarchive:
|
||||
src: "{{ downloads_dir }}/{{ mediawiki_src }}"
|
||||
dest: "{{ mediawiki_install_path }}"
|
||||
owner: root
|
||||
owner: "{{ apache_user }}"
|
||||
group: "{{ apache_user }}"
|
||||
mode: u+rw,g+r,o+r # '0755' forced executable bits on files
|
||||
keep_newer: yes
|
||||
|
||||
- name: Create symlink {{ doc_root }}/mwlink -> {{ mediawiki_abs_path }}
|
||||
- name: Create symlink {{ doc_root }}/{{ mediawiki_symlink }} -> {{ mediawiki_abs_path }}
|
||||
file:
|
||||
src: "{{ mediawiki_abs_path }}"
|
||||
path: "{{ doc_root }}/mwlink"
|
||||
path: "{{ doc_root }}/{{ mediawiki_symlink }}"
|
||||
state: link
|
||||
|
||||
- name: Start MySQL systemd service ({{ mysql_service }}) so we can create db
|
||||
|
@ -55,7 +55,7 @@
|
|||
--installdbpass={{ mediawiki_db_user_password }}
|
||||
--dbuser={{ mediawiki_db_user }}
|
||||
--dbpass={{ mediawiki_db_user_password }}
|
||||
--scriptpath=/mwlink
|
||||
--scriptpath=/{{ mediawiki_symlink }}
|
||||
--lang=en
|
||||
--pass={{ mediawiki_admin_user_password }}
|
||||
"{{ mediawiki_site_name }}"
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
# this works if (docroot)/mwlink links to install
|
||||
# this works if (docroot)/{{ mediawiki_symlink }} links to install
|
||||
# and LocalSettings.php has
|
||||
# $wgScriptPath = "/mwlink";
|
||||
# $wgScriptPath = "/{{ mediawiki_symlink }}";
|
||||
# $wgArticlePath = "/wiki/$1";
|
||||
# $wgUsePathInfo = true;
|
||||
|
||||
location ~ ^/mwlink/(index|load|api|thumb|opensearch_desc)\.php$ {
|
||||
location ~ ^/{{ mediawiki_symlink }}/(index|load|api|thumb|opensearch_desc)\.php$ {
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_pass php; # or whatever port your PHP-FPM listens on
|
||||
}
|
||||
|
||||
# Images
|
||||
location /mwlink/images {
|
||||
location /{{ mediawiki_symlink }}/images {
|
||||
# Separate location for images/ so .php execution won't apply
|
||||
}
|
||||
location /mwlink/images/deleted {
|
||||
location /{{ mediawiki_symlink }}/images/deleted {
|
||||
# Deny access to deleted images folder
|
||||
deny all;
|
||||
}
|
||||
# MediaWiki assets (usually images)
|
||||
location ~ ^/mwlink/resources/(assets|lib|src) {
|
||||
location ~ ^/{{ mediawiki_symlink }}/resources/(assets|lib|src) {
|
||||
try_files $uri 404;
|
||||
add_header Cache-Control "public";
|
||||
expires 7d;
|
||||
}
|
||||
# Assets, scripts and styles from skins and extensions
|
||||
location ~ ^/mwlink/(skins|extensions)/.+\.(css|js|gif|jpg|jpeg|png|svg)$ {
|
||||
location ~ ^/{{ mediawiki_symlink }}/(skins|extensions)/.+\.(css|js|gif|jpg|jpeg|png|svg|ttf|woff|woff2)$ {
|
||||
try_files $uri 404;
|
||||
add_header Cache-Control "public";
|
||||
expires 7d;
|
||||
|
@ -34,18 +34,18 @@ location ~ ^/mwlink/(skins|extensions)/.+\.(css|js|gif|jpg|jpeg|png|svg)$ {
|
|||
|
||||
## Uncomment the following code if you wish to use the installer/updater
|
||||
## installer/updater
|
||||
#location /mwlink/mw-config/ {
|
||||
#location /{{ mediawiki_symlink }}/mw-config/ {
|
||||
# # Do this inside of a location so it can be negated
|
||||
# location ~ \.php$ {
|
||||
# include /etc/nginx/fastcgi_params;
|
||||
# fastcgi_param SCRIPT_FILENAME $document_root/mwlink/mw-config/$fastcgi_script_name;
|
||||
# fastcgi_param SCRIPT_FILENAME $document_root/{{ mediawiki_symlink }}/mw-config/$fastcgi_script_name;
|
||||
# fastcgi_pass 127.0.0.1:9000; # or whatever port your PHP-FPM listens on
|
||||
# }
|
||||
#}
|
||||
|
||||
# Handling for the article path (pretty URLs)
|
||||
location {{ mediawiki_url }}/ {
|
||||
rewrite ^{{ mediawiki_url }}/(?<pagename>.*)$ /mwlink/index.php;
|
||||
rewrite ^{{ mediawiki_url }}/(?<pagename>.*)$ /{{ mediawiki_symlink }}/index.php;
|
||||
}
|
||||
|
||||
# Explicit access to the root website, redirect to main page (adapt as needed)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
- name: Assert that "munin_enabled | type_debug == 'bool'" (boolean not string etc)
|
||||
assert:
|
||||
that: munin_enabled | type_debug == 'bool'
|
||||
fail_msg: "PLEASE GIVE VARIABLE 'munin_enabled' A PROPER (UNQUOTED) BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
fail_msg: "PLEASE GIVE VARIABLE 'munin_enabled' A PROPER (UNQUOTED) ANSIBLE BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
quiet: yes
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
- name: Assert that "osm_vector_maps_enabled | type_debug == 'bool'" (boolean not string etc)
|
||||
assert:
|
||||
that: osm_vector_maps_enabled | type_debug == 'bool'
|
||||
fail_msg: "PLEASE GIVE VARIABLE 'osm_vector_maps_enabled' A PROPER (UNQUOTED) BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
fail_msg: "PLEASE GIVE VARIABLE 'osm_vector_maps_enabled' A PROPER (UNQUOTED) ANSIBLE BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
quiet: yes
|
||||
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
- name: Assert that "wordpress_enabled | type_debug == 'bool'" (boolean not string etc)
|
||||
assert:
|
||||
that: wordpress_enabled | type_debug == 'bool'
|
||||
fail_msg: "PLEASE GIVE VARIABLE 'wordpress_enabled' A PROPER (UNQUOTED) BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
fail_msg: "PLEASE GIVE VARIABLE 'wordpress_enabled' A PROPER (UNQUOTED) ANSIBLE BOOLEAN VALUE e.g. IN: /etc/iiab/local_vars.yml"
|
||||
quiet: yes
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue