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

Merge pull request #338 from iiab/master

sync from iiab:master
This commit is contained in:
A Holt 2020-01-13 18:50:24 -05:00 committed by GitHub
commit 24cec0f722
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 209 additions and 230 deletions

View file

@ -21,13 +21,13 @@
copy: copy:
src: "{{ iiab_dir }}/scripts/iiab-diagnostics" src: "{{ iiab_dir }}/scripts/iiab-diagnostics"
dest: /usr/bin/ dest: /usr/bin/
mode: 0755 mode: '0755'
- name: Create globally-writable directory /etc/iiab/diag so non-root users can run iiab-diagnostics - name: Create globally-writable directory /etc/iiab/diag so non-root users can run iiab-diagnostics
file: file:
state: directory state: directory
path: /etc/iiab/diag path: /etc/iiab/diag
mode: 0777 mode: '0777'
- name: Re-read local_facts.facts from /etc/ansible/facts.d - name: Re-read local_facts.facts from /etc/ansible/facts.d
setup: setup:

View file

@ -55,9 +55,9 @@
copy: copy:
src: roles/1-prep/files/iiab.conf src: roles/1-prep/files/iiab.conf
dest: /etc/tmpfiles.d/ dest: /etc/tmpfiles.d/
owner: root # owner: root
group: root # group: root
mode: 0644 # mode: '0644'
force: yes force: yes
when: grep_ubermix.rc == 0 # 1 if absent in file, 2 if file doesn't exist when: grep_ubermix.rc == 0 # 1 if absent in file, 2 if file doesn't exist
#when: ro_dir.stat.exists #when: ro_dir.stat.exists
@ -66,27 +66,26 @@
include_role: include_role:
name: sshd name: sshd
# has no "when: XXXXX_install" flag # has no "when: XXXXX_install" flag
tags: base, sshd #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 #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 #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: #tags: download
- 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
@ -102,7 +101,7 @@
# Curiously this has NOT stopped IIAB 7.0/master from working on Debian 10 # Curiously this has NOT stopped IIAB 7.0/master from working on Debian 10
# pre-releases, during @floydianslips' March 2019 testing anyway! SEE #1387 # pre-releases, during @floydianslips' March 2019 testing anyway! SEE #1387
- name: Disable AppArmor -- override OS default (ubuntu) - name: Disable AppArmor -- override OS default (ubuntu)
service: systemd:
name: apparmor name: apparmor
enabled: False enabled: False
state: stopped state: stopped
@ -141,6 +140,3 @@
template: template:
src: roles/1-prep/templates/iiab.env.j2 src: roles/1-prep/templates/iiab.env.j2
dest: "{{ iiab_env_file }}" dest: "{{ iiab_env_file }}"
owner: root
group: root
mode: 0644

View file

@ -23,57 +23,21 @@
- include_tasks: packages.yml - include_tasks: packages.yml
- include_tasks: iptables.yml - include_tasks: iptables.yml
- sysctl: - name: Use 'sysctl' to set 10 network/kernel settings, turning off IPv6 if possible
name: net.ipv4.ip_forward sysctl:
value: '1' name: "{{ item.name }}"
state: present value: "{{ item.value }}"
with_items:
- sysctl: - { name: 'net.ipv4.ip_forward', value: '1' }
name: net.ipv4.conf.default.rp_filter - { name: 'net.ipv4.conf.default.rp_filter', value: '1' }
value: '1' - { name: 'net.ipv4.conf.default.accept_source_route', value: '0' }
state: present - { name: 'kernel.sysrq', value: '1' }
- { name: 'kernel.core_uses_pid', value: '1' }
- sysctl: - { name: 'net.ipv4.tcp_syncookies', value: '1' }
name: net.ipv4.conf.default.accept_source_route - { name: 'kernel.shmmax', value: '268435456' }
value: '0' - { name: 'net.ipv6.conf.all.disable_ipv6', value: '1' } # IPv6 disabled
state: present - { name: 'net.ipv6.conf.default.disable_ipv6', value: '1' }
- { name: 'net.ipv6.conf.lo.disable_ipv6', value: '1' }
- sysctl:
name: kernel.sysrq
value: '1'
state: present
- sysctl:
name: kernel.core_uses_pid
value: '1'
state: present
- sysctl:
name: net.ipv4.tcp_syncookies
value: '1'
state: present
- sysctl:
name: kernel.shmmax
value: '268435456'
state: present
# IPv6 disabled
- sysctl:
name: net.ipv6.conf.all.disable_ipv6
value: '1'
state: present
- sysctl:
name: net.ipv6.conf.default.disable_ipv6
value: '1'
state: present
- sysctl:
name: net.ipv6.conf.lo.disable_ipv6
value: '1'
state: present
- name: Install /etc/profile.d/zzz_iiab.sh from template, to add sbin dirs to unprivileged users' $PATH - name: Install /etc/profile.d/zzz_iiab.sh from template, to add sbin dirs to unprivileged users' $PATH
template: template:
@ -91,4 +55,3 @@
dest: "{{ iiab_env_file }}" dest: "{{ iiab_env_file }}"
regexp: '^STAGE=*' regexp: '^STAGE=*'
line: 'STAGE=2' line: 'STAGE=2'
state: present

View file

@ -3,30 +3,29 @@
- name: ...IS BEGINNING ===================================== - name: ...IS BEGINNING =====================================
command: echo command: echo
- name: Install NGINX (configured LATER, in Stage 9-LOCAL-ADDONS)
include_tasks: roles/nginx/tasks/install.yml
when: nginx_install | bool
- name: HTTPD (APACHE) - name: HTTPD (APACHE)
include_role: include_role:
name: httpd name: httpd
when: apache_install | bool when: apache_install | bool
tags: base, httpd #tags: base, httpd
- name: MYSQL - name: MYSQL
include_role: include_role:
name: mysql name: mysql
# has no "when: XXXXX_install" flag when: mysql_install | bool
tags: base, mysql #tags: base, mysql
- name: Install nginx
include_tasks: roles/nginx/tasks/install.yml
when: nginx_install | bool
- 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 #tags: base, domain, dnsmasq, network
- name: Recording STAGE 3 HAS COMPLETED ===================== - name: Recording STAGE 3 HAS COMPLETED =====================
lineinfile: lineinfile:
dest: "{{ iiab_env_file }}" dest: "{{ iiab_env_file }}"
regexp: '^STAGE=*' regexp: '^STAGE=*'
line: 'STAGE=3' line: 'STAGE=3'
state: present

View file

@ -8,29 +8,29 @@
- 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 #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 #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 #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 #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 #tags: usb-lib
# NETWORK moved to the very end, after Stage 9 (9-LOCAL-ADDONS) # NETWORK moved to the very end, after Stage 9 (9-LOCAL-ADDONS)
# It can also be run manually using: cd /opt/iiab/iiab; ./iiab-network # It can also be run manually using: cd /opt/iiab/iiab; ./iiab-network
@ -46,25 +46,25 @@
include_role: include_role:
name: homepage name: homepage
# has no "when: XXXXX_install" flag # has no "when: XXXXX_install" flag
tags: base, homepage #tags: base, homepage
- name: POSTGRESQL - name: POSTGRESQL
include_role: include_role:
name: postgresql name: postgresql
when: postgresql_install | bool when: postgresql_install | bool
tags: postgresql, pathagar, moodle #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 #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 #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
@ -75,4 +75,3 @@
dest: "{{ iiab_env_file }}" dest: "{{ iiab_env_file }}"
regexp: '^STAGE=*' regexp: '^STAGE=*'
line: 'STAGE=4' line: 'STAGE=4'
state: present

View file

@ -7,23 +7,22 @@
include_role: include_role:
name: activity-server name: activity-server
when: activity_server_install | bool when: activity_server_install | bool
tags: olpc, activity-server #tags: olpc, activity-server
- 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 | bool
tags: olpc, ejabberd-xs #tags: olpc, ejabberd-xs
- name: IDMGR - name: IDMGR
include_role: include_role:
name: idmgr name: idmgr
when: idmgr_install | bool when: idmgr_install | bool
tags: olpc, idmgr #tags: olpc, idmgr
- name: Recording STAGE 5 HAS COMPLETED ===================== - name: Recording STAGE 5 HAS COMPLETED =====================
lineinfile: lineinfile:
dest: "{{ iiab_env_file }}" dest: "{{ iiab_env_file }}"
regexp: '^STAGE=*' regexp: '^STAGE=*'
line: 'STAGE=5' line: 'STAGE=5'
state: present

View file

@ -6,75 +6,79 @@
- name: AZURACAST - name: AZURACAST
include_role: include_role:
name: azuracast name: azuracast
tags: azuracast when: azuracast_install | bool
#tags: azuracast
# UNMAINTAINED
- name: DOKUWIKI - name: DOKUWIKI
include_role: include_role:
name: dokuwiki name: dokuwiki
tags: dokuwiki when: dokuwiki_install | bool
#tags: dokuwiki
- name: MEDIAWIKI
include_role:
name: mediawiki
tags: mediawiki
# UNMAINTAINED # UNMAINTAINED
- name: EJABBERD - name: EJABBERD
include_role: include_role:
name: ejabberd name: ejabberd
when: ejabberd_install | bool when: ejabberd_install | bool
tags: ejabberd #tags: ejabberd
- name: ELGG - name: ELGG
include_role: include_role:
name: elgg name: elgg
tags: elgg when: elgg_install | bool
#tags: elgg
- name: GITEA - name: GITEA
include_role: include_role:
name: gitea name: gitea
tags: gitea when: gitea_install | bool
#tags: gitea
- name: LOKOLE - name: LOKOLE
include_role: include_role:
name: lokole name: lokole
tags: lokole when: lokole_install | bool
#tags: lokole
- name: MEDIAWIKI
include_role:
name: mediawiki
when: mediawiki_install | bool
#tags: mediawiki
- name: MOSQUITTO - name: MOSQUITTO
include_role: include_role:
name: mosquitto name: mosquitto
tags: mosquitto when: mosquitto_install | bool
#tags: mosquitto
- name: NODE-RED - name: NODE-RED
include_role: include_role:
name: nodered name: nodered
tags: nodered when: nodered_install | bool
#tags: nodered
- name: NEXTCLOUD - name: NEXTCLOUD
include_role: include_role:
name: nextcloud name: nextcloud
tags: nextcloud when: nextcloud_install | bool
#tags: nextcloud
#- name: OWNCLOUD
# include_role:
# name: owncloud
# when: owncloud_install | bool
# tags: owncloud
- name: PBX - name: PBX
include_role: include_role:
name: pbx name: pbx
when: pbx_install | bool when: pbx_install | bool
tags: pbx #tags: pbx
- name: WORDPRESS - name: WORDPRESS
include_role: include_role:
name: wordpress name: wordpress
tags: wordpress when: wordpress_install | bool
#tags: wordpress
- name: Recording STAGE 6 HAS COMPLETED ==================== - name: Recording STAGE 6 HAS COMPLETED ====================
lineinfile: lineinfile:
dest: "{{ iiab_env_file }}" dest: "{{ iiab_env_file }}"
regexp: '^STAGE=*' regexp: '^STAGE=*'
line: 'STAGE=6' line: 'STAGE=6'
state: present

View file

@ -6,50 +6,55 @@
- name: KALITE - name: KALITE
include_role: include_role:
name: kalite name: kalite
tags: kalite when: kalite_install | bool
#tags: kalite
- name: KOLIBRI - name: KOLIBRI
include_role: include_role:
name: kolibri name: kolibri
tags: kolibri when: kolibri_install | bool
#tags: kolibri
- name: KIWIX - name: KIWIX
include_role: include_role:
name: kiwix name: kiwix
tags: kiwix when: kiwix_install | bool
#tags: kiwix
- name: MOODLE - name: MOODLE
include_role: include_role:
name: moodle name: moodle
tags: olpc, moodle 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
tags: osm, maps 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 #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 #tags: pathagar
- name: SUGARIZER - name: SUGARIZER
include_role: include_role:
name: sugarizer name: sugarizer
tags: sugarizer when: sugarizer_install | bool
#tags: sugarizer
- name: Recording STAGE 7 HAS COMPLETED ======================== - name: Recording STAGE 7 HAS COMPLETED ========================
lineinfile: lineinfile:
dest: "{{ iiab_env_file }}" dest: "{{ iiab_env_file }}"
regexp: '^STAGE=*' regexp: '^STAGE=*'
line: 'STAGE=7' line: 'STAGE=7'
state: present

View file

@ -7,39 +7,40 @@
include_role: include_role:
name: transmission name: transmission
when: transmission_install | bool when: transmission_install | bool
tags: transmission #tags: transmission
- name: AWSTATS - name: AWSTATS
include_role: include_role:
name: awstats name: awstats
tags: awstats 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 #tags: monit
- name: MUNIN - name: MUNIN
include_role: include_role:
name: munin name: munin
tags: munin 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 #tags: phpmyadmin
- name: VNSTAT - name: VNSTAT
include_role: include_role:
name: vnstat name: vnstat
when: vnstat_install | bool when: vnstat_install | bool
tags: vnstat #tags: vnstat
- name: Recording STAGE 8 HAS COMPLETED ====================== - name: Recording STAGE 8 HAS COMPLETED ======================
lineinfile: lineinfile:
dest: "{{ iiab_env_file }}" dest: "{{ iiab_env_file }}"
regexp: '^STAGE=*' regexp: '^STAGE=*'
line: 'STAGE=8' line: 'STAGE=8'
state: present

View file

@ -6,55 +6,53 @@
- name: INTERNETARCHIVE - name: INTERNETARCHIVE
include_role: include_role:
name: internetarchive name: internetarchive
tags: internetarchive when: internetarchive_install | bool
#tags: internetarchive
# Until porting complete (@jvonau helping transition to Python 3) # Is porting to Python 3 complete, and if so does this belong elsewhere?
#- name: 'Install Python 2.7 packages: python, python-pip'
# package:
# name:
# - python
# - python-pip # Used by Admin Console
# state: present
# To be ported soon
- name: CAPTIVE PORTAL - name: CAPTIVE PORTAL
include_tasks: roles/captiveportal/tasks/main.yml include_tasks: roles/captiveportal/tasks/main.yml
when: captiveportal_install | bool when: captiveportal_install | bool
tags: base, captiveportal, network, domain #tags: base, captiveportal, network, domain
- name: MINETEST - name: MINETEST
include_role: include_role:
name: minetest name: minetest
tags: minetest when: minetest_install | bool
#tags: minetest
# KEEP AT THE END as this installs dependencies from Debian's 'testing' branch! # KEEP AT THE END as this installs dependencies from Debian's 'testing' branch!
- name: CALIBRE - name: CALIBRE
include_role: include_role:
name: calibre name: calibre
tags: calibre when: calibre_install | bool
#tags: calibre
- name: CALIBRE-WEB - name: CALIBRE-WEB
include_role: include_role:
name: calibre-web name: calibre-web
tags: calibre-web when: calibreweb_install | bool
#tags: calibre-web
# Could split these two below to Stage 10? # Could split these two below to Stage 10?
- name: Configure NGINX - name: Configure NGINX (already installed in Stage 3-BASE-SERVER)
# If just CONFIGURING, should we use one of the following instead ??
# include_tasks: roles/nginx/tasks/setup.yml
# include_tasks: roles/nginx/tasks/enable.yml
include_role: include_role:
name: nginx name: nginx
when: nginx_install | bool when: nginx_install | bool
tags: base, nginx #tags: base, nginx
- name: Configure Apache systemd service ({{ apache_service }}) - name: Configure Apache systemd service ({{ apache_service }})
include_role: include_role:
name: httpd-enable name: httpd-enable
when: apache_install | bool when: apache_install | bool
tags: base, httpd #tags: base, httpd
- name: Recording STAGE 9 HAS COMPLETED ==================== - name: Recording STAGE 9 HAS COMPLETED ====================
lineinfile: lineinfile:
dest: "{{ iiab_env_file }}" dest: "{{ iiab_env_file }}"
regexp: '^STAGE=*' regexp: '^STAGE=*'
line: 'STAGE=9' line: 'STAGE=9'
state: present

View file

@ -1,6 +1,12 @@
# default_language: en # default_language: en
# language_priority: en es fr # language_priority: en es fr
# apache_install: True
# apache_enabled: False
# apache_port: 8090 # NGINX proxies to this IP address, for legacy IIAB services still requiring Apache
# apache_interface: 127.0.0.1
# For schools that use WordPress/Nextcloud/Moodle intensively: iiab/iiab#1147 # For schools that use WordPress/Nextcloud/Moodle intensively: iiab/iiab#1147
# apache_high_php_limits: False # apache_high_php_limits: False
# WARNING: Enabling this might cause excess use of RAM/disk or other resources! # WARNING: Enabling this might cause excess use of RAM/disk or other resources!

View file

@ -26,4 +26,5 @@ mediawiki_install_path: "{{ content_base }}" # /library
mediawiki_abs_path: "{{ mediawiki_install_path }}/mediawiki-{{ mediawiki_version }}" mediawiki_abs_path: "{{ mediawiki_install_path }}/mediawiki-{{ mediawiki_version }}"
mediawiki_url: /wiki mediawiki_url: /wiki
mediawiki_url2: /mediawiki
mediawiki_full_url: "http://{{ iiab_hostname }}.{{ iiab_domain }}{{ mediawiki_url }}" # http://box.lan/wiki mediawiki_full_url: "http://{{ iiab_hostname }}.{{ iiab_domain }}{{ mediawiki_url }}" # http://box.lan/wiki

View file

@ -16,13 +16,13 @@
# NGINX # NGINX
- name: Enable http://box{{ mediawiki_url }} via NGINX, by installing {{ nginx_config_dir }}/mediawiki-nginx.conf from template - name: Enable http://box{{ mediawiki_url }} & http://box{{ mediawiki_url2 }} via NGINX, by installing {{ nginx_config_dir }}/mediawiki-nginx.conf from template
template: template:
src: mediawiki-nginx.conf.j2 src: mediawiki-nginx.conf.j2
dest: "{{ nginx_config_dir }}/mediawiki-nginx.conf" dest: "{{ nginx_config_dir }}/mediawiki-nginx.conf"
when: nginx_install and mediawiki_enabled when: nginx_install and mediawiki_enabled
- name: Disable http://box{{ mediawiki_url }} via NGINX, by removing {{ nginx_config_dir }}/mediawiki-nginx.conf - name: Disable http://box{{ mediawiki_url }} & http://box{{ mediawiki_url2 }} via NGINX, by removing {{ nginx_config_dir }}/mediawiki-nginx.conf
file: file:
path: "{{ nginx_config_dir }}/mediawiki-nginx.conf" path: "{{ nginx_config_dir }}/mediawiki-nginx.conf"
state: absent state: absent

View file

@ -52,3 +52,8 @@ location {{ mediawiki_url }}/ {
location = {{ mediawiki_url }} { location = {{ mediawiki_url }} {
return 301 {{ mediawiki_url }}/Main_Page; return 301 {{ mediawiki_url }}/Main_Page;
} }
# http://box/mediawiki* redirect to http://box/wiki/Main_Page
location {{ mediawiki_url2 }} {
return 301 {{ mediawiki_url }}/Main_Page;
}

View file

@ -1,8 +1,6 @@
- include_tasks: detected_network.yml - include_tasks: detected_network.yml
when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml when: not installing # REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
tags: #tags: network, network-discover # REMOVE SUCH LINES (BELOW TOO) AS WE'RE IN "network" ?
- network #REMOVE SUCH LINES (BELOW TOO) AS WE'RE IN "network" ?
- network-discover
- name: IF WIFI IS PRIMARY GATEWAY, PLEASE RUN 'iiab-hotspot-on' MANUALLY - name: IF WIFI IS PRIMARY GATEWAY, PLEASE RUN 'iiab-hotspot-on' MANUALLY
set_fact: set_fact:
@ -29,14 +27,10 @@
- include_tasks: computed_network.yml - include_tasks: computed_network.yml
when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml
tags: #tags: network, network-discover
- network
- network-discover
- include_tasks: hostapd.yml - include_tasks: hostapd.yml
tags: #tags: network, AP
- network
- AP
#- name: RPi - don't reboot to AP post install - installed via wifi - don't blow away current network #- name: RPi - don't reboot to AP post install - installed via wifi - don't blow away current network
# set_fact: # set_fact:
@ -50,17 +44,12 @@
##### End static ip address info ##### End static ip address info
#- include_tasks: hosts.yml #- include_tasks: hosts.yml
# tags: # tags: network, hostname, domain
# - network
# - hostname
# - domain
- name: Configure wondershaper - name: Configure wondershaper
include_tasks: wondershaper.yml include_tasks: wondershaper.yml
when: wondershaper_install | bool or wondershaper_installed is defined when: wondershaper_install | bool or wondershaper_installed is defined
tags: #tags: network, wondershaper
- network
- wondershaper
- name: (Re)Install named - name: (Re)Install named
include_tasks: named.yml include_tasks: named.yml
@ -76,24 +65,13 @@
#### start services #### start services
- include_tasks: avahi.yml - include_tasks: avahi.yml
tags: #tags: network
- network
- include_tasks: computed_services.yml - include_tasks: computed_services.yml
tags: #tags: network, named, dhcpd, dnsmasq, squid
- network
- named
- dhcpd
- dnsmasq
- squid
- include_tasks: enable_services.yml - include_tasks: enable_services.yml
tags: #tags: network, named, dhcpd, dnsmasq, squid
- network
- named
- dhcpd
- dnsmasq
- squid
#### end services #### end services
#### Start network layout #### Start network layout
@ -101,52 +79,40 @@
include_tasks: ifcfg_mods.yml include_tasks: ifcfg_mods.yml
when: is_redhat | bool when: is_redhat | bool
#and not installing #and not installing
tags: #tags: network
- network
- name: Netplan in use on Ubuntu 18.04+ - name: Netplan in use on Ubuntu 18.04+
include_tasks: netplan.yml include_tasks: netplan.yml
when: is_ubuntu and not is_ubuntu_16 when: is_ubuntu and not is_ubuntu_16
#when: is_ubuntu_18 | bool #when: is_ubuntu_18 | bool
#and not installing #and not installing
tags: #tags: network
- network
- name: NetworkManager in use - name: NetworkManager in use
include_tasks: NM-debian.yml include_tasks: NM-debian.yml
when: is_debuntu and network_manager_active when: is_debuntu and network_manager_active
#and not installing #and not installing
tags: #tags: network
- network
- name: systemd-networkd in use - name: systemd-networkd in use
include_tasks: sysd-netd-debian.yml include_tasks: sysd-netd-debian.yml
when: is_debuntu and systemd_networkd_active when: is_debuntu and systemd_networkd_active
#and not installing #and not installing
tags: #tags: network
- network
- name: RPi's have dhcpcd in use - name: RPi's have dhcpcd in use
include_tasks: rpi_debian.yml include_tasks: rpi_debian.yml
when: is_debuntu and is_rpi when: is_debuntu and is_rpi
#and not installing #and not installing
tags: #tags: network
- network
- name: Not RPi, Not NetworkManager, Not systemd-networkd in use - name: Not RPi, Not NetworkManager, Not systemd-networkd in use
include_tasks: debian.yml include_tasks: debian.yml
when: (not is_rpi and not network_manager_active and not systemd_networkd_active and is_debuntu) or is_ubuntu_16 when: (not is_rpi and not network_manager_active and not systemd_networkd_active and is_debuntu) or is_ubuntu_16
#and not installing #and not installing
tags: #tags: network
- network
#### end network layout #### end network layout
- include_tasks: restart.yml - include_tasks: restart.yml
when: not installing when: not installing
tags: #tags: network, named, dhcpd, dnsmasq, squid, AP
- network
- named
- dhcpd
- dnsmasq
- squid
- AP

View file

@ -1 +1,14 @@
nginx_log_dir: /var/log/nginx # 2019-01-13: IIAB's use of NGINX is still evolving -- please review this
# evolving doc: https://github.com/iiab/iiab/blob/master/roles/nginx/README.md
# nginx_install: True
# nginx_enabled: True
# nginx_port: 80
# nginx_interface: 0.0.0.0
# nginx_config_dir: /etc/nginx/conf.d
# nginx_log_dir: /var/log/nginx
# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!

View file

@ -1,11 +1,16 @@
# TO DO: WRAP 10 OR 11 STANZAS BELOW (and saving vars to iiab_ini_file at
# bottom) INTO install.yml, somehow conditioned by...
# when: openvpn_install | bool
#
# BEWARE: 11th stanza (ssh pubkey deletions) is already conditioned by...
# when: not openvpn_install
- name: Install OpenVPN and Nmap packages - name: Install OpenVPN and Nmap packages
package: package:
name: name:
- openvpn - openvpn
- nmap - nmap
state: present state: present
#tags:
# - download
# Newer versions of NMap do not include NCat, needed to announce /etc/iiab/openvpn_handle # Newer versions of NMap do not include NCat, needed to announce /etc/iiab/openvpn_handle
- name: Install Ncat package (if Debian > 9 or Ubuntu > 18) - name: Install Ncat package (if Debian > 9 or Ubuntu > 18)
@ -13,17 +18,12 @@
name: ncat name: ncat
state: present state: present
when: is_debuntu and not (is_debian_8 or is_debian_9 or is_ubuntu_16 or is_ubuntu_17 or is_ubuntu_18) when: is_debuntu and not (is_debian_8 or is_debian_9 or is_ubuntu_16 or is_ubuntu_17 or is_ubuntu_18)
#when: need_ncat | bool
#tags:
# - download
- name: Install ssh public keys for remote support (if openvpn_install) - name: Install ssh public keys for remote support (if openvpn_install)
lineinfile: lineinfile:
line: "{{ item.pubkey }}" line: "{{ item.pubkey }}"
regexp: "{{ item.regexp }}" regexp: "{{ item.regexp }}"
path: /root/.ssh/authorized_keys path: /root/.ssh/authorized_keys
#backup: yes
when: openvpn_install | bool
with_items: with_items:
- regexp: "LvCSAAcfYIdZPR4ePVpVUZ/IbkGjpQSoRMa5HuVjMO3cZNR27ptqjNjq2husJOyhMFCOBTzo4thioGyTpBr4u3s=$" # Tim Moody - regexp: "LvCSAAcfYIdZPR4ePVpVUZ/IbkGjpQSoRMa5HuVjMO3cZNR27ptqjNjq2husJOyhMFCOBTzo4thioGyTpBr4u3s=$" # Tim Moody
pubkey: "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAhlQIh8ZPx4awdM0O6QNcPbx3qIZ39FHjF2YJ2SX3z7iLnYiz03Ek6Bux9P4HvaVAqlApiz2I68Vq8TfU2s/+LvCSAAcfYIdZPR4ePVpVUZ/IbkGjpQSoRMa5HuVjMO3cZNR27ptqjNjq2husJOyhMFCOBTzo4thioGyTpBr4u3s=" pubkey: "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAhlQIh8ZPx4awdM0O6QNcPbx3qIZ39FHjF2YJ2SX3z7iLnYiz03Ek6Bux9P4HvaVAqlApiz2I68Vq8TfU2s/+LvCSAAcfYIdZPR4ePVpVUZ/IbkGjpQSoRMa5HuVjMO3cZNR27ptqjNjq2husJOyhMFCOBTzo4thioGyTpBr4u3s="
@ -46,20 +46,16 @@
regexp: "{{ item }}" regexp: "{{ item }}"
path: /root/.ssh/authorized_keys path: /root/.ssh/authorized_keys
state: absent state: absent
#backup: yes
when: not openvpn_install
with_items: with_items:
- "LvCSAAcfYIdZPR4ePVpVUZ/IbkGjpQSoRMa5HuVjMO3cZNR27ptqjNjq2husJOyhMFCOBTzo4thioGyTpBr4u3s=$" - "LvCSAAcfYIdZPR4ePVpVUZ/IbkGjpQSoRMa5HuVjMO3cZNR27ptqjNjq2husJOyhMFCOBTzo4thioGyTpBr4u3s=$"
- "tUM4hl009fbXY4Yy3bAadWL1CquVrZmKfBBWhyhz8zLD6TQ== ghunt@ip-192-168-123-123.ec2.internal$" - "tUM4hl009fbXY4Yy3bAadWL1CquVrZmKfBBWhyhz8zLD6TQ== ghunt@ip-192-168-123-123.ec2.internal$"
- "heOMXXNU6skxdPh2fcHh0bzQcaCSQ== holt@crank$" - "heOMXXNU6skxdPh2fcHh0bzQcaCSQ== holt@crank$"
when: not openvpn_install
- name: 'Create dirs: /etc/openvpn/keys, /etc/openvpn/scripts' - name: 'Create dirs: /etc/openvpn/keys, /etc/openvpn/scripts'
file: file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
owner: root
group: root
mode: 0755
with_items: with_items:
- /etc/openvpn/keys - /etc/openvpn/keys
- /etc/openvpn/scripts - /etc/openvpn/scripts
@ -68,8 +64,6 @@
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: root
group: root
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
backup: yes backup: yes
with_items: with_items:
@ -83,14 +77,12 @@
- { src: 'openvpn_handle.j2', dest: '/etc/iiab/openvpn_handle', mode: '0644' } - { src: 'openvpn_handle.j2', dest: '/etc/iiab/openvpn_handle', mode: '0644' }
- { src: 'iiab-remote-on.j2', dest: '/usr/bin/iiab-remote-on', mode: '0755' } - { src: 'iiab-remote-on.j2', dest: '/usr/bin/iiab-remote-on', mode: '0755' }
- { src: 'iiab-remote-off', dest: '/usr/bin/iiab-remote-off', mode: '0755' } - { src: 'iiab-remote-off', dest: '/usr/bin/iiab-remote-off', mode: '0755' }
# 2019-10-09: Not recommended for over a year & no longer in use
# - { src: 'iiab-handle.j2', dest: '/usr/bin/iiab-handle', mode: '0755' }
- name: Copy /opt/iiab/iiab/iiab-support to /usr/bin/iiab-support, in case git tree deleted e.g. on a smaller IIAB install - name: Copy /opt/iiab/iiab/iiab-support to /usr/bin/iiab-support, in case git tree deleted e.g. on a smaller IIAB install
copy: copy:
src: "{{ iiab_dir }}/iiab-support" src: "{{ iiab_dir }}/iiab-support"
dest: /usr/bin/ dest: /usr/bin/
mode: 0755 mode: '0755'
- name: Create iiab-support-on (symlink to iiab-support for now) - name: Create iiab-support-on (symlink to iiab-support for now)
file: file:
@ -116,6 +108,7 @@
path: /usr/bin/iiab-vpn-off path: /usr/bin/iiab-vpn-off
state: link state: link
# TO DO: WRAP COMMENTS + 4 ACTIVE STANZAS BELOW INTO enable.yml...
# FIXED SOMETIME PRIOR TO AUGUST 2018: earlier versions of Ansible had not # FIXED SOMETIME PRIOR TO AUGUST 2018: earlier versions of Ansible had not
# been working with systemd service names that contained the "@" character. # been working with systemd service names that contained the "@" character.
@ -198,7 +191,6 @@
# ignore_errors: True # ignore_errors: True
# when: not openvpn_enabled and not installing # when: not openvpn_enabled and not installing
- name: Add 'openvpn' variable values to {{ iiab_ini_file }} - name: Add 'openvpn' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
path: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"

View file

@ -225,27 +225,27 @@ exFAT_enabled: True
# 3-BASE-SERVER # 3-BASE-SERVER
# Variables for Administrative Console
# 2020-01-13: Both vars unused
admin_console_install: True admin_console_install: True
admin_console_enabled: True admin_console_enabled: True
# variables related to introduction of nginx # 2019-01-13: IIAB's use of NGINX is still evolving -- please review this
# apache # evolving doc: https://github.com/iiab/iiab/blob/master/roles/nginx/README.md
apache_install: True
apache_enabled: False
apache_port: "8090"
apache_interface: "127.0.0.1"
# The following variable, if True, allows Admin Console to poweroff IIAB
# see below
#allow_apache_sudo: False
nginx_port: "80"
nginx_interface: "0.0.0.0"
nginx_install: True nginx_install: True
nginx_enabled: True nginx_enabled: True
nginx_port: 80
nginx_interface: 0.0.0.0
nginx_config_dir: /etc/nginx/conf.d nginx_config_dir: /etc/nginx/conf.d
nginx_log_dir: /var/log/nginx
# See also Apache vars {default_language, language_priority} @ top of this file # See also Apache vars {default_language, language_priority} @ top of this file
apache_install: True
apache_enabled: False
#
# NGINX proxies to Apache for legacy IIAB services, using:
apache_port: 8090
apache_interface: 127.0.0.1 # 2020-01-13: Var unused
# #
# For schools that use WordPress/Nextcloud/Moodle intensively: iiab/iiab#1147 # For schools that use WordPress/Nextcloud/Moodle intensively: iiab/iiab#1147
apache_high_php_limits: False apache_high_php_limits: False
@ -657,6 +657,7 @@ calibreweb_home: "{{ content_base }}/calibre-web" # /library/calibre-web
is_debuntu: False # Covers all 3: Ubuntu, Debian, Raspbian is_debuntu: False # Covers all 3: Ubuntu, Debian, Raspbian
is_ubuntu: False is_ubuntu: False
is_ubuntu_20: False
is_ubuntu_19: False is_ubuntu_19: False
is_ubuntu_18: False is_ubuntu_18: False
is_ubuntu_17: False is_ubuntu_17: False

31
vars/ubuntu-20.yml Normal file
View file

@ -0,0 +1,31 @@
is_debuntu: True
is_ubuntu: True
is_ubuntu_20: True
# 2019-03-23: These apply if-only-if named_install and/or dhcpd_install are True
# (This is quite rare now that vars/default_vars.yml sets dnsmasq_install: True)
dns_service: bind9
dns_user: bind
dhcp_service: isc-dhcp-server
proxy: squid
proxy_user: proxy
apache_service: apache2
apache_user: www-data
apache_config_dir: apache2/sites-available
apache_log_dir: /var/log/apache2
smb_service: smbd
nmb_service: nmbd
systemctl_program: /bin/systemctl
# issue raised
mysql_service: mariadb
apache_log: /var/log/apache2/access.log
sshd_package: openssh-server
sshd_service: ssh
php_version: 7.3 # 7.4 might be nec for Ubuntu 20.04 later?
# "postgresql_version: 11.2" failed (too detailed for /etc/systemd/system/postgresql-iiab.service on Ubuntu 19.04)
postgresql_version: 12
systemd_location: /lib/systemd/system
# Upgrade Ubuntu 20.04's Calibre 4.x to very latest...for now?
calibre_via_debs: False
calibre_via_python: True