diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index eb771e161..c09aa03ba 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -3,16 +3,16 @@ # RUNS IF /usr/bin/calibre-uninstall DOES NOT ALEADY EXIST - name: Install Calibre via calibre-installer.py (redhat, ubuntu, debian if NOT calibre_debs_on_debian) include_tasks: py-installer.yml - when: is_redhat or (is_ubuntu and not is_ubuntu_18) or (is_debian and not calibre_debs_on_debian) + when: is_redhat or is_ubuntu or (is_debian and not calibre_debs_on_debian) #when: not is_rpi - name: Install Calibre via .debs (Raspbian, Debian if calibre_debs_on_debian) include_tasks: debs.yml when: is_rpi or (is_debian and calibre_debs_on_debian) -- name: Install Calibre via .debs (Ubuntu 18.xx) - include_tasks: debs.yml - when: is_ubuntu_18 +#- name: Install Calibre via .debs (Ubuntu 18.xx) +# include_tasks: debs.yml +# when: is_ubuntu_18 - name: Create calibre-serve.service and calibre.conf template: diff --git a/roles/moodle/defaults/main.yml b/roles/moodle/defaults/main.yml index 3f19aab8d..045496194 100644 --- a/roles/moodle/defaults/main.yml +++ b/roles/moodle/defaults/main.yml @@ -1,9 +1,9 @@ -moodle_version: 31 -moodle_repo_url: "https://github.com/moodle/moodle.git" +moodle_version: 35 +#moodle_repo_url: "https://github.com/moodle/moodle.git" +moodle_repo_url: "git://git.moodle.org/moodle.git" moodle_base: "{{ iiab_base }}/moodle" -moodle_user: moodle -moodle_install: True -moodle_enabled: False +#moodle_user: moodle +#moodle_install: True +#moodle_enabled: False moodle_data: '{{ content_base }}/moodle' moodle_database_name: moodle - diff --git a/roles/moodle/tasks/main.yml b/roles/moodle/tasks/main.yml index 374d9fbd1..8e512abab 100644 --- a/roles/moodle/tasks/main.yml +++ b/roles/moodle/tasks/main.yml @@ -1,5 +1,4 @@ ---- -- name: Install Moodle required packages (OS's other than debunt) +- name: Install Moodle required packages (OS's other than debuntu) package: name: "{{ item }}" state: present @@ -16,10 +15,10 @@ - python-psycopg2 - php{{ php_version }}-pgsql - php{{ php_version }}-curl -# - php{{ php_version }}-zip + #- php{{ php_version }}-zip - php{{ php_version }}-gd -# - php{{ php_version }}-mbstring -# mbstring is now included in php-cli + #- php{{ php_version }}-mbstring + # mbstring is now included in php-cli - php{{ php_version }}-cli when: is_debuntu @@ -44,8 +43,9 @@ dest: "{{ moodle_base }}" depth: 1 force: yes - version: "MOODLE_{{ moodle_version }}_STABLE" -# ignore_errors: yes + #version: "MOODLE_{{ moodle_version }}_STABLE" + version: master # TEMPORARY DURING MAY 2018 TESTING + #ignore_errors: yes when: internet_available and moodle.stat.exists is defined and not moodle.stat.exists - name: Prepare the downloaded directory so Apache can install config file @@ -70,7 +70,7 @@ mode: 0770 state: directory -- name: Remove stock Moodle conf +- name: Remove stock Moodle config file file: path: "/etc/{{ apache_config_dir }}/moodle.conf" state: absent @@ -106,7 +106,7 @@ postgresql_user: name: Admin password: changeme - encrypted: yes # Required by PostgresSQL 10.3+ e.g. on Ubuntu 18.04, see https://github.com/iiab/iiab/issues/759 + encrypted: yes # Required by PostgreSQL 10+ e.g. Ubuntu 18.04's PostgreSQL 10.3+, see https://github.com/iiab/iiab/issues/759 role_attr_flags: NOSUPERUSER,NOCREATEROLE,NOCREATEDB state: present become: yes @@ -114,7 +114,7 @@ - name: Create database postgresql_db: - name: moodle + name: "{{ moodle_database_name }}" encoding: utf8 owner: Admin template: template1 @@ -140,7 +140,7 @@ name: "{{ apache_service }}" state: restarted -- name: See if the config.php file exists +- name: See if config.php exists stat: path: "{{ moodle_base }}/config.php" register: config @@ -150,7 +150,7 @@ when: config.stat.exists is defined and not config.stat.exists - name: Give Apache permission to read config file -# command: chown -R {{ apache_user }} {{ moodle_base }} + #command: chown -R {{ apache_user }} {{ moodle_base }} file: path: "{{ moodle_base }}/config.php" mode: 0644 diff --git a/roles/moodle/templates/moodle_installer b/roles/moodle/templates/moodle_installer index efbeb1859..d28808161 100755 --- a/roles/moodle/templates/moodle_installer +++ b/roles/moodle/templates/moodle_installer @@ -1,8 +1,22 @@ #!/bin/bash -x -sudo -u {{ apache_user }} /usr/bin/php {{ moodle_base }}/admin/cli/install.php \ ---wwwroot=http://{{ iiab_hostname }}.{{ iiab_domain }}/moodle --dataroot={{ moodle_data }} \ ---dbtype=pgsql --dbname={{ moodle_database_name }} --dbuser=Admin --dbpass=changeme \ ---fullname=Your_School --shortname=School \ ---adminuser=admin --adminpass=changeme \ ---non-interactive --agree-license -chown {{ apache_user }}:{{ apache_user }} {{ moodle_base }}/config.php \ No newline at end of file + +# May 2018: lowercase "--adminuser=admin" is still required for some odd +# reason, otherwise one cannot login to http://box.lan/moodle (with +# Admin/changeme). At the same time --dbuser=Admin still begins with +# a capital letter, in keeping with Internet-in-a-Box's other server apps? + +sudo -u {{ apache_user }} \ + /usr/bin/php {{ moodle_base }}/admin/cli/install.php \ + --wwwroot=http://{{ iiab_hostname }}.{{ iiab_domain }}/moodle \ + --dataroot={{ moodle_data }} \ + --dbtype=pgsql \ + --dbname={{ moodle_database_name }} \ + --dbuser=Admin --dbpass=changeme \ + --fullname=Your_School \ + --shortname=School \ + --adminuser=admin --adminpass=changeme \ + --non-interactive \ + --agree-license \ + --allow-unstable # TEMPORARY DURING MAY 2018 TESTING + +chown {{ apache_user }}:{{ apache_user }} {{ moodle_base }}/config.php diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index b4cee63a2..dc7c4bc7f 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -19,8 +19,8 @@ discovered_wired_iface: "none" discovered_wireless_iface: "none" #Redhat -iiab_wired_lan_iface: "none" -iiab_wireless_lan_iface: "none" +#iiab_wired_lan_iface: "none" +#iiab_wireless_lan_iface: "none" has_WAN: False has_ifcfg_gw: "none" has_wifi_gw: "none" diff --git a/roles/network/tasks/NM-debian.yml b/roles/network/tasks/NM-debian.yml index 23ecc9dd2..72f91683d 100644 --- a/roles/network/tasks/NM-debian.yml +++ b/roles/network/tasks/NM-debian.yml @@ -18,6 +18,12 @@ src: network/bridge-br0 mode: 0600 +- name: Remove br0 in Appliance Mode for NetworkManager + file: + dest: /etc/NetworkManager/system-connections/bridge-br0 + state: absent + when: iiab_network_mode == "Appliance" + - name: Stop wpa_supplicant service service: name: wpa_supplicant diff --git a/roles/network/tasks/dhcpd.yml b/roles/network/tasks/dhcpd.yml index 3896c6381..9b8886342 100644 --- a/roles/network/tasks/dhcpd.yml +++ b/roles/network/tasks/dhcpd.yml @@ -23,6 +23,12 @@ state=stopped when: is_debuntu +- name: Disable stock dhcp_service ipv6 + service: name={{ dhcp_service }}6 + enabled=no + state=stopped + when: is_ubuntu_18 + - name: Install systemd unit file to /etc/systemd/system/dhcpd.service template: src={{ item.src }} dest={{ item.dest }} diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index f1adc8d92..6e73f7d4c 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -106,7 +106,7 @@ - name: NetworkManager in use include_tasks: NM-debian.yml - when: is_debuntu and network_manager_active + when: is_ubuntu_18 and network_manager_active #and not installing tags: - network @@ -127,7 +127,7 @@ - name: Not RPi, Not NetworkManager, Not systemd-networkd in use include_tasks: debian.yml - when: not is_rpi and not network_manager_active and not systemd_networkd_active and is_debuntu + when: (not is_rpi and not network_manager_active and not systemd_networkd_active and is_debuntu) or is_ubuntu_16 #and not installing tags: - network diff --git a/roles/network/tasks/sysd-netd-debian.yml b/roles/network/tasks/sysd-netd-debian.yml index 08e09f1bc..68af9fc45 100644 --- a/roles/network/tasks/sysd-netd-debian.yml +++ b/roles/network/tasks/sysd-netd-debian.yml @@ -3,21 +3,31 @@ template: dest: /etc/systemd/network/IIAB-Bridge.netdev src: network/systemd-br0.j2 + when: iiab_lan_iface == "br0" - name: Copy the bridge script - Assigns IP address template: dest: /etc/systemd/network/IIAB-Bridge.network src: network/systemd-br0-network.j2 + when: iiab_lan_iface == "br0" - name: Copy the bridge script - Assigns br0 wired slaves template: dest: /etc/systemd/network/IIAB-Slave.network src: network/systemd-br0-slave.j2 - when: iiab_wired_lan_iface is defined + when: iiab_wired_lan_iface is defined and iiab_lan_iface == "br0" - name: Stopping services include_tasks: down-debian.yml +- name: Disable and mask systemd-networkd-wait-online + systemd: + name: systemd-networkd-wait-online + enabled: no + masked: yes + state: stopped + when: is_ubuntu_18 + - name: Reload systemd systemd: daemon_reload: yes diff --git a/roles/network/templates/dhcp/dhcpd.service b/roles/network/templates/dhcp/dhcpd.service index 5313bfa7e..f09734779 100644 --- a/roles/network/templates/dhcp/dhcpd.service +++ b/roles/network/templates/dhcp/dhcpd.service @@ -1,6 +1,7 @@ [Unit] Description=DHCPv4 Server Daemon -After=network-online.target +After=multi-user.target +Requires=multi-user.target [Service] EnvironmentFile=/etc/sysconfig/dhcpd diff --git a/roles/network/templates/hostapd/hostapd.service.j2 b/roles/network/templates/hostapd/hostapd.service.j2 index 0a7b9c22d..09d3862b0 100644 --- a/roles/network/templates/hostapd/hostapd.service.j2 +++ b/roles/network/templates/hostapd/hostapd.service.j2 @@ -1,6 +1,6 @@ [Unit] Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator -After=rc-local.service +After=network-online.target [Service] Type=idle diff --git a/roles/network/templates/network/systemd-br0-network.j2 b/roles/network/templates/network/systemd-br0-network.j2 index c524a50a7..53e99fdd7 100644 --- a/roles/network/templates/network/systemd-br0-network.j2 +++ b/roles/network/templates/network/systemd-br0-network.j2 @@ -3,13 +3,9 @@ Name=br0 [Network] -Bridge=br0 +Address={{ lan_ip }}/19 LinkLocalAddressing=no DNS={{ lan_ip }} Domains={{ iiab_domain }} -[Address] -Address={{ lan_ip }}/19 -[Route] -Gateway="" diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 1632d1f80..2c6a94a62 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -383,6 +383,7 @@ xovis_chart_heading: "My School: Usage Data Visualization" # wide to narrow is_debuntu: False is_ubuntu: False +is_ubuntu_16: False is_ubuntu_18: False is_debian: False is_debian_9: False diff --git a/vars/ubuntu-16.yml b/vars/ubuntu-16.yml index 013e385a2..741e3b012 100644 --- a/vars/ubuntu-16.yml +++ b/vars/ubuntu-16.yml @@ -1,5 +1,6 @@ is_debuntu: True is_ubuntu: True +is_ubuntu_16: True dns_service: bind9 dns_user: bind dhcp_service: isc-dhcp-server