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

Merge pull request #78 from iiab/master

sync from iiab/iiab
This commit is contained in:
A Holt 2018-05-03 14:13:14 -04:00 committed by GitHub
commit 717425791d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 76 additions and 41 deletions

View file

@ -3,16 +3,16 @@
# RUNS IF /usr/bin/calibre-uninstall DOES NOT ALEADY EXIST # 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) - name: Install Calibre via calibre-installer.py (redhat, ubuntu, debian if NOT calibre_debs_on_debian)
include_tasks: py-installer.yml 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 #when: not is_rpi
- name: Install Calibre via .debs (Raspbian, Debian if calibre_debs_on_debian) - name: Install Calibre via .debs (Raspbian, Debian if calibre_debs_on_debian)
include_tasks: debs.yml include_tasks: debs.yml
when: is_rpi or (is_debian and calibre_debs_on_debian) when: is_rpi or (is_debian and calibre_debs_on_debian)
- name: Install Calibre via .debs (Ubuntu 18.xx) #- name: Install Calibre via .debs (Ubuntu 18.xx)
include_tasks: debs.yml # include_tasks: debs.yml
when: is_ubuntu_18 # when: is_ubuntu_18
- name: Create calibre-serve.service and calibre.conf - name: Create calibre-serve.service and calibre.conf
template: template:

View file

@ -1,9 +1,9 @@
moodle_version: 31 moodle_version: 35
moodle_repo_url: "https://github.com/moodle/moodle.git" #moodle_repo_url: "https://github.com/moodle/moodle.git"
moodle_repo_url: "git://git.moodle.org/moodle.git"
moodle_base: "{{ iiab_base }}/moodle" moodle_base: "{{ iiab_base }}/moodle"
moodle_user: moodle #moodle_user: moodle
moodle_install: True #moodle_install: True
moodle_enabled: False #moodle_enabled: False
moodle_data: '{{ content_base }}/moodle' moodle_data: '{{ content_base }}/moodle'
moodle_database_name: moodle moodle_database_name: moodle

View file

@ -1,5 +1,4 @@
--- - name: Install Moodle required packages (OS's other than debuntu)
- name: Install Moodle required packages (OS's other than debunt)
package: package:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
@ -44,7 +43,8 @@
dest: "{{ moodle_base }}" dest: "{{ moodle_base }}"
depth: 1 depth: 1
force: yes force: yes
version: "MOODLE_{{ moodle_version }}_STABLE" #version: "MOODLE_{{ moodle_version }}_STABLE"
version: master # TEMPORARY DURING MAY 2018 TESTING
#ignore_errors: yes #ignore_errors: yes
when: internet_available and moodle.stat.exists is defined and not moodle.stat.exists when: internet_available and moodle.stat.exists is defined and not moodle.stat.exists
@ -70,7 +70,7 @@
mode: 0770 mode: 0770
state: directory state: directory
- name: Remove stock Moodle conf - name: Remove stock Moodle config file
file: file:
path: "/etc/{{ apache_config_dir }}/moodle.conf" path: "/etc/{{ apache_config_dir }}/moodle.conf"
state: absent state: absent
@ -106,7 +106,7 @@
postgresql_user: postgresql_user:
name: Admin name: Admin
password: changeme 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 role_attr_flags: NOSUPERUSER,NOCREATEROLE,NOCREATEDB
state: present state: present
become: yes become: yes
@ -114,7 +114,7 @@
- name: Create database - name: Create database
postgresql_db: postgresql_db:
name: moodle name: "{{ moodle_database_name }}"
encoding: utf8 encoding: utf8
owner: Admin owner: Admin
template: template1 template: template1
@ -140,7 +140,7 @@
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
- name: See if the config.php file exists - name: See if config.php exists
stat: stat:
path: "{{ moodle_base }}/config.php" path: "{{ moodle_base }}/config.php"
register: config register: config

View file

@ -1,8 +1,22 @@
#!/bin/bash -x #!/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 }} \ # May 2018: lowercase "--adminuser=admin" is still required for some odd
--dbtype=pgsql --dbname={{ moodle_database_name }} --dbuser=Admin --dbpass=changeme \ # reason, otherwise one cannot login to http://box.lan/moodle (with
--fullname=Your_School --shortname=School \ # 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 \ --adminuser=admin --adminpass=changeme \
--non-interactive --agree-license --non-interactive \
--agree-license \
--allow-unstable # TEMPORARY DURING MAY 2018 TESTING
chown {{ apache_user }}:{{ apache_user }} {{ moodle_base }}/config.php chown {{ apache_user }}:{{ apache_user }} {{ moodle_base }}/config.php

View file

@ -19,8 +19,8 @@ discovered_wired_iface: "none"
discovered_wireless_iface: "none" discovered_wireless_iface: "none"
#Redhat #Redhat
iiab_wired_lan_iface: "none" #iiab_wired_lan_iface: "none"
iiab_wireless_lan_iface: "none" #iiab_wireless_lan_iface: "none"
has_WAN: False has_WAN: False
has_ifcfg_gw: "none" has_ifcfg_gw: "none"
has_wifi_gw: "none" has_wifi_gw: "none"

View file

@ -18,6 +18,12 @@
src: network/bridge-br0 src: network/bridge-br0
mode: 0600 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 - name: Stop wpa_supplicant service
service: service:
name: wpa_supplicant name: wpa_supplicant

View file

@ -23,6 +23,12 @@
state=stopped state=stopped
when: is_debuntu 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 - name: Install systemd unit file to /etc/systemd/system/dhcpd.service
template: src={{ item.src }} template: src={{ item.src }}
dest={{ item.dest }} dest={{ item.dest }}

View file

@ -106,7 +106,7 @@
- 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_ubuntu_18 and network_manager_active
#and not installing #and not installing
tags: tags:
- network - network
@ -127,7 +127,7 @@
- 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 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

View file

@ -3,21 +3,31 @@
template: template:
dest: /etc/systemd/network/IIAB-Bridge.netdev dest: /etc/systemd/network/IIAB-Bridge.netdev
src: network/systemd-br0.j2 src: network/systemd-br0.j2
when: iiab_lan_iface == "br0"
- name: Copy the bridge script - Assigns IP address - name: Copy the bridge script - Assigns IP address
template: template:
dest: /etc/systemd/network/IIAB-Bridge.network dest: /etc/systemd/network/IIAB-Bridge.network
src: network/systemd-br0-network.j2 src: network/systemd-br0-network.j2
when: iiab_lan_iface == "br0"
- name: Copy the bridge script - Assigns br0 wired slaves - name: Copy the bridge script - Assigns br0 wired slaves
template: template:
dest: /etc/systemd/network/IIAB-Slave.network dest: /etc/systemd/network/IIAB-Slave.network
src: network/systemd-br0-slave.j2 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 - name: Stopping services
include_tasks: down-debian.yml 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 - name: Reload systemd
systemd: systemd:
daemon_reload: yes daemon_reload: yes

View file

@ -1,6 +1,7 @@
[Unit] [Unit]
Description=DHCPv4 Server Daemon Description=DHCPv4 Server Daemon
After=network-online.target After=multi-user.target
Requires=multi-user.target
[Service] [Service]
EnvironmentFile=/etc/sysconfig/dhcpd EnvironmentFile=/etc/sysconfig/dhcpd

View file

@ -1,6 +1,6 @@
[Unit] [Unit]
Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
After=rc-local.service After=network-online.target
[Service] [Service]
Type=idle Type=idle

View file

@ -3,13 +3,9 @@
Name=br0 Name=br0
[Network] [Network]
Bridge=br0 Address={{ lan_ip }}/19
LinkLocalAddressing=no LinkLocalAddressing=no
DNS={{ lan_ip }} DNS={{ lan_ip }}
Domains={{ iiab_domain }} Domains={{ iiab_domain }}
[Address]
Address={{ lan_ip }}/19
[Route]
Gateway=""

View file

@ -383,6 +383,7 @@ xovis_chart_heading: "My School: Usage Data Visualization"
# wide to narrow # wide to narrow
is_debuntu: False is_debuntu: False
is_ubuntu: False is_ubuntu: False
is_ubuntu_16: False
is_ubuntu_18: False is_ubuntu_18: False
is_debian: False is_debian: False
is_debian_9: False is_debian_9: False

View file

@ -1,5 +1,6 @@
is_debuntu: True is_debuntu: True
is_ubuntu: True is_ubuntu: True
is_ubuntu_16: True
dns_service: bind9 dns_service: bind9
dns_user: bind dns_user: bind
dhcp_service: isc-dhcp-server dhcp_service: isc-dhcp-server