diff --git a/roles/kolibri/templates/kolibri.service.j2 b/roles/kolibri/templates/kolibri.service.j2 index 376319d11..46df59aca 100644 --- a/roles/kolibri/templates/kolibri.service.j2 +++ b/roles/kolibri/templates/kolibri.service.j2 @@ -10,6 +10,8 @@ Environment=KOLIBRI_HTTP_PORT={{ kolibri_http_port }} Environment=KOLIBRI_URL_PATH_PREFIX={{ kolibri_url }} User={{ kolibri_user }} Group={{ apache_user }} +TimeoutStartSec=infinity +TimeoutStopSec=10 ExecStart={{ kolibri_exec_path }} start ExecStop={{ kolibri_exec_path }} stop diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 7989d0a78..8b9f5d060 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -6,6 +6,15 @@ # ports_externally_visible: 3 # https://github.com/iiab/iiab/wiki/IIAB-Networking#firewall-iptables +# Ethernet - IF NECESSARY, CUSTOMIZE THESE 4+1 VARS IN /etc/iiab/local_vars.yml +# See "How do I set a static IP address?" for Ethernet, in http://FAQ.IIAB.IO +# wan_ip: dhcp # wan_ip: 192.168.1.99 +# wan_netmask: # wan_netmask: 255.255.255.0 +# wan_gateway: # wan_gateway: 192.168.1.254 +# wan_nameserver: # wan_nameserver: 192.168.1.254 +# wan_try_dhcp_before_static_ip: True # Facilitate field updates w/ cablemodems +# Details @ roles/network/templates/network/dhcpcd.conf.j2 for /etc/dhcpcd.conf + # Wi-Fi - IF NECESSARY, CUSTOMIZE THESE 6 VARIABLES IN /etc/iiab/local_vars.yml # host_country_code: US # host_ssid: "Internet in a Box" diff --git a/roles/network/templates/network/dhcpcd.conf.j2 b/roles/network/templates/network/dhcpcd.conf.j2 index 3000a4aad..883218fd1 100644 --- a/roles/network/templates/network/dhcpcd.conf.j2 +++ b/roles/network/templates/network/dhcpcd.conf.j2 @@ -39,16 +39,19 @@ slaac private # IIAB -# always support Ethernet-to-Internet on RPi (avoid "denyinterfaces eth0") +# Always (try) to run DHCP client on RPi's Ethernet port, for in-field +# "cablemodems" used by many non-technical operators, who want Zero-Hassle +# Updates. This means AVOIDING "denyinterfaces eth0" below: {% if is_rpi and hostapd_enabled %} -denyinterfaces {% if discovered_wireless_iface != "none" %} {{ discovered_wireless_iface }} {% endif %} +denyinterfaces{% if discovered_wireless_iface != "none" %} {{ discovered_wireless_iface }}{% endif %} {% elif is_rpi %} -#denyinterfaces {% if discovered_wireless_iface != "none" %} {{ discovered_wireless_iface }} {% endif %} +#denyinterfaces{% if discovered_wireless_iface != "none" %} {{ discovered_wireless_iface }}{% endif %} {% else %} -denyinterfaces {% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }} {% endif %} {% if iiab_wired_lan_iface is defined %} {{ iiab_wired_lan_iface }} {% endif %} +denyinterfaces{% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }}{% endif %}{% if iiab_wired_lan_iface is defined %} {{ iiab_wired_lan_iface }}{% endif %} {% endif %} -{# {% if iiab_lan_iface != "br0" %} {{ iiab_lan_iface }} {% endif %} #} +# FYI this 'denyinterfaces' line (here in /etc/dhcpcd.conf) is commented out by +# /usr/bin/iiab-hotspot-off, and uncommented by /usr/bin/iiab-hotspot-on {% if dhcpcd_result == "enabled" and iiab_lan_iface != "none" %} interface {{ iiab_lan_iface }} @@ -56,10 +59,24 @@ static ip_address={{ lan_ip }}/19 static domain_name_servers=127.0.0.1 {% endif %} -# IIAB static IP configuration: +# IIAB static IP configuration, possibly trying DHCP first {% if wan_ip != "dhcp" %} +{% if wan_try_dhcp_before_static_ip %} +profile static_eth0 +static ip_address={{ wan_ip }}/24 +static routers={{ wan_gateway }} +static domain_name_servers={{ wan_nameserver }} + +# Check for DHCP on the wire first (for occasional field updates of IIAB, e.g. +# Ethernet cable to a "cablemodem") before falling back to the above Static IP +# (e.g. IIAB as 192.168.1.99 in Chiapas, Mexico where schools have typically +# hard-coded their student PC's as 192.168.1.1, 192.168.1.2, 192.168.1.3, etc). +interface {{ iiab_wan_iface }} +fallback static_eth0 +{% else %} interface {{ iiab_wan_iface }} static ip_address={{ wan_ip }}/24 static routers={{ wan_gateway }} static domain_name_servers={{ wan_nameserver }} {% endif %} +{% endif %} diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 8d3400a65..4a11785b7 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -160,10 +160,15 @@ wondershaper_enabled: False # The following 2 override the detection when not "auto" user_wan_iface: auto user_lan_iface: auto -wan_ip: dhcp -wan_netmask: -wan_gateway: -wan_nameserver: + +# Ethernet - IF NECESSARY, CUSTOMIZE THESE 4+1 VARS IN /etc/iiab/local_vars.yml +# See "How do I set a static IP address?" for Ethernet, in http://FAQ.IIAB.IO +wan_ip: dhcp # wan_ip: 192.168.1.99 +wan_netmask: # wan_netmask: 255.255.255.0 +wan_gateway: # wan_gateway: 192.168.1.254 +wan_nameserver: # wan_nameserver: 192.168.1.254 +wan_try_dhcp_before_static_ip: True # Facilitate field updates w/ cablemodems +# Details @ roles/network/templates/network/dhcpcd.conf.j2 for /etc/dhcpcd.conf # Parameters for Aggregate Roles diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index 2b5ce6171..45101b7ed 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -40,6 +40,13 @@ host_channel: 6 hostapd_secure: False hostapd_password: changeme +# See "How do I set a static IP address?" for Ethernet, in http://FAQ.IIAB.IO +wan_ip: dhcp # wan_ip: 192.168.1.99 +wan_netmask: # wan_netmask: 255.255.255.0 +wan_gateway: # wan_gateway: 192.168.1.254 +wan_nameserver: # wan_nameserver: 192.168.1.254 +wan_try_dhcp_before_static_ip: True # Facilitate field updates w/ cablemodems + # Enable "campus access" to ~10 common IIAB services like Kiwix (3000), KA Lite # (8008) and Calibre (8010 or 8080) etc, on the WAN side of your IIAB server. # Only 1 of the 6 lines below should be uncommented: diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index d03e5ce42..c5b5d42c5 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -40,6 +40,13 @@ host_channel: 6 hostapd_secure: False hostapd_password: changeme +# See "How do I set a static IP address?" for Ethernet, in http://FAQ.IIAB.IO +wan_ip: dhcp # wan_ip: 192.168.1.99 +wan_netmask: # wan_netmask: 255.255.255.0 +wan_gateway: # wan_gateway: 192.168.1.254 +wan_nameserver: # wan_nameserver: 192.168.1.254 +wan_try_dhcp_before_static_ip: True # Facilitate field updates w/ cablemodems + # Enable "campus access" to ~10 common IIAB services like Kiwix (3000), KA Lite # (8008) and Calibre (8010 or 8080) etc, on the WAN side of your IIAB server. # Only 1 of the 6 lines below should be uncommented: diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index e93148cd6..d92dab28c 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -40,6 +40,13 @@ host_channel: 6 hostapd_secure: False hostapd_password: changeme +# See "How do I set a static IP address?" for Ethernet, in http://FAQ.IIAB.IO +wan_ip: dhcp # wan_ip: 192.168.1.99 +wan_netmask: # wan_netmask: 255.255.255.0 +wan_gateway: # wan_gateway: 192.168.1.254 +wan_nameserver: # wan_nameserver: 192.168.1.254 +wan_try_dhcp_before_static_ip: True # Facilitate field updates w/ cablemodems + # Enable "campus access" to ~10 common IIAB services like Kiwix (3000), KA Lite # (8008) and Calibre (8010 or 8080) etc, on the WAN side of your IIAB server. # Only 1 of the 6 lines below should be uncommented: