mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #2190 from holta/avoid-dups
Refine @jvonau's PR #2134 - avoid dependency dups for speed / bugfix
This commit is contained in:
commit
016b914037
20 changed files with 118 additions and 120 deletions
|
@ -123,19 +123,6 @@
|
||||||
# We decided to enable mysql unconditionally.
|
# We decided to enable mysql unconditionally.
|
||||||
# when: elgg_enabled or rachel_enabled or owncloud_enabled or phpmyadmin_enabled or wordpress_enabled or iiab_menu_install
|
# when: elgg_enabled or rachel_enabled or owncloud_enabled or phpmyadmin_enabled or wordpress_enabled or iiab_menu_install
|
||||||
|
|
||||||
# There might be other db's
|
|
||||||
- name: Turn on both vars for PostgreSQL if moodle_enabled or pathagar_enabled
|
|
||||||
set_fact:
|
|
||||||
postgresql_install: True
|
|
||||||
postgresql_enabled: True
|
|
||||||
when: moodle_enabled or (pathagar_enabled is defined and pathagar_enabled)
|
|
||||||
|
|
||||||
#- name: Turn on vars for Docker if SchoolTool is to be installed
|
|
||||||
# set_fact:
|
|
||||||
# docker_install: True
|
|
||||||
# docker_enabled: True
|
|
||||||
# when: schooltool_enabled or schooltool_install
|
|
||||||
|
|
||||||
- name: "Set python_path: /lib/python2.7/site-packages/ (redhat)"
|
- name: "Set python_path: /lib/python2.7/site-packages/ (redhat)"
|
||||||
set_fact:
|
set_fact:
|
||||||
python_path: /lib/python2.7/site-packages/
|
python_path: /lib/python2.7/site-packages/
|
||||||
|
|
|
@ -66,26 +66,22 @@
|
||||||
include_role:
|
include_role:
|
||||||
name: sshd
|
name: sshd
|
||||||
# has no "when: XXXXX_install" flag
|
# has no "when: XXXXX_install" flag
|
||||||
#tags: base, sshd
|
|
||||||
|
|
||||||
- name: IIAB-ADMIN
|
- name: IIAB-ADMIN
|
||||||
include_role:
|
include_role:
|
||||||
name: iiab-admin
|
name: iiab-admin
|
||||||
# has no "when: XXXXX_install" flag
|
# has no "when: XXXXX_install" flag
|
||||||
#tags: base, iiab-admin
|
|
||||||
|
|
||||||
- name: OPENVPN
|
- name: OPENVPN
|
||||||
include_role:
|
include_role:
|
||||||
name: openvpn
|
name: openvpn
|
||||||
when: openvpn_install | bool
|
when: openvpn_install | bool
|
||||||
#tags: openvpn
|
|
||||||
|
|
||||||
# for rpi, without rtc, we need time as soon as possible
|
# for rpi, without rtc, we need time as soon as possible
|
||||||
- name: Install chrony (an NTP package) especially for RPi's lacking RTC
|
- name: Install chrony (an NTP package) especially for RPi's lacking RTC
|
||||||
package:
|
package:
|
||||||
name: chrony
|
name: chrony
|
||||||
state: present
|
state: present
|
||||||
#tags: download
|
|
||||||
|
|
||||||
#TODO: Use regexp filter instead of hard-code ip
|
#TODO: Use regexp filter instead of hard-code ip
|
||||||
- name: Install /etc/chrony.conf from template
|
- name: Install /etc/chrony.conf from template
|
||||||
|
|
|
@ -7,13 +7,11 @@
|
||||||
include_role:
|
include_role:
|
||||||
name: httpd
|
name: httpd
|
||||||
when: apache_install | bool
|
when: apache_install | bool
|
||||||
#tags: base, httpd
|
|
||||||
|
|
||||||
- name: MYSQL
|
- name: MYSQL
|
||||||
include_role:
|
include_role:
|
||||||
name: mysql
|
name: mysql
|
||||||
when: mysql_install | bool
|
when: mysql_install | bool
|
||||||
#tags: base, mysql
|
|
||||||
|
|
||||||
- name: Install NGINX (configured LATER, in Stage 9-LOCAL-ADDONS)
|
- name: Install NGINX (configured LATER, in Stage 9-LOCAL-ADDONS)
|
||||||
include_tasks: roles/nginx/tasks/install.yml
|
include_tasks: roles/nginx/tasks/install.yml
|
||||||
|
@ -22,7 +20,6 @@
|
||||||
- name: Install dnsmasq
|
- name: Install dnsmasq
|
||||||
include_tasks: roles/network/tasks/dnsmasq.yml
|
include_tasks: roles/network/tasks/dnsmasq.yml
|
||||||
when: dnsmasq_install | bool
|
when: dnsmasq_install | bool
|
||||||
#tags: base, domain, dnsmasq, network
|
|
||||||
|
|
||||||
- name: Recording STAGE 3 HAS COMPLETED =====================
|
- name: Recording STAGE 3 HAS COMPLETED =====================
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
|
|
@ -8,63 +8,41 @@
|
||||||
- name: Install named / BIND
|
- name: Install named / BIND
|
||||||
include_tasks: roles/network/tasks/named.yml
|
include_tasks: roles/network/tasks/named.yml
|
||||||
when: named_install | bool
|
when: named_install | bool
|
||||||
#tags: base, named, network, domain
|
|
||||||
|
|
||||||
- name: Installing dhcpd
|
- name: Installing dhcpd
|
||||||
include_tasks: roles/network/tasks/dhcpd.yml
|
include_tasks: roles/network/tasks/dhcpd.yml
|
||||||
when: dhcpd_install | bool
|
when: dhcpd_install | bool
|
||||||
#tags: base, dhcpd, network, domain
|
|
||||||
|
|
||||||
- name: Install Squid (and DansGuardian if dansguardian_install)
|
- name: Install Squid (and DansGuardian if dansguardian_install)
|
||||||
include_tasks: roles/network/tasks/squid.yml
|
include_tasks: roles/network/tasks/squid.yml
|
||||||
when: squid_install | bool
|
when: squid_install | bool
|
||||||
#tags: base, squid, network, domain
|
|
||||||
|
|
||||||
- name: Install Bluetooth - only on Raspberry Pi
|
- name: Install Bluetooth - only on Raspberry Pi
|
||||||
include_role:
|
include_role:
|
||||||
name: bluetooth
|
name: bluetooth
|
||||||
when: (is_rpi and bluetooth_install) or bluetooth_installed is defined
|
when: is_rpi and bluetooth_install # or bluetooth_installed is defined
|
||||||
#tags: bluetooth
|
|
||||||
|
|
||||||
- name: USB-LIB
|
- name: USB-LIB
|
||||||
include_role:
|
include_role:
|
||||||
name: usb-lib
|
name: usb-lib
|
||||||
when: usb_lib_install | bool
|
when: usb_lib_install | bool
|
||||||
#tags: usb-lib
|
|
||||||
|
|
||||||
# NETWORK moved to the very end, after Stage 9 (9-LOCAL-ADDONS)
|
# This is in Stage 4-SERVER-OPTIONS (rather than 3-BASE-SERVER) because var
|
||||||
# It can also be run manually using: cd /opt/iiab/iiab; ./iiab-network
|
# iiab_home_url changes, and may need to be re-run in the field/offline/etc.
|
||||||
#
|
|
||||||
#- name: NETWORK
|
|
||||||
# include_role:
|
|
||||||
# name: network
|
|
||||||
# # has no "when: XXXXX_install" flag
|
|
||||||
# tags: base, network
|
|
||||||
|
|
||||||
# MANDATORY SO PERHAPS THIS BELONGS IN 3-BASE-SERVER ?
|
|
||||||
- name: HOMEPAGE
|
- name: HOMEPAGE
|
||||||
include_role:
|
include_role:
|
||||||
name: homepage
|
name: homepage
|
||||||
# has no "when: XXXXX_install" flag
|
# has no "when: XXXXX_install" flag
|
||||||
#tags: base, homepage
|
|
||||||
|
|
||||||
- name: POSTGRESQL
|
|
||||||
include_role:
|
|
||||||
name: postgresql
|
|
||||||
when: postgresql_install | bool
|
|
||||||
#tags: postgresql, pathagar, moodle
|
|
||||||
|
|
||||||
- name: CUPS
|
- name: CUPS
|
||||||
include_role:
|
include_role:
|
||||||
name: cups
|
name: cups
|
||||||
when: cups_install or cups_installed is defined
|
when: cups_install # or cups_installed is defined
|
||||||
#tags: cups
|
|
||||||
|
|
||||||
- name: SAMBA
|
- name: SAMBA
|
||||||
include_role:
|
include_role:
|
||||||
name: samba
|
name: samba
|
||||||
when: samba_install or samba_installed is defined
|
when: samba_install # or samba_installed is defined
|
||||||
#tags: samba
|
|
||||||
|
|
||||||
- name: Run /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation. (This script was installed at the beginning of Stage 3 = roles/3-base-server/tasks/main.yml, which ran Apache playbook = roles/httpd/tasks/main.yml)
|
- name: Run /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation. (This script was installed at the beginning of Stage 3 = roles/3-base-server/tasks/main.yml, which ran Apache playbook = roles/httpd/tasks/main.yml)
|
||||||
command: /usr/bin/iiab-refresh-wiki-docs
|
command: /usr/bin/iiab-refresh-wiki-docs
|
||||||
|
|
|
@ -3,24 +3,23 @@
|
||||||
- name: ...IS BEGINNING =====================================
|
- name: ...IS BEGINNING =====================================
|
||||||
command: echo
|
command: echo
|
||||||
|
|
||||||
|
# UNMAINTAINED
|
||||||
- name: ACTIVITY-SERVER
|
- name: ACTIVITY-SERVER
|
||||||
include_role:
|
include_role:
|
||||||
name: activity-server
|
name: activity-server
|
||||||
when: activity_server_install | bool
|
when: activity_server_install is defined and activity_server_install
|
||||||
#tags: olpc, activity-server
|
|
||||||
|
|
||||||
|
# UNMAINTAINED
|
||||||
- name: EJABBERD_XS
|
- name: EJABBERD_XS
|
||||||
include_role:
|
include_role:
|
||||||
name: ejabberd_xs
|
name: ejabberd_xs
|
||||||
when: ejabberd_xs_install | bool
|
when: ejabberd_xs_install is defined and ejabberd_xs_install
|
||||||
#tags: olpc, ejabberd-xs
|
|
||||||
|
|
||||||
# UNMAINTAINED
|
# UNMAINTAINED
|
||||||
- name: IDMGR
|
- name: IDMGR
|
||||||
include_role:
|
include_role:
|
||||||
name: idmgr
|
name: idmgr
|
||||||
when: idmgr_install | bool
|
when: idmgr_install is defined and idmgr_install
|
||||||
#tags: olpc, idmgr
|
|
||||||
|
|
||||||
- name: Recording STAGE 5 HAS COMPLETED =====================
|
- name: Recording STAGE 5 HAS COMPLETED =====================
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
|
|
@ -7,75 +7,63 @@
|
||||||
include_role:
|
include_role:
|
||||||
name: azuracast
|
name: azuracast
|
||||||
when: azuracast_install | bool
|
when: azuracast_install | bool
|
||||||
#tags: azuracast
|
|
||||||
|
|
||||||
# UNMAINTAINED
|
# UNMAINTAINED
|
||||||
- name: DOKUWIKI
|
- name: DOKUWIKI
|
||||||
include_role:
|
include_role:
|
||||||
name: dokuwiki
|
name: dokuwiki
|
||||||
when: dokuwiki_install | bool
|
when: dokuwiki_install is defined and dokuwiki_install
|
||||||
#tags: dokuwiki
|
|
||||||
|
|
||||||
# UNMAINTAINED
|
# UNMAINTAINED
|
||||||
- name: EJABBERD
|
- name: EJABBERD
|
||||||
include_role:
|
include_role:
|
||||||
name: ejabberd
|
name: ejabberd
|
||||||
when: ejabberd_install | bool
|
when: ejabberd_install is defined and ejabberd_install
|
||||||
#tags: ejabberd
|
|
||||||
|
|
||||||
- name: ELGG
|
- name: ELGG
|
||||||
include_role:
|
include_role:
|
||||||
name: elgg
|
name: elgg
|
||||||
when: elgg_install | bool
|
when: elgg_install | bool
|
||||||
#tags: elgg
|
|
||||||
|
|
||||||
- name: GITEA
|
- name: GITEA
|
||||||
include_role:
|
include_role:
|
||||||
name: gitea
|
name: gitea
|
||||||
when: gitea_install | bool
|
when: gitea_install | bool
|
||||||
#tags: gitea
|
|
||||||
|
|
||||||
- name: LOKOLE
|
- name: LOKOLE
|
||||||
include_role:
|
include_role:
|
||||||
name: lokole
|
name: lokole
|
||||||
when: lokole_install | bool
|
when: lokole_install | bool
|
||||||
#tags: lokole
|
|
||||||
|
|
||||||
- name: MEDIAWIKI
|
- name: MEDIAWIKI
|
||||||
include_role:
|
include_role:
|
||||||
name: mediawiki
|
name: mediawiki
|
||||||
when: mediawiki_install | bool
|
when: mediawiki_install | bool
|
||||||
#tags: mediawiki
|
|
||||||
|
|
||||||
- name: MOSQUITTO
|
- name: MOSQUITTO
|
||||||
include_role:
|
include_role:
|
||||||
name: mosquitto
|
name: mosquitto
|
||||||
when: mosquitto_install | bool
|
when: mosquitto_install | bool
|
||||||
#tags: mosquitto
|
|
||||||
|
|
||||||
- name: NODE-RED
|
- name: NODE-RED
|
||||||
include_role:
|
include_role:
|
||||||
name: nodered
|
name: nodered
|
||||||
when: nodered_install | bool
|
when: nodered_install | bool
|
||||||
#tags: nodered
|
|
||||||
|
|
||||||
- name: NEXTCLOUD
|
- name: NEXTCLOUD
|
||||||
include_role:
|
include_role:
|
||||||
name: nextcloud
|
name: nextcloud
|
||||||
when: nextcloud_install | bool
|
when: nextcloud_install | bool
|
||||||
#tags: nextcloud
|
|
||||||
|
|
||||||
- name: PBX
|
- name: PBX
|
||||||
include_role:
|
include_role:
|
||||||
name: pbx
|
name: pbx
|
||||||
when: pbx_install | bool
|
when: pbx_install | bool
|
||||||
#tags: pbx
|
|
||||||
|
|
||||||
- name: WORDPRESS
|
- name: WORDPRESS
|
||||||
include_role:
|
include_role:
|
||||||
name: wordpress
|
name: wordpress
|
||||||
when: wordpress_install | bool
|
when: wordpress_install | bool
|
||||||
#tags: wordpress
|
|
||||||
|
|
||||||
- name: Recording STAGE 6 HAS COMPLETED ====================
|
- name: Recording STAGE 6 HAS COMPLETED ====================
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
|
|
@ -7,51 +7,43 @@
|
||||||
include_role:
|
include_role:
|
||||||
name: kalite
|
name: kalite
|
||||||
when: kalite_install | bool
|
when: kalite_install | bool
|
||||||
#tags: kalite
|
|
||||||
|
|
||||||
- name: KOLIBRI
|
- name: KOLIBRI
|
||||||
include_role:
|
include_role:
|
||||||
name: kolibri
|
name: kolibri
|
||||||
when: kolibri_install | bool
|
when: kolibri_install | bool
|
||||||
#tags: kolibri
|
|
||||||
|
|
||||||
- name: KIWIX
|
- name: KIWIX
|
||||||
include_role:
|
include_role:
|
||||||
name: kiwix
|
name: kiwix
|
||||||
when: kiwix_install | bool
|
when: kiwix_install | bool
|
||||||
#tags: kiwix
|
|
||||||
|
|
||||||
- name: MOODLE
|
- name: MOODLE
|
||||||
include_role:
|
include_role:
|
||||||
name: moodle
|
name: moodle
|
||||||
when: moodle_install | bool
|
when: moodle_install | bool
|
||||||
#tags: olpc, moodle
|
|
||||||
|
|
||||||
- name: OSM-VECTOR-MAPS
|
- name: OSM-VECTOR-MAPS
|
||||||
include_role:
|
include_role:
|
||||||
name: osm-vector-maps
|
name: osm-vector-maps
|
||||||
when: osm_vector_maps_install | bool
|
when: osm_vector_maps_install | bool
|
||||||
#tags: osm, maps
|
|
||||||
|
|
||||||
# UNMAINTAINED
|
# UNMAINTAINED
|
||||||
- name: OSM
|
- name: OSM
|
||||||
include_role:
|
include_role:
|
||||||
name: osm
|
name: osm
|
||||||
when: osm_install is defined and osm_install
|
when: osm_install is defined and osm_install
|
||||||
#tags: osm, maps
|
|
||||||
|
|
||||||
# UNMAINTAINED
|
# UNMAINTAINED
|
||||||
- name: PATHAGAR
|
- name: PATHAGAR
|
||||||
include_role:
|
include_role:
|
||||||
name: pathagar
|
name: pathagar
|
||||||
when: pathagar_install is defined and pathagar_install
|
when: pathagar_install is defined and pathagar_install
|
||||||
#tags: pathagar
|
|
||||||
|
|
||||||
- name: SUGARIZER
|
- name: SUGARIZER
|
||||||
include_role:
|
include_role:
|
||||||
name: sugarizer
|
name: sugarizer
|
||||||
when: sugarizer_install | bool
|
when: sugarizer_install | bool
|
||||||
#tags: sugarizer
|
|
||||||
|
|
||||||
- name: Recording STAGE 7 HAS COMPLETED ========================
|
- name: Recording STAGE 7 HAS COMPLETED ========================
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
|
|
@ -7,37 +7,31 @@
|
||||||
include_role:
|
include_role:
|
||||||
name: transmission
|
name: transmission
|
||||||
when: transmission_install | bool
|
when: transmission_install | bool
|
||||||
#tags: transmission
|
|
||||||
|
|
||||||
- name: AWSTATS
|
- name: AWSTATS
|
||||||
include_role:
|
include_role:
|
||||||
name: awstats
|
name: awstats
|
||||||
when: awstats_install | bool
|
when: awstats_install | bool
|
||||||
#tags: awstats
|
|
||||||
|
|
||||||
- name: MONIT
|
- name: MONIT
|
||||||
include_role:
|
include_role:
|
||||||
name: monit
|
name: monit
|
||||||
when: monit_install | bool
|
when: monit_install | bool
|
||||||
#tags: monit
|
|
||||||
|
|
||||||
- name: MUNIN
|
- name: MUNIN
|
||||||
include_role:
|
include_role:
|
||||||
name: munin
|
name: munin
|
||||||
when: munin_install | bool
|
when: munin_install | bool
|
||||||
#tags: munin
|
|
||||||
|
|
||||||
- name: PHPMYADMIN
|
- name: PHPMYADMIN
|
||||||
include_role:
|
include_role:
|
||||||
name: phpmyadmin
|
name: phpmyadmin
|
||||||
when: phpmyadmin_install | bool
|
when: phpmyadmin_install | bool
|
||||||
#tags: phpmyadmin
|
|
||||||
|
|
||||||
- name: VNSTAT
|
- name: VNSTAT
|
||||||
include_role:
|
include_role:
|
||||||
name: vnstat
|
name: vnstat
|
||||||
when: vnstat_install | bool
|
when: vnstat_install | bool
|
||||||
#tags: vnstat
|
|
||||||
|
|
||||||
- name: Recording STAGE 8 HAS COMPLETED ======================
|
- name: Recording STAGE 8 HAS COMPLETED ======================
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
|
|
@ -1,3 +1,18 @@
|
||||||
|
- name: Enable 'postgresql-iiab' systemd service, if moodle_enabled
|
||||||
|
systemd:
|
||||||
|
name: postgresql-iiab
|
||||||
|
state: started
|
||||||
|
enabled: yes
|
||||||
|
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)
|
||||||
|
systemd:
|
||||||
|
name: postgresql-iiab
|
||||||
|
state: stopped
|
||||||
|
enabled: no
|
||||||
|
when: not moodle_enabled and not (pathagar_enabled is defined and pathagar_enabled)
|
||||||
|
|
||||||
# Apache
|
# Apache
|
||||||
|
|
||||||
- name: Enable http://box/moodle via Apache
|
- name: Enable http://box/moodle via Apache
|
||||||
|
@ -8,7 +23,7 @@
|
||||||
command: a2dissite 022-moodle.conf
|
command: a2dissite 022-moodle.conf
|
||||||
when: apache_install and not moodle_enabled
|
when: apache_install and not moodle_enabled
|
||||||
|
|
||||||
- name: Restart Apache systemd service ({{ apache_service }})
|
- name: Restart '{{ apache_service }}' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/<OS>.yml
|
name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/<OS>.yml
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
- name: "Set PostgreSQL vars 'postgresql_install: True' and 'postgresql_enabled: True'"
|
||||||
|
set_fact:
|
||||||
|
postgresql_install: True
|
||||||
|
postgresql_enabled: True
|
||||||
|
|
||||||
|
- name: POSTGRESQL - run the 'postgresql' role
|
||||||
|
include_role:
|
||||||
|
name: postgresql
|
||||||
|
|
||||||
- name: "Install packages: python-psycopg2, php-pgsql (OS's other than debuntu)"
|
- name: "Install packages: python-psycopg2, php-pgsql (OS's other than debuntu)"
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
- php{{ php_version }}-xmlrpc
|
- php{{ php_version }}-xmlrpc
|
||||||
state: present
|
state: present
|
||||||
when: is_debuntu | bool
|
when: is_debuntu | bool
|
||||||
#tags: download
|
|
||||||
|
|
||||||
- name: Install php{{ php_version }}-xml (ubuntu or debian 9+)
|
- name: Install php{{ php_version }}-xml (ubuntu or debian 9+)
|
||||||
package:
|
package:
|
||||||
|
@ -44,15 +43,12 @@
|
||||||
- php-xmlrpc
|
- php-xmlrpc
|
||||||
state: present
|
state: present
|
||||||
when: not is_debuntu
|
when: not is_debuntu
|
||||||
#tags: download
|
|
||||||
|
|
||||||
- include_tasks: centos.yml
|
- include_tasks: centos.yml
|
||||||
when: ansible_distribution == "CentOS"
|
when: ansible_distribution == "CentOS"
|
||||||
#tags: download
|
|
||||||
|
|
||||||
- include_tasks: fedora.yml
|
- include_tasks: fedora.yml
|
||||||
when: ansible_distribution == "Fedora"
|
when: ansible_distribution == "Fedora"
|
||||||
#tags: download
|
|
||||||
|
|
||||||
|
|
||||||
# 2019-07-03 @jvonau @holta: the next 50 lines (6 stanzas) double MariaDB's
|
# 2019-07-03 @jvonau @holta: the next 50 lines (6 stanzas) double MariaDB's
|
||||||
|
@ -178,6 +174,7 @@
|
||||||
state: stopped
|
state: stopped
|
||||||
when: not mysql_enabled
|
when: not mysql_enabled
|
||||||
|
|
||||||
|
|
||||||
- name: Add 'mysql' variable values to {{ iiab_ini_file }}
|
- name: Add 'mysql' variable values to {{ iiab_ini_file }}
|
||||||
ini_file:
|
ini_file:
|
||||||
path: "{{ iiab_ini_file }}"
|
path: "{{ iiab_ini_file }}"
|
||||||
|
|
|
@ -41,13 +41,22 @@
|
||||||
# /etc/iiab/local_vars.yml -- then re-run this IIAB installer.
|
# /etc/iiab/local_vars.yml -- then re-run this IIAB installer.
|
||||||
# when: nodejs_version_installed is defined and nodejs_version_installed.stdout != nodejs_version and nodejs_version_installed.stderr == ""
|
# when: nodejs_version_installed is defined and nodejs_version_installed.stdout != nodejs_version and nodejs_version_installed.stderr == ""
|
||||||
|
|
||||||
|
# Forces < 12 or > 12 to be removed, ignored if file is absent
|
||||||
|
- name: Remove /etc/apt/sources.list.d/nodesource.list if nodejs_version_installed.stdout is not {{ nodejs_version }}
|
||||||
|
file:
|
||||||
|
state: absent
|
||||||
|
path: /etc/apt/sources.list.d/nodesource.list
|
||||||
|
when: nodejs_version_installed is defined and nodejs_version_installed.stdout != nodejs_version and nodejs_version_installed.stdout != ""
|
||||||
|
|
||||||
# BRUTAL but ensures consistency across OS's / distros like Raspbian Desktop & Ubermix that often include an older version of Node.js
|
# BRUTAL but ensures consistency across OS's / distros like Raspbian Desktop & Ubermix that often include an older version of Node.js
|
||||||
|
# Forces < 12 or > 12 to be uninstalled
|
||||||
- name: ASK apt/yum/dnf TO REMOVE PRE-EXISTING Node.js {{ nodejs_version_installed.stdout }} (IF IT'S NOT {{ nodejs_version }})
|
- name: ASK apt/yum/dnf TO REMOVE PRE-EXISTING Node.js {{ nodejs_version_installed.stdout }} (IF IT'S NOT {{ nodejs_version }})
|
||||||
package:
|
package:
|
||||||
name: nodejs
|
name: nodejs
|
||||||
state: absent
|
state: absent
|
||||||
when: nodejs_version_installed is defined and nodejs_version_installed.stdout != nodejs_version and nodejs_version_installed.stdout != ""
|
when: nodejs_version_installed is defined and nodejs_version_installed.stdout != nodejs_version and nodejs_version_installed.stdout != ""
|
||||||
|
|
||||||
|
# Forces == 12
|
||||||
- name: Warn if Node.js {{ nodejs_version}} already installed & might be updated
|
- name: Warn if Node.js {{ nodejs_version}} already installed & might be updated
|
||||||
debug:
|
debug:
|
||||||
msg: "WARN: YOUR Node.js {{ nodejs_version }} MIGHT NOW BE UPDATED USING nodesource.com"
|
msg: "WARN: YOUR Node.js {{ nodejs_version }} MIGHT NOW BE UPDATED USING nodesource.com"
|
||||||
|
@ -79,6 +88,7 @@
|
||||||
# 19.04 Beta. Comment it out for now, and manually run: "apt install npm" then
|
# 19.04 Beta. Comment it out for now, and manually run: "apt install npm" then
|
||||||
# "npm install -g npm@latest" (all *SHOULD* be magically fixed by 2019-04-18 ?)
|
# "npm install -g npm@latest" (all *SHOULD* be magically fixed by 2019-04-18 ?)
|
||||||
|
|
||||||
|
# Forces update
|
||||||
- name: Install latest Node.js {{ nodejs_version }} which includes /usr/bin/npm (debuntu)
|
- name: Install latest Node.js {{ nodejs_version }} which includes /usr/bin/npm (debuntu)
|
||||||
package:
|
package:
|
||||||
#name: nodejs={{ nodejs_version }}
|
#name: nodejs={{ nodejs_version }}
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
dependencies:
|
|
||||||
- { role: nodejs, tags: ['nodejs'], when: nodered_install | bool }
|
|
|
@ -1,5 +1,10 @@
|
||||||
# 2019-01-16: @jvonau's PR #1403 moved installation of Node.js (8.x for now) &
|
# 2019-01-16: @jvonau's PR #1403 moved installation of Node.js (8.x for now) &
|
||||||
# npm to roles/nodejs/tasks/main.yml, triggered by roles/nodered/meta/main.yml
|
# npm to roles/nodejs/tasks/main.yml
|
||||||
|
|
||||||
|
- name: NODEJS - run the 'nodejs' role
|
||||||
|
include_role:
|
||||||
|
name: nodejs
|
||||||
|
# 2020-01-04 no longer triggered by roles/nodered/meta/main.yml
|
||||||
|
|
||||||
# BRUTAL but ensures consistency across OS's / distros like Raspbian Desktop &
|
# BRUTAL but ensures consistency across OS's / distros like Raspbian Desktop &
|
||||||
# Ubermix that often include an older version of Node-RED. Brutal, as this
|
# Ubermix that often include an older version of Node-RED. Brutal, as this
|
||||||
|
@ -75,7 +80,7 @@
|
||||||
|
|
||||||
- name: Install /etc/systemd/system/nodered.service systemd unit file from template
|
- name: Install /etc/systemd/system/nodered.service systemd unit file from template
|
||||||
template:
|
template:
|
||||||
backup: yes
|
backup: no
|
||||||
src: nodered.service.j2
|
src: nodered.service.j2
|
||||||
dest: /etc/systemd/system/nodered.service
|
dest: /etc/systemd/system/nodered.service
|
||||||
# mode: '0666'
|
# mode: '0666'
|
||||||
|
|
|
@ -1,9 +1,18 @@
|
||||||
|
- name: "Set PostgreSQL vars 'postgresql_install: True' and 'postgresql_enabled: True'"
|
||||||
|
set_fact:
|
||||||
|
postgresql_install: True
|
||||||
|
postgresql_enabled: True
|
||||||
|
|
||||||
|
- name: POSTGRESQL - run the 'postgresql' role
|
||||||
|
include_role:
|
||||||
|
name: postgresql
|
||||||
|
|
||||||
- name: Remove package Pathagar (in case rpm?)
|
- name: Remove package Pathagar (in case rpm?)
|
||||||
package:
|
package:
|
||||||
name: pathagar
|
name: pathagar
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Install Pathagar prerequisites (all OSs)
|
- name: "Install Pathagar prerequisites: python-virtualenv, python-pip, python-psycopg2"
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -12,7 +21,7 @@
|
||||||
- python-pip
|
- python-pip
|
||||||
- python-psycopg2
|
- python-psycopg2
|
||||||
|
|
||||||
- name: Install Pathagar prerequisites (debuntu)
|
- name: "Install Pathagar prerequisites: libapache2-mod-wsgi, libxml2-dev, libxslt-dev (debuntu)"
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -22,7 +31,7 @@
|
||||||
- libxslt-dev
|
- libxslt-dev
|
||||||
when: is_debuntu | bool
|
when: is_debuntu | bool
|
||||||
|
|
||||||
- name: Install Pathagar prerequisites (not debuntu)
|
- name: "Install Pathagar prerequisites: mod_wsgi, libxml2-devel, libxslt-devel (not debuntu)"
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -32,21 +41,21 @@
|
||||||
- libxslt-devel
|
- libxslt-devel
|
||||||
when: not is_debuntu
|
when: not is_debuntu
|
||||||
|
|
||||||
- name: Create destination folder
|
- name: "Create destination folder: {{ pathagar_src }}"
|
||||||
file:
|
file:
|
||||||
path: "{{ pathagar_src }}"
|
path: "{{ pathagar_src }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: root
|
# owner: root
|
||||||
group: root
|
# group: root
|
||||||
mode: 0755
|
# mode: '0755'
|
||||||
|
|
||||||
- name: Create books destination folder
|
- name: "Create books destination folder: {{ pathagar_media }}"
|
||||||
file:
|
file:
|
||||||
path: "{{ pathagar_media }}"
|
path: "{{ pathagar_media }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ apache_user }}"
|
owner: "{{ apache_user }}"
|
||||||
group: "{{ apache_user }}"
|
group: "{{ apache_user }}"
|
||||||
mode: 0755
|
mode: '0755'
|
||||||
|
|
||||||
- name: Determine if Pathagar has already been downloaded from git
|
- name: Determine if Pathagar has already been downloaded from git
|
||||||
stat:
|
stat:
|
||||||
|
@ -89,10 +98,12 @@
|
||||||
become: yes
|
become: yes
|
||||||
become_user: postgres
|
become_user: postgres
|
||||||
|
|
||||||
- name: Start postgresql-iiab
|
- name: Start 'postgresql-iiab' systemd service
|
||||||
service:
|
systemd:
|
||||||
name: postgresql-iiab
|
name: postgresql-iiab
|
||||||
state: started
|
state: started
|
||||||
|
enabled: yes
|
||||||
|
when: pathagar_enabled
|
||||||
|
|
||||||
- name: Enable Pathagar postgresql user access by md5 method
|
- name: Enable Pathagar postgresql user access by md5 method
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
@ -106,8 +117,8 @@
|
||||||
group: postgres
|
group: postgres
|
||||||
register: enable_pathagar_md5_access
|
register: enable_pathagar_md5_access
|
||||||
|
|
||||||
- name: Reload postgresql service
|
- name: Reload 'postgresql-iiab' systemd service
|
||||||
service:
|
systemd:
|
||||||
name: postgresql-iiab
|
name: postgresql-iiab
|
||||||
state: reloaded
|
state: reloaded
|
||||||
when: enable_pathagar_md5_access.changed
|
when: enable_pathagar_md5_access.changed
|
||||||
|
@ -126,9 +137,9 @@
|
||||||
template:
|
template:
|
||||||
src: prod_settings.py
|
src: prod_settings.py
|
||||||
dest: "{{ pathagar_src }}/prod_settings.py"
|
dest: "{{ pathagar_src }}/prod_settings.py"
|
||||||
owner: root
|
# owner: root
|
||||||
group: root
|
# group: root
|
||||||
mode: 0644
|
# mode: '0644'
|
||||||
|
|
||||||
- name: Create Pathagar initial db
|
- name: Create Pathagar initial db
|
||||||
django_manage:
|
django_manage:
|
||||||
|
@ -143,7 +154,7 @@
|
||||||
dest: "{{ pathagar_dir }}/auth.User.json"
|
dest: "{{ pathagar_dir }}/auth.User.json"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0600
|
mode: '0600'
|
||||||
|
|
||||||
- name: Load Pathagar admin user
|
- name: Load Pathagar admin user
|
||||||
django_manage:
|
django_manage:
|
||||||
|
@ -164,35 +175,44 @@
|
||||||
template:
|
template:
|
||||||
src: wsgi.py
|
src: wsgi.py
|
||||||
dest: "{{ pathagar_dir }}/wsgi.py"
|
dest: "{{ pathagar_dir }}/wsgi.py"
|
||||||
owner: root
|
# owner: root
|
||||||
group: root
|
# group: root
|
||||||
mode: 0644
|
# mode: '0644'
|
||||||
|
|
||||||
- name: Install httpd conf for Pathagar
|
- name: Install /etc/{{ apache_config_dir }}/pathagar.conf from template
|
||||||
template:
|
template:
|
||||||
src: pathagar.conf
|
src: pathagar.conf
|
||||||
backup: yes
|
backup: yes
|
||||||
dest: "/etc/{{ apache_config_dir }}/pathagar.conf"
|
dest: "/etc/{{ apache_config_dir }}/pathagar.conf"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
- name: Enable Pathagar (debuntu)
|
- name: Enable Pathagar via Apache (debuntu)
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/pathagar.conf
|
path: /etc/apache2/sites-enabled/pathagar.conf
|
||||||
src: /etc/apache2/sites-available/pathagar.conf
|
src: /etc/apache2/sites-available/pathagar.conf
|
||||||
state: link
|
state: link
|
||||||
when: pathagar_enabled and is_debuntu
|
when: pathagar_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Disable Pathagar (debuntu)
|
- name: Disable Pathagar via Apache (debuntu)
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/pathagar.conf
|
path: /etc/apache2/sites-enabled/pathagar.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: not pathagar_enabled and is_debuntu
|
when: not pathagar_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Reload Apache ({{ apache_service }})
|
- name: Reload '{{ apache_service }}' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ apache_service }}"
|
name: "{{ apache_service }}"
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
||||||
|
# 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
|
||||||
|
systemd:
|
||||||
|
name: postgresql-iiab
|
||||||
|
state: stopped
|
||||||
|
enabled: no
|
||||||
|
when: not moodle_enabled and not pathagar_enabled
|
||||||
|
|
||||||
|
|
||||||
- name: Add 'pathagar' variable values to {{ iiab_ini_file }}
|
- name: Add 'pathagar' variable values to {{ iiab_ini_file }}
|
||||||
ini_file:
|
ini_file:
|
||||||
path: "{{ iiab_ini_file }}"
|
path: "{{ iiab_ini_file }}"
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
dependencies:
|
|
||||||
- { role: nodejs, tags: ['nodejs'], when: pbx_install and (nodejs_version == "10.x")}
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
- name: NODEJS - run the 'nodejs' role
|
||||||
|
include_role:
|
||||||
|
name: nodejs
|
||||||
|
|
||||||
- name: Fail if nodejs_version is incorrect
|
- name: Fail if nodejs_version is incorrect
|
||||||
fail:
|
fail:
|
||||||
msg: >-
|
msg: >-
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
dependencies:
|
|
||||||
- { role: mongodb, tags: ['generic','mongodb'], when: sugarizer_install | bool }
|
|
||||||
- { role: nodejs, tags: ['nodejs'], when: sugarizer_install | bool }
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# auto starts mongodb via the requires= line in unit file
|
||||||
- name: Enable & Restart 'sugarizer' systemd service
|
- name: Enable & Restart 'sugarizer' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: sugarizer
|
name: sugarizer
|
||||||
|
@ -6,6 +7,7 @@
|
||||||
state: restarted
|
state: restarted
|
||||||
when: sugarizer_enabled | bool
|
when: sugarizer_enabled | bool
|
||||||
|
|
||||||
|
# stops sugarizer but not mongodb
|
||||||
- name: Disable & Stop 'sugarizer' systemd service
|
- name: Disable & Stop 'sugarizer' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: sugarizer
|
name: sugarizer
|
||||||
|
@ -13,6 +15,11 @@
|
||||||
state: stopped
|
state: stopped
|
||||||
when: not sugarizer_enabled
|
when: not sugarizer_enabled
|
||||||
|
|
||||||
|
# stops mongodb would of been called via meta/main.yml prior
|
||||||
|
- name: Run mongodb/tasks/enable.yml to stop MongoDB, if not sugarizer_enabled
|
||||||
|
include_tasks: roles/mongodb/tasks/enable.yml
|
||||||
|
when: not sugarizer_enabled
|
||||||
|
|
||||||
# Apache
|
# Apache
|
||||||
|
|
||||||
- name: Enable http://box/sugarizer & http://box/sugar via Apache
|
- name: Enable http://box/sugarizer & http://box/sugar via Apache
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
- name: MONGODB - run the 'mongodb' role
|
||||||
|
include_role:
|
||||||
|
name: mongodb
|
||||||
|
|
||||||
|
- name: NODEJS - run the 'nodejs' role
|
||||||
|
include_role:
|
||||||
|
name: nodejs
|
||||||
|
|
||||||
- name: FAIL (STOP INSTALLING) IF nodejs_version is not set to 12.x
|
- name: FAIL (STOP INSTALLING) IF nodejs_version is not set to 12.x
|
||||||
fail:
|
fail:
|
||||||
msg: "Sugarizer install cannot proceed, as it currently requires Node.js 12.x, and your nodejs_version is set to {{ nodejs_version }}. Please check the value of nodejs_version in /opt/iiab/iiab/vars/default_vars.yml and possibly also /etc/iiab/local_vars.yml"
|
msg: "Sugarizer install cannot proceed, as it currently requires Node.js 12.x, and your nodejs_version is set to {{ nodejs_version }}. Please check the value of nodejs_version in /opt/iiab/iiab/vars/default_vars.yml and possibly also /etc/iiab/local_vars.yml"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue