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

Merge pull request #2576 from holta/conditional_bare_variables

Remove "| bool" 1.5yrs later, as Ansible 2.10 changed conditional_bare_variables default
This commit is contained in:
A Holt 2020-10-16 17:54:53 -07:00 committed by GitHub
commit 6f5156f7ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
157 changed files with 2076 additions and 2072 deletions

View file

@ -80,7 +80,7 @@
# SEE ALSO THE apache2_module SECTION IN roles/httpd/tasks/main.yml
- name: enable mod_expires for debian
command: a2enmod expires
when: is_debuntu | bool
when: is_debuntu
- name: create the link which enables the site
file: src=/etc/apache2/sites-available/xs-activity-server.conf

View file

@ -1,3 +1,3 @@
- name: Install wondershaper ajenti plugin
pip: name="{{ iiab_download_url }}"/ajenti-plugin-wondershaper-0.3.tar.gz
when: internet_available | bool
when: internet_available

View file

@ -45,7 +45,7 @@
service: name=ajenti
enabled=yes
state=restarted
when: ajenti_enabled | bool
when: ajenti_enabled
- name: Add 'ajenti' variable values to {{ iiab_ini_file }}
ini_file:

View file

@ -4,7 +4,7 @@
- name: Install xs-authserver from pypi
pip: name=xs-authserver
when: internet_available | bool
when: internet_available
- name: install gunicorn
package: name=python-gunicorn
@ -48,7 +48,7 @@
service: name=xs-authserver
state=restarted
enabled=yes
when: authserver_enabled | bool
when: authserver_enabled
- name: Add 'authserver' variable values to {{ iiab_ini_file }}
ini_file:

View file

@ -4,7 +4,7 @@
with_items:
- docker
- python-docker-py
when: docker_install | bool
when: docker_install
- name: put the systemd startup file in place
template: src=docker.service
@ -31,7 +31,7 @@
service: name=docker
state=started
enabled=true
when: docker_enabled | bool
when: docker_enabled
- name: Disable docker
service: name=docker

View file

@ -12,7 +12,7 @@
systemd:
name: "{{ apache_service }}"
state: restarted
when: apache_enabled | bool
when: apache_enabled
# NGINX
@ -32,7 +32,7 @@
systemd:
name: nginx
state: restarted
when: nginx_enabled | bool
when: nginx_enabled
- name: Add 'dokuwiki' variable values to {{ iiab_ini_file }}

View file

@ -3,7 +3,7 @@
url: "{{ iiab_download_url }}/{{ dokuwiki_version }}.tgz"
dest: "{{ downloads_dir }}/"
timeout: "{{ download_timeout }}"
when: internet_available | bool
when: internet_available
- name: Unarchive (unpack) it to /library/{{ dokuwiki_version }}
unarchive:

View file

@ -34,7 +34,7 @@
# src: ejabberd-iiab.init
# dest: /etc/init.d/ejabberd-iiab
# mode: 0755
# when: is_debuntu | bool
# when: is_debuntu
#- name: Put the startup script in place - non debian
# template:
@ -71,7 +71,7 @@
#name: ejabberd-iiab
state: restarted
enabled: yes
when: ejabberd_enabled | bool
when: ejabberd_enabled
#when: ejabberd_config.changed and ejabberd_enabled
#- name: Wait for ejabberd service start

View file

@ -18,4 +18,4 @@
# src: "/etc/{{ apache_conf_dir }}/iiab-homepage.conf"
# path: /etc/apache2/sites-enabled/iiab-homepage.conf
# state: link
# when: is_debuntu | bool
# when: is_debuntu

View file

@ -42,7 +42,7 @@
with_items:
- idmgr
- xinetd
when: xo_services_enabled | bool
when: xo_services_enabled
- name: Disable idmgr service
service: name={{ item }}

View file

@ -1,3 +1,3 @@
- name: Install nodogsplash (Raspbian only)
include_tasks: rpi.yml
when: is_raspbian | bool
when: is_raspbian

View file

@ -8,7 +8,7 @@
url: "{{ iiab_download_url }}/{{ nodogsplash_arm_deb }}"
dest: "{{ downloads_dir }}/{{ nodogsplash_arm_deb }}"
timeout: "{{ download_timeout }}"
when: internet_available | bool
when: internet_available
#async: 300
#poll: 5
@ -43,7 +43,7 @@
name: nodogsplash
enabled: yes
state: started
when: nodogsplash_enabled | bool
when: nodogsplash_enabled
- name: Disable 'nodogsplash' systemd service, if not nodogsplash_enabled
systemd:

View file

@ -7,7 +7,7 @@
- libapache2-mod-wsgi
- libapache2-mod-xsendfile
state: present
when: is_debuntu | bool
when: is_debuntu
- name: Install 6 OSM required packages (not debuntu)
package:
@ -110,7 +110,7 @@
group: root
mode: 0644
backup: no
when: osm_enabled | bool
when: osm_enabled
- name: Create softlink osm.conf from sites-enabled to sites-available (debuntu)
file:
@ -144,7 +144,7 @@
owner: root
group: root
state: link
when: osm_enabled | bool
when: osm_enabled
- name: Create dir /library/knowledge/modules
file:
@ -165,7 +165,7 @@
- { src: 'map.html', dest: "{{ osm_path }}/static/map.html" }
- { src: 'l.control.geosearch.js', dest: "{{ osm_path }}/static/lib/leaflet/geosearch/l.control.geosearch.js" }
- { src: "{{ osm_path }}/static/map.html", dest: "{{ osm_path }}/static/index.html" }
when: osm_enabled | bool
when: osm_enabled
- name: Restart httpd service
service:

View file

@ -4,7 +4,7 @@
- name: add a repo def for ubuntu
template: dest=/etc/apt/sources.list.d/
src=owncloud.list
when: is_ubuntu | bool
when: is_ubuntu
- name: See if the owncloud startup page exists
stat: path={{ owncloud_prefix }}/owncloud/index.php
@ -40,7 +40,7 @@
- name: Get the owncloud software
get_url: url={{ iiab_download_url }}/{{ owncloud_src_file }} dest={{ downloads_dir }}/{{ owncloud_src_file }}
when: internet_available | bool
when: internet_available
async: 300
poll: 5
@ -54,7 +54,7 @@
- name: Copy it to permanent location /opt
unarchive: src={{ downloads_dir }}/{{ owncloud_src_file }}
dest={{ owncloud_prefix }}
when: is_F18 | bool
when: is_F18
- name: in Centos, the following config dir is symlink to /etc/owncloud
file: path=/etc/owncloud
@ -103,7 +103,7 @@
# Enable owncloud by copying template to httpd config
- include_tasks: owncloud_enabled.yml
when: owncloud_enabled | bool
when: owncloud_enabled
- name: Add 'owncloud' variable values to {{ iiab_ini_file }}
ini_file:

View file

@ -29,7 +29,7 @@
- libapache2-mod-wsgi
- libxml2-dev
- libxslt-dev
when: is_debuntu | bool
when: is_debuntu
- name: "Install Pathagar prerequisites: mod_wsgi, libxml2-devel, libxslt-devel (not debuntu)"
package:
@ -78,7 +78,7 @@
- django-tagging==0.3.1
- django-sendfile==0.3.6
- lxml==3.4.4
when: internet_available | bool
when: internet_available
- name: Install Pathagar requirements in a virtualenv
pip:

View file

@ -41,13 +41,13 @@
service: name=docker
state=restarted
enabled=yes
when: schooltool_enabled | bool
when: schooltool_enabled
- name: Enable schooltool
service: name=schooltool
state=started
enabled=yes
when: schooltool_enabled | bool
when: schooltool_enabled
- name: Disable schooltool
service: name=schooltool

View file

@ -29,7 +29,7 @@
- name: Enable sugar-stats service
service: name=sugar-stats-server
enabled=yes
when: sugar_stats_enabled | bool
when: sugar_stats_enabled
- name: Disable sugar-stats service
service: name=sugar-stats-server

View file

@ -4,7 +4,7 @@
- name: Install statistics-consolidation with pip
pip: name=stats-consolidation version=2.1.2
when: internet_available | bool
when: internet_available
- name: Install required libraries
package: name={{ item }}

View file

@ -20,7 +20,7 @@
url: "{{ teamviewer_url }}/{{ teamviewer_rpm_file }}"
dest: "{{ yum_packages_dir }}/{{ teamviewer_rpm_file }}"
timeout: "{{ download_timeout }}"
when: internet_available | bool
when: internet_available
# F22 has issues with yum localinstall exclude for now
- name: Do the install of TeamViewer, pulling in any required dependencies

View file

@ -6,7 +6,7 @@
- name: Install Teamviewer if intel
include_tasks: install.yml
when: teamviewer_install | bool
when: teamviewer_install
- name: Add 'teamviewer' variable values to {{ iiab_ini_file }}
ini_file:

View file

@ -7,7 +7,7 @@
- python-pip
- nodejs
- npm
when: internet_available | bool
when: internet_available
- name: Determine if xovis is already downloaded
stat: path={{ downloadds_dir }}/xovis/xxx
@ -23,7 +23,7 @@
npm: name=kanso
global=yes
path={{ downloads_dir }}
when: internet_available | bool
when: internet_available
- name: move the xovis repo into place
shell: "cp -rp {{ downloads_dir }}/xovis {{ xovis_root }}"
@ -37,7 +37,7 @@
- name: Install the xovis python dependencies
pip: requirements={{ xovis_root }}/process_stats/requirements.txt
when: internet_available | bool
when: internet_available
- name: Update xovis repo with Chart Heading
lineinfile: dest="{{ xovis_root }}/index.html" regexp='(.+)<h1>(.*)</h1>' line='\1<h1>{{ xovis_chart_heading }}</h1>' backrefs=yes
@ -49,17 +49,17 @@
service: name=couchdb
enabled=yes
state=started
when: xovis_enabled | bool
when: xovis_enabled
- name: Wait for CouchDB to become ready
wait_for: port=5984
delay=1
timeout=5
when: xovis_enabled | bool
when: xovis_enabled
- name: Add admin user
command: curl -X PUT {{ xovis_target_host }}/_config/admins/{{ xovis_db_user }} -d "\"{{ xovis_db_password }}\""
when: xovis_enabled | bool
when: xovis_enabled
- name: Check if db exists
shell: "kanso listdb | grep {{ xovis_db_name }}"
@ -79,7 +79,7 @@
-d {{ xovis_backup_dir }}
--deployment {{ xovis_deployment_name }}
--server http://{{ xovis_db_login }}@{{ xovis_target_host }}"
when: xovis_enabled | bool
when: xovis_enabled
- name: Add 'xovis' variable values to {{ iiab_ini_file }}
ini_file:

View file

@ -13,7 +13,7 @@
- name: 'Turn the crank for systemd: hostnamectl set-hostname "{{ iiab_hostname }}.{{ iiab_domain }}" (debuntu)'
shell: hostnamectl set-hostname "{{ iiab_hostname }}.{{ iiab_domain }}"
when: is_debuntu | bool
when: is_debuntu
- name: Install /etc/sysconfig/network from template (redhat)
template:
@ -22,7 +22,7 @@
owner: root
group: root
mode: 0644
when: is_redhat | bool
when: is_redhat
# roles/network/tasks/hosts.yml [no longer in use] ALSO did this:
- name: 'Put FQDN & hostnames in /etc/hosts: "127.0.0.1 {{ iiab_hostname }}.{{ iiab_domain }} localhost.localdomain localhost {{ iiab_hostname }} box box.lan"'

View file

@ -20,7 +20,7 @@
# sections once and only once to preserve the install date and git hash.
- name: Create IIAB tools and {{ iiab_ini_file }}, if first_run
include_tasks: first_run.yml
when: first_run | bool
when: first_run
# Copies the latest/known version of iiab-diagnostics into /usr/bin (so it can
# be run even if local source tree /opt/iiab/iiab is deleted to conserve disk).
@ -94,7 +94,7 @@
- name: Set port 443 for Admin Console if adm_cons_force_ssl
set_fact:
gui_port: 443
when: adm_cons_force_ssl | bool
when: adm_cons_force_ssl
- name: "Set iiab_fqdn: {{ iiab_hostname }}.{{ iiab_domain }}"
set_fact:
@ -108,7 +108,7 @@
- name: Set hostname if FQDN_changed
include_tasks: hostname.yml
when: FQDN_changed | bool
when: FQDN_changed
- name: Add 'runtime' variable values to {{ iiab_ini_file }}
ini_file:

View file

@ -13,8 +13,8 @@
# by various scripts, possibly bypassing 0-init? Either way, risks abound :/
# 1. "Ansible 2.8+ ADVISORY: avoid warnings by using 'when: var | bool' for
# top-level BARE vars (in case they're strings, instead of boolean)"
# https://github.com/iiab/iiab/issues/1632
# top-level BARE vars (in case they're strings, instead of boolean)" per #1632.
# 2020-10-16: NO LONGER NEC, SEE: https://github.com/iiab/iiab/pull/2576
# 2. "How Exactly Does Ansible Parse Boolean Variables?"
# https://stackoverflow.com/questions/47877464/how-exactly-does-ansible-parse-boolean-variables/47877502#47877502
@ -32,6 +32,10 @@
# ~18 words too WILL FAIL as strings (as will any non-empty string...so beware
# casting strings to boolean later on...can make the situation worse!)
# https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.8.html#bare-variables-in-conditionals
#
# 2020-07-08 - Excellent analysis & summary by Jon Spriggs: "In Ansible,
# determine the type of a value, and casting those values to other types"
# https://jon.sprig.gs/blog/post/1801
# 3. "How do i fail a task in Ansible if the variable contains a boolean value?
# I want to perform input validation for Ansible playbooks"

View file

@ -5,7 +5,7 @@
- name: dnsmasq (install now, configure LATER in 'network', after Stage 9)
include_tasks: roles/network/tasks/dnsmasq.yml
#when: dnsmasq_install | bool # Flag might be used in future?
#when: dnsmasq_install # Flag might be used in future?
- name: Install uuid-runtime package (debuntu)
package:
@ -13,7 +13,7 @@
- uuid-runtime
- sudo
state: present
when: is_debuntu | bool
when: is_debuntu
- name: Does /etc/iiab/uuid file exist?
stat:
@ -79,17 +79,17 @@
- name: SSHD
include_role:
name: sshd
when: sshd_install | bool
when: sshd_install
- name: IIAB-ADMIN
include_role:
name: iiab-admin
#when: iiab_admin_install | bool # Flag might be created in future?
#when: iiab_admin_install # Flag might be created in future?
- name: OPENVPN
include_role:
name: openvpn
when: openvpn_install | bool
when: openvpn_install
# Debian 10 "Buster" is apparently enabling AppArmor in 2019:
# https://wiki.debian.org/AppArmor/Progress
@ -102,7 +102,7 @@
name: apparmor
enabled: False
state: stopped
when: is_ubuntu | bool
when: is_ubuntu
ignore_errors: True
- name: Disable SELinux on next boot (OS's other than debuntu)

View file

@ -30,7 +30,7 @@
package:
name: iptables-persistent
state: present
when: is_debuntu | bool
when: is_debuntu
- name: Install package iptables-services (OS's other than debuntu)
package:
@ -51,4 +51,4 @@
src: iptables
dest: /etc/network/if-pre-up.d/iptables
mode: '0755'
when: is_debuntu | bool
when: is_debuntu

View file

@ -12,7 +12,7 @@
- xml-common
- yum-utils
state: present
when: is_redhat | bool
when: is_redhat
- name: "Install 6 deb/apt packages: avahi-daemon, exfat-fuse, exfat-utils, inetutils-syslogd, libnss-mdns, wpasupplicant (debuntu)"
package:
@ -25,7 +25,7 @@
- libnss-mdns
- wpasupplicant
state: present
when: is_debuntu | bool
when: is_debuntu
- name: "Install 22 common packages: acpid, bridge-utils, bzip2, curl, gawk, hostapd, htop, i2c-tools, logrotate, make, mlocate, netmask, net-tools, ntfs-3g, pandoc, pastebinit, rsync, sqlite3, sudo, tar, unzip, usbutils, wget"
package:

View file

@ -13,18 +13,18 @@
- name: get the createrepo program
package: name=createrepo
state=present
when: is_redhat | bool
when: is_redhat
- name: Create local repo
shell: createrepo {{ yum_packages_dir }}
when: is_redhat | bool
when: is_redhat
- name: Install local repo file.
template: dest=/etc/yum.repos.d/iiab-local.repo
src=local.repo
owner=root
mode=0644
when: is_redhat | bool
when: is_redhat
- name: Install yum packages
package: name={{ item }}
@ -36,7 +36,7 @@
- linux-firmware
- syslog
- xml-common
when: is_redhat | bool
when: is_redhat
- name: Install yum packages for Debian
package: name={{ item }}
@ -44,7 +44,7 @@
with_items:
- inetutils-syslogd
- wpasupplicant
when: is_debuntu | bool
when: is_debuntu
- name: Install common packages
package: name={{ item }}
@ -82,7 +82,7 @@
- glibc # CVE-2015-7547
- bash
- iptables
when: is_redhat | bool
when: is_redhat
- name: Update common packages (debian)
package: name={{ item }}
@ -91,7 +91,7 @@
- libc6
- bash
- iptables
when: is_debuntu | bool
when: is_debuntu
# instuctions state to start with a fully updated system before starting, stop using

View file

@ -6,7 +6,7 @@
- name: MYSQL
include_role:
name: mysql
#when: mysql_install | bool
#when: mysql_install
# 2020-05-21: Apache role 'httpd' is installed as nec by any of these 7 roles:
#
@ -22,12 +22,12 @@
- name: NGINX
include_role:
name: nginx
#when: nginx_install | bool
#when: nginx_install
- name: WWW_BASE (WWW_OPTIONS should be installed later)
include_role:
name: www_base
#when: www_base_install | bool # Flag might be created in future?
#when: www_base_install # Flag might be created in future?
- name: Recording STAGE 3 HAS COMPLETED =====================
lineinfile:

View file

@ -16,25 +16,25 @@
- name: Install pylibs (IIAB's python libs)
include_role:
name: pylibs
#when: pylibs_install | bool # Flag might be created in future?
#when: pylibs_install # Flag might be created in future?
# Also run by roles/1-prep/tasks/main.yml as required by OpenVPN.
- name: SSHD
include_role:
name: sshd
when: sshd_install | bool
when: sshd_install
- name: Install named / BIND
include_tasks: roles/network/tasks/named.yml
when: named_install | bool
when: named_install
- name: Install dhcpd
include_tasks: roles/network/tasks/dhcpd.yml
when: dhcpd_install | bool
when: dhcpd_install
- name: Install Squid (and DansGuardian if dansguardian_install)
include_tasks: roles/network/tasks/squid.yml
when: squid_install | bool
when: squid_install
- name: Install Bluetooth - only on Raspberry Pi
include_role:
@ -44,17 +44,17 @@
- name: USB_LIB
include_role:
name: usb_lib
when: usb_lib_install | bool
when: usb_lib_install
- name: CUPS
include_role:
name: cups
when: cups_install | bool
when: cups_install
- name: SAMBA
include_role:
name: samba
when: samba_install | bool
when: samba_install
# 2020-02-17: What was roles/homepage lives in roles/www_options
# 2020-10-08: Softcoded iiab_home_url should work (e.g. using local_vars.yml or
@ -65,7 +65,7 @@
- name: WWW_OPTIONS (WWW_BASE should have been installed earlier)
include_role:
name: www_options
#when: www_options_install | bool # Flag might be created in future?
#when: www_options_install # Flag might be created in future?
- name: Recording STAGE 4 HAS COMPLETED ==================
lineinfile:

View file

@ -24,47 +24,47 @@
- name: ELGG
include_role:
name: elgg
when: elgg_install | bool
when: elgg_install
- name: GITEA
include_role:
name: gitea
when: gitea_install | bool
when: gitea_install
- name: LOKOLE
include_role:
name: lokole
when: lokole_install | bool
when: lokole_install
- name: MEDIAWIKI
include_role:
name: mediawiki
when: mediawiki_install | bool
when: mediawiki_install
- name: MOSQUITTO
include_role:
name: mosquitto
when: mosquitto_install | bool
when: mosquitto_install
- name: NODE-RED
include_role:
name: nodered
when: nodered_install | bool
when: nodered_install
- name: NEXTCLOUD
include_role:
name: nextcloud
when: nextcloud_install | bool
when: nextcloud_install
- name: PBX
include_role:
name: pbx
when: pbx_install | bool
when: pbx_install
- name: WORDPRESS
include_role:
name: wordpress
when: wordpress_install | bool
when: wordpress_install
- name: Recording STAGE 6 HAS COMPLETED ====================
lineinfile:

View file

@ -6,27 +6,27 @@
- name: KALITE
include_role:
name: kalite
when: kalite_install | bool
when: kalite_install
- name: KOLIBRI
include_role:
name: kolibri
when: kolibri_install | bool
when: kolibri_install
- name: KIWIX
include_role:
name: kiwix
when: kiwix_install | bool
when: kiwix_install
- name: MOODLE
include_role:
name: moodle
when: moodle_install | bool
when: moodle_install
- name: OSM-VECTOR-MAPS
include_role:
name: osm-vector-maps
when: osm_vector_maps_install | bool
when: osm_vector_maps_install
# UNMAINTAINED
- name: OSM
@ -43,7 +43,7 @@
- name: SUGARIZER
include_role:
name: sugarizer
when: sugarizer_install | bool
when: sugarizer_install
- name: Recording STAGE 7 HAS COMPLETED ========================
lineinfile:

View file

@ -6,32 +6,32 @@
- name: TRANSMISSION
include_role:
name: transmission
when: transmission_install | bool
when: transmission_install
- name: AWSTATS
include_role:
name: awstats
when: awstats_install | bool
when: awstats_install
- name: MONIT
include_role:
name: monit
when: monit_install | bool
when: monit_install
- name: MUNIN
include_role:
name: munin
when: munin_install | bool
when: munin_install
- name: PHPMYADMIN
include_role:
name: phpmyadmin
when: phpmyadmin_install | bool
when: phpmyadmin_install
- name: VNSTAT
include_role:
name: vnstat
when: vnstat_install | bool
when: vnstat_install
- name: Recording STAGE 8 HAS COMPLETED ======================
lineinfile:

View file

@ -6,29 +6,29 @@
- name: INTERNETARCHIVE
include_role:
name: internetarchive
when: internetarchive_install | bool
when: internetarchive_install
# Is porting to Python 3 complete, and if so does this belong elsewhere?
- name: CAPTIVE PORTAL
include_role:
name: captiveportal
when: captiveportal_install | bool
when: captiveportal_install
- name: MINETEST
include_role:
name: minetest
when: minetest_install | bool
when: minetest_install
# KEEP AT THE END as this installs dependencies from Debian's 'testing' branch!
- name: CALIBRE
include_role:
name: calibre
when: calibre_install | bool
when: calibre_install
- name: CALIBRE-WEB
include_role:
name: calibre-web
when: calibreweb_install | bool
when: calibreweb_install
- name: Recording STAGE 9 HAS COMPLETED ====================
lineinfile:

View file

@ -1,6 +1,6 @@
- name: Enable http://box/awstats and/or http://box/awstats/awstats.pl via Apache
command: a2ensite awstats.conf
when: awstats_enabled | bool
when: awstats_enabled
- name: Disable http://box/awstats and/or http://box/awstats/awstats.pl via Apache
command: a2dissite awstats.conf

View file

@ -2,7 +2,7 @@
#
# - Prepare for a possible future w/o Apache by verifying/refining below...
# - 5 'when: apache_installed is defined'
# - 1 'when: nginx_install | bool'
# - 1 'when: nginx_install'
# - 8 core stanzas w/o such 'when:' clauses
- name: 'Install 3 packages: awstats, openssl, pwauth'
@ -98,7 +98,7 @@
template:
src: cgi-bin.php
dest: /etc/nginx/
when: nginx_install | bool
when: nginx_install
# RECORD AWStats AS INSTALLED

View file

@ -30,7 +30,7 @@
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml
when: nginx_enabled | bool
when: nginx_enabled
- name: Add 'awstats' variable values to {{ iiab_ini_file }}

View file

@ -2,7 +2,7 @@
template:
src: awstats-nginx.conf
dest: "{{ nginx_conf_dir }}/" # /etc/nginx/conf.d
when: awstats_enabled | bool
when: awstats_enabled
- name: Disable http://box/awstats via NGINX, by removing {{ nginx_conf_dir }}/awstats-nginx.conf
file:

View file

@ -25,7 +25,7 @@
dest: "{{ azuracast_host_dir }}/"
timeout: "{{ download_timeout }}"
mode: 0755
when: internet_available | bool
when: internet_available
- name: AzuraCast - Download AzuraCast's docker-compose.yml sample from GitHub to {{ azuracast_host_dir }}
get_url:
@ -33,7 +33,7 @@
dest: "{{ azuracast_host_dir }}/docker-compose.yml"
timeout: "{{ download_timeout }}"
mode: 0755
when: internet_available | bool
when: internet_available
- name: AzuraCast - Make changes to docker.sh script so it runs headless
lineinfile:

View file

@ -31,7 +31,7 @@
name: bt-pan
enabled: yes
state: restarted
when: bluetooth_enabled | bool
when: bluetooth_enabled
- name: Disable 'bt-pan' service
systemd:
@ -47,7 +47,7 @@
name: bt-term
enabled: yes
state: restarted
when: bluetooth_term_enabled | bool
when: bluetooth_term_enabled
- name: Disable 'bt-term' service
systemd:

View file

@ -1,6 +1,6 @@
- name: Enable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} via Apache # http://box/books, http://box/libros, http://box/livres
command: a2ensite calibre-web.conf
when: calibreweb_enabled | bool
when: calibreweb_enabled
- name: Disable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} via Apache
command: a2dissite calibre-web.conf

View file

@ -33,7 +33,7 @@
force: yes
depth: 1
version: "{{ calibreweb_version }}" # e.g. master, 0.6.5
when: internet_available | bool
when: internet_available
## Ansible Pip Bug: Cannot use 'chdir' with 'env' https://github.com/ansible/ansible/issues/37912 (Patch landed)
#- name: Download calibre-web dependencies into vendor subdirectory.
@ -50,7 +50,7 @@
virtualenv: "{{ calibreweb_venv_path }}" # /usr/local/calibre-web-py3
virtualenv_site_packages: no
virtualenv_command: python3 -m venv {{ calibreweb_venv_path }}
when: internet_available | bool
when: internet_available
- name: Install /etc/systemd/system/calibre-web.service from template
template:
@ -80,7 +80,7 @@
- roles/calibre-web/files/metadata.db
- roles/calibre-web/files/metadata_db_prefs_backup.json
when: not metadatadb.stat.exists
#when: calibreweb_provision | bool
#when: calibreweb_provision
- name: Provision/Copy default admin settings to {{ calibreweb_config }}/app.db IF metadata.db did not exist
copy:
@ -91,7 +91,7 @@
mode: '0644'
backup: yes
when: not metadatadb.stat.exists
#when: calibreweb_provision | bool
#when: calibreweb_provision
# RECORD Calibre-Web AS INSTALLED

View file

@ -30,7 +30,7 @@
daemon_reload: yes
enabled: yes
state: restarted
when: calibreweb_enabled | bool
when: calibreweb_enabled
- name: Disable & Stop 'calibre-web' systemd service, if not calibreweb_enabled
systemd:
@ -45,7 +45,7 @@
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml
when: nginx_enabled | bool
when: nginx_enabled
- name: Add 'calibre-web' variable values to {{ iiab_ini_file }}

View file

@ -5,7 +5,7 @@
template:
src: calibre-web-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/calibre-web-nginx.conf" # /etc/nginx/conf.d
when: calibreweb_enabled | bool
when: calibreweb_enabled
- name: Disable http://box{{ calibreweb_url1 }} via NGINX, by removing {{ nginx_conf_dir }}/calibre-web-nginx.conf
file:

View file

@ -14,7 +14,7 @@
#
#- name: Install Calibre via .debs (if Raspbian)
# command: scripts/calibre-install-latest-rpi.sh # WORKED for Calibre 3.33.1 on 2018-10-23. And Calibre 3.28 on 2018-07-26 (PR #971). Likewise for Calibre 3.26.x. FAILED with Calibre 3.24+ ("calibre : Depends: python-pyqt5 (>= 5.10.1+dfsg-2) but 5.10.1+dfsg-1+rpi1 is to be installed") since June 2018.
# when: is_raspbian | bool
# when: is_raspbian
# 2020-04-29: Can work *IF* you do 'apt install python2' and change top line
# of /opt/iiab/downloads/calibre-installer.py from '#!/usr/bin/env python2'

View file

@ -44,7 +44,7 @@
name: calibre-serve
enabled: yes
state: restarted
when: calibre_enabled | bool
when: calibre_enabled
- name: Disable & Stop 'calibre-serve' service, if not calibre_enabled
systemd:
@ -59,7 +59,7 @@
#
#- name: Enable/Disable/Restart NGINX if primary
# include_tasks: nginx.yml
# when: nginx_enabled | bool
# when: nginx_enabled
- name: Add 'calibre' variable values to {{ iiab_ini_file }}

View file

@ -12,7 +12,7 @@
backup: yes
timeout: "{{ download_timeout }}"
register: calibre_download_output
when: internet_available | bool
when: internet_available
# ALWAYS DEFINED, DESPITE get_url DOCUMENTATION CLAIM...
# - debug:
@ -53,4 +53,4 @@
shell: "{{ downloads_dir }}/calibre-installer.py >> /dev/null"
#args:
# creates: /usr/bin/calibre-uninstall
when: internet_available | bool
when: internet_available

View file

@ -15,7 +15,7 @@
template:
src: captiveportal.ini.j2
dest: /etc/uwsgi/apps-enabled/captiveportal.ini
when: captiveportal_enabled | bool
when: captiveportal_enabled
- name: Delete /etc/uwsgi/apps-enabled/captiveportal.ini (if not captiveportal_enabled)
file:
@ -28,7 +28,7 @@
src: /etc/nginx/sites-available/capture.conf
path: /etc/nginx/sites-enabled/capture.conf
state: link
when: captiveportal_enabled | bool
when: captiveportal_enabled
- name: Delete symlink /etc/nginx/sites-enabled/capture.conf to disable NGINX to location definitions for checkurls (if not captiveportal_enabled)
file:
@ -38,7 +38,7 @@
- name: Run iiab-divert-to-nginx to generate diversion lists for NGINX
shell: /usr/sbin/iiab-divert-to-nginx
when: captiveportal_enabled | bool
when: captiveportal_enabled
- name: Delete /etc/dnsmasq.d/capture to make sure dnsmasq is not diverting (if not captiveportal_enabled)
file:
@ -60,10 +60,10 @@
systemd:
name: dnsmasq
state: stopped
when: dnsmasq_enabled | bool
when: dnsmasq_enabled
- name: Start 'dnsmasq' systemd service (if dnsmasq_enabled)
systemd:
name: dnsmasq
state: started
when: dnsmasq_enabled | bool
when: dnsmasq_enabled

View file

@ -1,6 +1,6 @@
- name: Enable http://box/cups via Apache (MIGHT NOT WORK?)
command: a2ensite cups.conf
when: cups_enabled | bool
when: cups_enabled
- name: Disable http://box/cups via Apache
command: a2dissite cups.conf
@ -18,7 +18,7 @@
with_items:
- cups
- cups-browsed
when: cups_enabled | bool
when: cups_enabled
#when: cups_enabled and not is_F18
# - name: Enable & Start 'cups' systemd service (Fedora 18, for XO laptops)
@ -30,7 +30,7 @@
- name: Permit headless admin of CUPS -- only works when CUPS daemon is running (if cups_enabled)
shell: "cupsctl --remote-admin"
when: cups_enabled | bool
when: cups_enabled
- name: Disable & Stop 'cups' & 'cups-browsed' systemd services (OS's other than Fedora 18)
systemd:

View file

@ -1,6 +1,6 @@
- name: Enable http://box{{ elgg_url }} via Apache # http://box/elgg
command: a2ensite elgg.conf
when: elgg_enabled | bool
when: elgg_enabled
- name: Disable http://box{{ elgg_url }} via Apache # http://box/elgg
command: a2dissite elgg.conf

View file

@ -34,7 +34,7 @@
url: "{{ iiab_download_url }}/elgg-{{ elgg_version }}.zip"
dest: "{{ downloads_dir }}"
timeout: "{{ download_timeout }}"
when: internet_available | bool
when: internet_available
- name: Check for existence of /opt/elgg-{{ elgg_version }}/index.php
stat:

View file

@ -31,7 +31,7 @@
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml
when: nginx_enabled | bool
when: nginx_enabled
- name: Add 'elgg' variable values to {{ iiab_ini_file }}

View file

@ -2,7 +2,7 @@
template:
src: elgg-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/elgg-nginx.conf" # /etc/nginx/conf.d
when: elgg_enabled | bool
when: elgg_enabled
- name: Disable http://box{{ elgg_url }} via NGINX, by removing {{ nginx_conf_dir }}/elgg-nginx.conf # http://box/elgg
file:

View file

@ -28,7 +28,7 @@
name: "{{ dbname }}"
state: import
target: /tmp/elggdb.sql
when: create_elgg_database.changed | bool
when: create_elgg_database.changed
- name: Remove database dump /tmp/elggdb.sql
file:

View file

@ -1,6 +1,6 @@
- name: Enable http://box{{ gitea_url }} via Apache # http://box/gitea
command: a2ensite gitea.conf
when: gitea_enabled | bool
when: gitea_enabled
- name: Disable http://box{{ gitea_url }} via Apache # http://box/gitea
command: a2dissite gitea.conf

View file

@ -48,13 +48,13 @@
url: "{{ gitea_download_url }}"
dest: "{{ gitea_install_path }}"
mode: '0775'
when: internet_available | bool
when: internet_available
- name: Download Gitea GPG signature
get_url:
url: "{{ gitea_integrity_url }}"
dest: "{{ gitea_checksum_path }}"
when: internet_available | bool
when: internet_available
- name: Verify Gitea binary with GPG signature
shell: |

View file

@ -30,7 +30,7 @@
daemon_reload: yes
enabled: yes
state: restarted
when: gitea_enabled | bool
when: gitea_enabled
- name: Disable & Stop 'gitea' systemd service, if not gitea_enabled
systemd:
@ -45,7 +45,7 @@
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml
when: nginx_enabled | bool
when: nginx_enabled
- name: Add 'gitea' to list of services at {{ iiab_ini_file }}

View file

@ -2,7 +2,7 @@
template:
src: gitea-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/gitea-nginx.conf" # /etc/nginx/conf.d
when: gitea_enabled | bool
when: gitea_enabled
- name: Disable http://box{{ gitea_url }} via NGINX, by removing {{ nginx_conf_dir }}/gitea-nginx.conf
file:

View file

@ -10,7 +10,7 @@
- name: "IN CASE NGINX IS DISABLED: Enable IIAB pages via Apache (e.g. on port 80) by running 'a2ensite iiab-homepage.conf'"
command: a2ensite iiab-homepage.conf
#when: apache_enabled | bool
#when: apache_enabled
# - 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

View file

@ -8,8 +8,8 @@
# - "php{{ php_version }}"
# - "php{{ php_version }}-curl"
state: present
when: is_debuntu | bool
# when: is_debian | bool
when: is_debuntu
# when: is_debian
# - name: 'Install 2 packages: apache2, php (ubuntu)'
# package:
@ -19,7 +19,7 @@
# - "{{ apache_service }}" # apache2 on Debuntu
# - php
# state: present
# when: is_ubuntu | bool
# when: is_ubuntu
# 2019-05-30: It's interesting that http://box.lan/admin and everything seems
# to work even without php{{ php_version }}-sqlite3 as confirmed on Ubuntu
@ -49,7 +49,7 @@
- php
- php-curl
state: present
when: is_redhat | bool
when: is_redhat
# Remove symlinks for mpm_event, replace with mpm_prefork
- name: Remove both mpm_event symlinks from /etc/apache2/mods-enabled (debuntu)
@ -59,7 +59,7 @@
with_items:
- mpm_event.conf
- mpm_event.load
when: is_debuntu | bool
when: is_debuntu
- name: Create both mpm_prefork symlinks from /etc/apache2/mods-enabled to /etc/apache2/mods-available (debuntu)
file:
@ -69,7 +69,7 @@
with_items:
- mpm_prefork.conf
- mpm_prefork.load
when: is_debuntu | bool
when: is_debuntu
- name: 'Enable 5 Apache modules, as with "a2enmod" command: headers, proxy, proxy_html, proxy_http, rewrite (for http://box/kiwix, http://box/kolibri, http://box/nodered, etc--if debuntu)'
apache2_module:
@ -80,7 +80,7 @@
- proxy_html
- proxy_http
- rewrite
when: is_debuntu | bool
when: is_debuntu
- name: Remove 000-default.conf from /etc/apache2 and /etc/apache2/sites-enabled (debuntu)
file:
@ -89,7 +89,7 @@
with_items:
- /etc/apache2/000-default.conf # Not nec on Raspbian. Is this really still needed elsewhere?
- /etc/apache2/sites-enabled/000-default.conf
when: is_debuntu | bool
when: is_debuntu
- name: Create Apache's pid dir /var/run/{{ apache_user }}
file:
@ -128,7 +128,7 @@
- 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
#when: apache_enabled
# - 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

View file

@ -36,7 +36,7 @@
name: "{{ apache_service }}"
enabled: yes
state: started # No need to restart, as many IIAB apps do that later
when: apache_enabled | bool
when: apache_enabled
- name: Disable & Stop {{ apache_service }} systemd service, if not apache_enabled
systemd:

View file

@ -1,6 +1,6 @@
- name: Enable internetarchive.conf via Apache (for short URL http://box/archive eventually?) if internetarchive_enabled
command: a2ensite internetarchive.conf
when: internetarchive_enabled | bool
when: internetarchive_enabled
- name: Disable internetarchive.conf via Apache, if not internetarchive_enabled
command: a2dissite internetarchive.conf

View file

@ -46,7 +46,7 @@
args:
chdir: "{{ internetarchive_dir }}"
creates: "{{ internetarchive_dir }}/node_modules/@internetarchive/dweb-mirror/internetarchive"
when: internet_available | bool
when: internet_available
- name: mkdir {{ content_base }}/archiveorg
file:

View file

@ -59,7 +59,7 @@
daemon_reload: yes
enabled: yes
state: restarted
when: internetarchive_enabled | bool
when: internetarchive_enabled
- name: Disable & Stop 'internetarchive' systemd service, if not internetarchive_enabled
systemd:
@ -74,7 +74,7 @@
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml
when: nginx_enabled | bool
when: nginx_enabled
- name: Add 'internetarchive' variable values to {{ iiab_ini_file }}

View file

@ -2,7 +2,7 @@
template:
src: internetarchive-nginx.conf.j2 # TO DO: roles/internetarchive/templates/internetarchive-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/internetarchive-nginx.conf" # /etc/nginx/conf.d
when: internetarchive_enabled | bool
when: internetarchive_enabled
- name: Disable http://box/archive via NGINX, by removing {{ nginx_conf_dir }}/internetarchive-nginx.conf
file:

View file

@ -3,13 +3,13 @@
url: "{{ kalite_requirements }}"
dest: "{{ pip_packages_dir }}/kalite.txt" # /opt/iiab/pip-packages/kalite.txt
timeout: "{{ download_timeout }}"
when: internet_available | bool
when: internet_available
# 2020-01-19: https://github.com/piwheels/packages/issues/74 says the following is not longer needed...
#- name: Run 'mv /etc/pip.conf /etc/pip.conf.see-iiab-issue-2139' as "TEMPORARY" workaround (2020-01-17) for piwheels.org's setuptools Python 2/3 brokenness on RPi (https://github.com/iiab/iiab/issues/2139)
# command: mv /etc/pip.conf /etc/pip.conf.see-iiab-issue-2139
# ignore_errors: yes
# when: is_raspbian | bool
# when: is_raspbian
- name: Install python2, if Raspbian/Debian > 10 or Ubuntu > 19
package:
@ -41,7 +41,7 @@
virtualenv_command: /usr/bin/virtualenv
virtualenv_python: python2.7
extra_args: "--no-cache-dir"
when: internet_available | bool
when: internet_available
- name: "Install from templates: venv wrapper /usr/bin/kalite, systemd unit file kalite-serve.service"
template:

View file

@ -30,7 +30,7 @@
name: kalite-serve
enabled: yes
state: restarted
when: kalite_enabled | bool
when: kalite_enabled
- name: Disable & Stop 'kalite-serve' service, if not kalite_enabled
systemd:

View file

@ -1,8 +1,8 @@
Make zim with
./zimwriterfs --welcome=index.html --favicon=favicon.png --language=eng --title=test --description=test --creator=XSCE --publisher=XSCE /root/devel/test_zim test.zim
Create library.xml with
/opt/schoolserver/kiwix/bin/kiwix-manage /library/zims/library.xml add /library/zims/content/test.zim
Make zim with
./zimwriterfs --welcome=index.html --favicon=favicon.png --language=eng --title=test --description=test --creator=XSCE --publisher=XSCE /root/devel/test_zim test.zim
Create library.xml with
/opt/schoolserver/kiwix/bin/kiwix-manage /library/zims/library.xml add /library/zims/content/test.zim

View file

@ -1,6 +1,6 @@
- name: Enable http://box{{ kiwix_url }} via Apache # http://box/kiwix
command: a2ensite kiwix.conf
when: kiwix_enabled | bool
when: kiwix_enabled
- name: Disable http://box{{ kiwix_url }} via Apache # http://box/kiwix
command: a2dissite kiwix.conf

View file

@ -4,7 +4,7 @@
daemon_reload: yes
enabled: yes
state: restarted
when: kiwix_enabled | bool
when: kiwix_enabled
- name: Disable & Stop 'kiwix-serve' systemd service
systemd:
@ -42,4 +42,4 @@
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml
when: nginx_enabled | bool
when: nginx_enabled

View file

@ -37,7 +37,7 @@
url: "{{ iiab_download_url }}/{{ kiwix_src_file }}" # http://download.iiab.io/packages
dest: "{{ downloads_dir }}/{{ kiwix_src_file }}"
timeout: "{{ download_timeout }}"
when: internet_available | bool
when: internet_available
- name: Create dir {{ iiab_zim_path }} and subdirs {content, index} for Kiwix ZIM files
file:
@ -95,7 +95,7 @@
# - proxy_html
# - proxy_http
# - rewrite
# when: is_debuntu | bool
# when: is_debuntu
# 4. INSTALL iiab-make-kiwix-lib*, kiwix-serve.service, kiwix.conf for Apache

View file

@ -1,18 +1,18 @@
# Install kiwix android app apk for downloading
- name: Create {{ doc_root }}{{ kiwix_apk_url }} directory
file:
path: "{{ doc_root }}{{ kiwix_apk_url }}"
state: directory
- name: Download kiwix.apk to {{ doc_root }}{{ kiwix_apk_url }}
get_url:
url: "{{ kiwix_apk_src }}" # https://download.kiwix.org/release/kiwix-android/kiwix.apk
dest: "{{ doc_root }}{{ kiwix_apk_url }}"
timeout: "{{ download_timeout }}"
when: internet_available | bool
- name: Symlink {{ doc_root }}{{ kiwix_apk_url }}/zims -> {{ iiab_zim_path }}/content
file:
src: "{{ iiab_zim_path }}/content" # /library/zims/content
path: "{{ doc_root }}{{ kiwix_apk_url }}/zims" # /library/www/html/softare/kiwix/zims
state: link
# Install kiwix android app apk for downloading
- name: Create {{ doc_root }}{{ kiwix_apk_url }} directory
file:
path: "{{ doc_root }}{{ kiwix_apk_url }}"
state: directory
- name: Download kiwix.apk to {{ doc_root }}{{ kiwix_apk_url }}
get_url:
url: "{{ kiwix_apk_src }}" # https://download.kiwix.org/release/kiwix-android/kiwix.apk
dest: "{{ doc_root }}{{ kiwix_apk_url }}"
timeout: "{{ download_timeout }}"
when: internet_available
- name: Symlink {{ doc_root }}{{ kiwix_apk_url }}/zims -> {{ iiab_zim_path }}/content
file:
src: "{{ iiab_zim_path }}/content" # /library/zims/content
path: "{{ doc_root }}{{ kiwix_apk_url }}/zims" # /library/www/html/softare/kiwix/zims
state: link

View file

@ -2,7 +2,7 @@
template:
src: kiwix-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/kiwix-nginx.conf" # /etc/nginx/conf.d
when: kiwix_enabled | bool
when: kiwix_enabled
- name: Disable http://box{{ kiwix_url }} via NGINX, by removing {{ nginx_conf_dir }}/kiwix-nginx.conf # http://box/kiwix
file:

View file

@ -1,33 +1,33 @@
#!/bin/bash
LOCK_PATH=/run/lock/kiwix
mkdir -p $LOCK_PATH
WAITLOCK="$LOCK_PATH/make-kiwix-lib-wait.LCK";
RUNLOCK="$LOCK_PATH/kiwix-lib-access.LCK";
KIWIXLIB={{ kiwix_library_xml }}
exec 200>$WAITLOCK;
exec 201>$RUNLOCK;
if flock -n -e 200; then :
echo 'Waiting to run iiab-make-kiwix-lib.py'
# wait for up to 5 min
flock -x -w 300 201
flock -u 200 # unlock queue
echo "Now running iiab-make-kiwix-lib.py"
# write to {{ kiwix_library_xml }}.tmp to minimize kiwix down
# zim map could be out of sync for a few seconds
# using new version that does deltas
cp $KIWIXLIB $KIWIXLIB.tmp
/usr/bin/iiab-make-kiwix-lib.py
{{ systemctl_program }} stop kiwix-serve
rm $KIWIXLIB
mv $KIWIXLIB.tmp $KIWIXLIB
{{ systemctl_program }} start kiwix-serve
else
echo "Can't get wait lock for iiab-make-kiwix-lib.py";
exit 1;
fi
echo 'Finished making Kiwix library.xml'
exit 0
#!/bin/bash
LOCK_PATH=/run/lock/kiwix
mkdir -p $LOCK_PATH
WAITLOCK="$LOCK_PATH/make-kiwix-lib-wait.LCK";
RUNLOCK="$LOCK_PATH/kiwix-lib-access.LCK";
KIWIXLIB={{ kiwix_library_xml }}
exec 200>$WAITLOCK;
exec 201>$RUNLOCK;
if flock -n -e 200; then :
echo 'Waiting to run iiab-make-kiwix-lib.py'
# wait for up to 5 min
flock -x -w 300 201
flock -u 200 # unlock queue
echo "Now running iiab-make-kiwix-lib.py"
# write to {{ kiwix_library_xml }}.tmp to minimize kiwix down
# zim map could be out of sync for a few seconds
# using new version that does deltas
cp $KIWIXLIB $KIWIXLIB.tmp
/usr/bin/iiab-make-kiwix-lib.py
{{ systemctl_program }} stop kiwix-serve
rm $KIWIXLIB
mv $KIWIXLIB.tmp $KIWIXLIB
{{ systemctl_program }} start kiwix-serve
else
echo "Can't get wait lock for iiab-make-kiwix-lib.py";
exit 1;
fi
echo 'Finished making Kiwix library.xml'
exit 0

View file

@ -1,6 +1,6 @@
- name: Enable http://box{{ kolibri_url }} via Apache # http://box/kolibri
command: a2ensite kolibri.conf
when: kolibri_enabled | bool
when: kolibri_enabled
- name: Disable http://box{{ kolibri_url }} via Apache # http://box/kolibri
command: a2dissite kolibri.conf

View file

@ -37,7 +37,7 @@
environment:
KOLIBRI_HOME: "{{ kolibri_home }}" # these don't do a thing for now but
KOLIBRI_USER: "{{ kolibri_user }}" # both can't hurt & Might Help Later
when: internet_available | bool
when: internet_available
- name: 'Install from template: /etc/systemd/system/kolibri.service'
template:
@ -64,7 +64,7 @@
# ignore_errors: yes
# become: yes
# become_user: "{{ kolibri_user }}"
# when: kolibri_provision | bool
# when: kolibri_provision
# 2020-01-05: Deprecated per https://github.com/iiab/iiab/issues/2103
#- name: Set Kolibri default language ({{ kolibri_language }})
@ -72,7 +72,7 @@
# ignore_errors: yes
# become: yes
# become_user: "{{ kolibri_user }}"
# when: kolibri_provision | bool
# when: kolibri_provision
- name: 'Provision Kolibri, while setting: facility name, admin acnt / password, preset type, and language'
shell: >
@ -84,7 +84,7 @@
ignore_errors: yes
become: yes
become_user: "{{ kolibri_user }}"
when: kolibri_provision | bool
when: kolibri_provision
- name: chown -R {{ kolibri_user }}:{{ apache_user }} {{ kolibri_home }} for good measure?
file:
@ -92,7 +92,7 @@
owner: "{{ kolibri_user }}" # kolibri
group: "{{ apache_user }}" # www-data (on Debian/Ubuntu/Raspbian)
recurse: yes
when: kolibri_provision | bool
when: kolibri_provision
# 2019-10-07: Moved to roles/httpd/tasks/main.yml

View file

@ -35,7 +35,7 @@
daemon_reload: yes
enabled: yes
state: started
when: kolibri_enabled | bool
when: kolibri_enabled
- name: Disable & Stop 'kolibri' systemd service, if not kolibri_enabled
systemd:
@ -50,7 +50,7 @@
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml
when: nginx_enabled | bool
when: nginx_enabled
- name: Add 'kolibri' variable values to {{ iiab_ini_file }} # /etc/iiab/iiab.ini

View file

@ -2,7 +2,7 @@
template:
src: kolibri-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/kolibri-nginx.conf" # /etc/nginx/conf.d
when: kolibri_enabled | bool
when: kolibri_enabled
- name: Disable http://box{{ kolibri_url }} via NGINX, by removing {{ nginx_conf_dir }}/kolibri-nginx.conf # http://box/kolibri
file:

View file

@ -1,6 +1,6 @@
- name: Enable http://box{{ lokole_url }} via Apache # http://box/lokole
command: a2ensite lokole.conf
when: lokole_enabled | bool
when: lokole_enabled
- name: Disable http://box{{ lokole_url }} via Apache # http://box/lokole
command: a2dissite lokole.conf

View file

@ -37,7 +37,7 @@
virtualenv_command: python3 -m venv "{{ lokole_venv }}"
extra_args: --no-cache-dir # To avoid caching issues e.g. soon after new releases hit https://pypi.org/project/opwen-email-client/
when:
- internet_available | bool
- internet_available
- lokole_commit is defined
# For development purposes -- To install a given pip version of Lokole, add
@ -51,7 +51,7 @@
virtualenv_command: python3 -m venv "{{ lokole_venv }}"
extra_args: --no-cache-dir # To avoid caching issues e.g. soon after new releases hit https://pypi.org/project/opwen-email-client/
when:
- internet_available | bool
- internet_available
- lokole_version is defined
- name: "DEFAULT: pip install opwen_email_client (Lokole, latest available version) from PyPI to {{ lokole_venv }}, if above vars both UNdefined"
@ -61,7 +61,7 @@
virtualenv_command: python3 -m venv "{{ lokole_venv }}"
extra_args: --no-cache-dir # To avoid caching issues e.g. soon after new releases hit https://pypi.org/project/opwen-email-client/
when:
- internet_available | bool
- internet_available
- lokole_commit is undefined and lokole_version is undefined
- name: Compile translations
@ -99,7 +99,7 @@
src: lokole.conf.j2
dest: "/etc/{{ apache_conf_dir }}/lokole.conf"
mode: 0644
when: apache_install | bool
when: apache_install
- name: Install unit files {lokole.service, celery.service, celerybeat.service, lokole_restarter.service} into /etc/systemd/system, from template
template:

View file

@ -27,14 +27,14 @@
- name: Do a 'systemctl daemon-reload' if lokole_enabled
systemd:
daemon_reload: yes
when: lokole_enabled | bool
when: lokole_enabled
- name: Enable & Restart {lokole, celery, celerybeat, lokole_restarter} systemd services, if lokole_enabled
systemd:
name: "{{ item }}"
enabled: yes
state: restarted
when: lokole_enabled | bool
when: lokole_enabled
with_items:
- lokole
- celery
@ -60,7 +60,7 @@
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml
when: nginx_enabled | bool
when: nginx_enabled
- name: Add 'lokole' variable values to {{ iiab_ini_file }}

View file

@ -2,7 +2,7 @@
template:
src: lokole-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/lokole-nginx.conf" # /etc/nginx/conf.d
when: lokole_enabled | bool
when: lokole_enabled
- name: Disable http://box{{ lokole_url }} via NGINX, by removing {{ nginx_conf_dir }}/lokole-nginx.conf # http://box/lokole
file:

View file

@ -1,6 +1,6 @@
- name: Enable http://box{{ mediawiki_url }} via Apache # http://box/wiki
command: a2ensite mediawiki.conf
when: mediawiki_enabled | bool
when: mediawiki_enabled
- name: Disable http://box{{ mediawiki_url }} via Apache # http://box/wiki
command: a2dissite mediawiki.conf

View file

@ -12,7 +12,7 @@
timeout: "{{ download_timeout }}"
#force: yes
#backup: yes
when: internet_available | bool
when: internet_available
- name: Unarchive (unpack) it to permanent location {{ mediawiki_abs_path }} ({{ apache_user }}:{{ apache_user }}, u+rw,g+r,o+r)
unarchive:

View file

@ -30,7 +30,7 @@
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml
when: nginx_enabled | bool
when: nginx_enabled
- name: Add 'mediawiki' variable values to {{ iiab_ini_file }}

View file

@ -2,7 +2,7 @@
template:
src: mediawiki-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/mediawiki-nginx.conf" # /etc/nginx.conf.d
when: mediawiki_enabled | bool
when: mediawiki_enabled
- name: Disable http://box{{ mediawiki_url }} & http://box{{ mediawiki_url2 }} via NGINX, by removing {{ nginx_conf_dir }}/mediawiki-nginx.conf # http://box/wiki & http://box/mediawiki
file:

View file

@ -7,7 +7,7 @@
# only works if server run as root
minetest_runas_user: root
minetest_runas_group: root
when: is_raspbian | bool
when: is_raspbian
# For other installs
- name: Set some facts for other platforms

View file

@ -5,7 +5,7 @@
name: minetest-server
enabled: yes
state: restarted
when: minetest_enabled | bool
when: minetest_enabled
- name: Disable & Stop 'minetest-server' service
systemd:

View file

@ -24,7 +24,7 @@
line: "{{ item.line }}"
with_items:
- { regexp: '^mg_name = ', line: 'mg_name = flat' }
when: minetest_flat_world | bool
when: minetest_flat_world
- name: Create /library/games/minetest/worlds/world
file:

View file

@ -49,4 +49,4 @@
with_items:
- { src: 'minetest.conf.j2', dest: '/etc/minetest/minetest.conf' }
- { src: 'minetest-server.service.j2', dest: '/etc/systemd/system/minetest-server.service' }
when: minetest_install | bool
when: minetest_install

View file

@ -92,7 +92,7 @@
repo: deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse
state: present
filename: mongodb-org
when: is_linuxmint | bool
when: is_linuxmint
- name: Use mongodb-org's Ubuntu repo for all non-Mint Ubuntu - 64bit only
apt_repository:

View file

@ -11,7 +11,7 @@
name: monit
enabled: yes
state: restarted
when: monit_enabled | bool
when: monit_enabled
- name: Disable & Stop 'monit' service, if not monit_enabled
systemd:

View file

@ -1,6 +1,6 @@
- name: Enable http://box/moodle via Apache
command: a2ensite 022-moodle.conf
when: moodle_enabled | bool
when: moodle_enabled
- name: Disable http://box/moodle via Apache
command: a2dissite 022-moodle.conf

View file

@ -36,7 +36,7 @@
- php{{ php_version }}-mbstring # 2020-06-15: Now required by Moodle 3.9+
- php{{ php_version }}-cli # 2020-06-15: In the past this included (above) mbstring? However this is not true on Ubuntu Server 20.04 LTS.
state: present
when: is_debuntu | bool
when: is_debuntu
# - name: "Install package: php{{ php_version }}-zip (Ubuntu or Debian 9+)"
# package:
@ -46,7 +46,7 @@
# - name: "Install package: php-pclzip (debian-8)"
# package:
# name: php-pclzip
# when: is_debian_8 | bool
# when: is_debian_8
- name: Does {{ moodle_base }}/config-dist.php exist? (indicating Moodle is/was installed)
stat:
@ -135,7 +135,7 @@
name: postgresql-iiab
state: restarted
#enabled: yes
#when: moodle_enabled | bool
#when: moodle_enabled
- name: (Re)Start '{{ apache_service }}' systemd service
systemd:

View file

@ -30,7 +30,7 @@
# deamon_reload: yes
# state: started
# enabled: yes
# when: moodle_enabled | bool
# when: moodle_enabled
#
# # if the only service using the backend db disable if not running
# - name: Disable 'postgresql-iiab' systemd service, if 'not moodle_enabled and not (pathagar_enabled is defined and pathagar_enabled)'
@ -44,7 +44,7 @@
set_fact:
postgresql_install: True
postgresql_enabled: True
when: moodle_enabled | bool
when: moodle_enabled
- name: "Set 'postgresql_enabled: False' if 'not moodle_enabled and not (pathagar_enabled is defined and pathagar_enabled)'"
set_fact:
@ -63,7 +63,7 @@
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml
when: nginx_enabled | bool
when: nginx_enabled
- name: Add 'moodle' variable values to {{ iiab_ini_file }}

View file

@ -2,7 +2,7 @@
template:
src: moodle-nginx.conf.j2
dest: "{{ nginx_conf_dir }}/moodle-nginx.conf" # /etc/nginx/conf.d
when: moodle_enabled | bool
when: moodle_enabled
- name: Disable http://box/moodle via NGINX, by removing {{ nginx_conf_dir }}/moodle-nginx.conf
file:

View file

@ -4,7 +4,7 @@
name: mosquitto
enabled: yes
state: restarted
when: mosquitto_enabled | bool
when: mosquitto_enabled
- name: Disable & Stop 'mosquitto' systemd service, if not mosquitto_enabled
systemd:

View file

@ -1,6 +1,6 @@
- name: Enable http://box/munin via Apache
command: a2ensite munin24.conf
when: munin_enabled | bool
when: munin_enabled
- name: Disable http://box/munin via Apache
command: a2dissite munin24.conf

View file

@ -7,7 +7,7 @@
- libcgi-fast-perl
- libapache2-mod-fcgid
state: present
when: is_debuntu | bool
when: is_debuntu
- name: "Install 2 packages: munin, munin-node (OS's other than debuntu)"
package:
@ -46,7 +46,7 @@
- /usr/share/munin/plugins/mysql_queries
- /usr/share/munin/plugins/mysql_slowqueries
- /usr/share/munin/plugins/mysql_threads
when: mysql_enabled | bool
when: mysql_enabled
# RECORD Munin AS INSTALLED

View file

@ -30,7 +30,7 @@
daemon_reload: yes
enabled: yes
state: started
when: munin_enabled | bool
when: munin_enabled
- name: Disable & Stop 'munin-node' systemd service
systemd:
@ -45,7 +45,7 @@
- name: Enable/Disable/Restart NGINX if primary
include_tasks: nginx.yml
when: nginx_enabled | bool
when: nginx_enabled
- name: Add 'munin' variable values to {{ iiab_ini_file }}

Some files were not shown because too many files have changed in this diff Show more