1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00
* change apache_data to apache_user in all

* no libapach2 in centos. just php. no php-magick in centos

* remove redundant vars entries

* do not create apache user

* missed one pound sign

* soft code all references to apache_user

* centos requires older setuptools

* revert ansible_lsb.id in xsce.yml

* try getting recent pip

* move pip download to 2prep so that kalite success is not dependent on iiab coming first

* still need to replace setuptools in kalite

* add curl -- needed in debian

* massivly substitue iiab for xsce, and rename files

* completed runansible

* centos fixes,install  pip

* appliance means no iptables rules

* change to earlier version of setuptools for centos

* delete file duplicate, hopefully unnecessary. generate the offline docs

* wiki docs errors

* create the admin group -- deleted earlier

* use the --yes option with pip uninstall

* base of repo moved from schoolserver to iiab, unleashkids.org->iiab.io

* network detection broken due to tupo
This commit is contained in:
georgejhunt 2017-06-09 16:25:56 -07:00 committed by GitHub
parent 6ef68cc480
commit f319afa432
179 changed files with 978 additions and 672 deletions

View file

@ -11,9 +11,9 @@ host_channel: 6
host_wireless_n: False
host_country_code: US
hostapd_secure: True
hostapd_password: "xsce2017"
hostapd_password: "iiab2017"
driver_name: nl80211
network_config_dir: /etc/network/interfaces.d
xsce_network_mode: "Gateway"
iiab_network_mode: "Gateway"
dns_jail_enabled: False
services_externally_visible: False

View file

@ -17,12 +17,12 @@
- name: Use restricted network features
set_fact:
xsce_demo_mode: True
iiab_demo_mode: True
when: teamviewer_install and not strict_networking
- name: XO wants usb wifi interface as AP mode
set_fact:
xsce_wireless_lan_iface: "{{ discovered_lan_iface }}"
iiab_wireless_lan_iface: "{{ discovered_lan_iface }}"
when: num_wifi_interfaces >= "2" and xo_model != "none" and discovered_wan_iface != "none" and discovered_wireless_iface == "eth0"
# static backout suppy new template file
@ -57,10 +57,10 @@
# when: gui_wan_iface != "unset" and gui_desired_network_role is defined and gui_desired_network_role != "LanController"
# should make the GUI buttons the last call
- name: Checking xsce_wan_enabled
- name: Checking iiab_wan_enabled
set_fact:
user_wan_iface: "none"
when: 'not xsce_wan_enabled'
when: 'not iiab_wan_enabled'
# gui wants LanController # keeps ifcfg-WAN but onboot=no
# the change over might be a little bumpy ATM.
@ -68,11 +68,11 @@
set_fact:
device_gw: "none"
user_wan_iface: "none"
xsce_gateway_enabled: "False"
iiab_gateway_enabled: "False"
when: gui_desired_network_role is defined and gui_desired_network_role == "LanController"
# device_gw is used with the LAN detection and LAN's ifcfg file deletion.
# single interface vars/ users would need to set xsce_wan_enabled False as above, to disable the WAN
# single interface vars/ users would need to set iiab_wan_enabled False as above, to disable the WAN
# and set user_lan_iface = <device> to suppress the auto detection for the same effect.
- name: Setting user_lan_iface for LanController for single interface
@ -83,28 +83,28 @@
# override with user_wan_iface setting if no longer in auto
- name: setting user WAN fact
set_fact:
xsce_wan_iface: "{{ user_wan_iface }}"
iiab_wan_iface: "{{ user_wan_iface }}"
when: user_wan_iface != "auto"
# user disabled interface - overriding all other entries
- name: Checking xsce_lan_enabled
- name: Checking iiab_lan_enabled
set_fact:
user_lan_iface: "none"
when: 'not xsce_lan_enabled'
when: 'not iiab_lan_enabled'
# gui wants Appliance Note: could of used xsce_lan_enabled false
# gui wants Appliance Note: could of used iiab_lan_enabled false
- name: Setting GUI wants Appliance
set_fact:
user_lan_iface: "none"
xsce_gateway_enabled: "False"
iiab_gateway_enabled: "False"
when: gui_desired_network_role is defined and gui_desired_network_role == "Appliance"
# gui wants Gateway
- name: Setting GUI wants and has active Gateway
set_fact:
user_lan_iface: "auto"
user_wan_iface: "{{ xsce_wan_iface }}"
when: gui_desired_network_role is defined and gui_desired_network_role == "Gateway" and xsce_wan_iface != "none"
user_wan_iface: "{{ iiab_wan_iface }}"
when: gui_desired_network_role is defined and gui_desired_network_role == "Gateway" and iiab_wan_iface != "none"
# make it so number 2 vars should use user_wan_iface but we can cover a single
# wired if dhcp fails the interface should revert to LAN, static address should
@ -116,23 +116,23 @@
- name: No LAN configured - Appliance mode
set_fact:
xsce_network_mode: "Appliance"
when: xsce_lan_iface == "none"
iiab_network_mode: "Appliance"
when: iiab_lan_iface == "none"
- name: LAN configured - LanController mode
set_fact:
xsce_network_mode: "LanController"
when: xsce_lan_iface != "" and xsce_wan_iface == "none"
iiab_network_mode: "LanController"
when: iiab_lan_iface != "" and iiab_wan_iface == "none"
- name: LAN configured - Gateway mode
set_fact:
xsce_network_mode: "Gateway"
when: xsce_lan_iface != "none" and xsce_wan_iface != "none"
iiab_network_mode: "Gateway"
when: iiab_lan_iface != "none" and iiab_wan_iface != "none"
# override with user_lan_iface setting if no longer in auto
- name: Setting user LAN fact
set_fact:
xsce_lan_iface: "{{ user_lan_iface }}"
iiab_lan_iface: "{{ user_lan_iface }}"
when: 'user_lan_iface != "auto"'
# so this works
@ -143,36 +143,36 @@
# well if there ever was a point to tell the user thing are FUBAR this is it.
- name: We're hosed no work interfaces
set_fact:
xsce_network_mode: "No_network_found"
iiab_network_mode: "No_network_found"
when: adapter_count.stdout|int == "0"
# well if there ever was a point to tell the user thing are FUBAR this is it.
- name: I'm not guessing declare gateway please
set_fact:
xsce_network_mode: "Undetectable_use_local_vars"
xsce_wan_iface: "none"
iiab_network_mode: "Undetectable_use_local_vars"
iiab_wan_iface: "none"
when: adapter_count.stdout|int >= "5" and device_gw == "none" and gui_wan_iface == "unset" and gui_static_wan is defined
- name: Add location section to config file
ini_file: dest='{{ xsce_config_file }}'
ini_file: dest='{{ iiab_config_file }}'
section=network
option='{{ item.option }}'
value='{{ item.value }}'
with_items:
- option: 'xsce_wan_enabled'
value: '{{ xsce_wan_enabled }}'
- option: 'iiab_wan_enabled'
value: '{{ iiab_wan_enabled }}'
- option: 'user_wan_iface'
value: '{{ user_wan_iface }}'
- option: 'xsce_wan_iface'
value: '{{ xsce_wan_iface }}'
- option: 'xsce_lan_enabled'
value: '{{ xsce_lan_enabled }}'
- option: 'iiab_wan_iface'
value: '{{ iiab_wan_iface }}'
- option: 'iiab_lan_enabled'
value: '{{ iiab_lan_enabled }}'
- option: 'user_lan_iface'
value: '{{ user_lan_iface }}'
- option: 'xsce_lan_iface'
value: '{{ xsce_lan_iface }}'
- option: 'xsce_network_mode'
value: '{{ xsce_network_mode }}'
- option: 'iiab_lan_iface'
value: '{{ iiab_lan_iface }}'
- option: 'iiab_network_mode'
value: '{{ iiab_network_mode }}'
- option: 'hostapd_enabled'
value: '{{ hostapd_enabled }}'
- option: 'host_ssid'

View file

@ -5,8 +5,8 @@
named_enabled: True
dhcpd_enabled: False
wondershaper_enabled: False
xsce_network_mode: "Appliance"
when: xsce_lan_iface == "none" or user_lan_iface == "none"
iiab_network_mode: "Appliance"
when: iiab_lan_iface == "none" or user_lan_iface == "none"
- name: LAN configured - LanController mode
set_fact:
@ -15,21 +15,21 @@
dansguardian_enabled: False
squid_enabled: False
wondershaper_enabled: False
xsce_network_mode: "LanController"
when: xsce_lan_iface != "" and xsce_wan_iface == "none"
iiab_network_mode: "LanController"
when: iiab_lan_iface != "" and iiab_wan_iface == "none"
- name: LAN configured - Gateway mode
set_fact:
named_enabled: True
dhcpd_enabled: True
xsce_network_mode: "Gateway"
when: 'xsce_lan_iface != "none" and xsce_wan_iface != "none"'
iiab_network_mode: "Gateway"
when: 'iiab_lan_iface != "none" and iiab_wan_iface != "none"'
- name: Add location section to config file
ini_file: dest='{{ xsce_config_file }}'
ini_file: dest='{{ iiab_config_file }}'
section=network
option='{{ item.option }}'
value='{{ item.value }}'
with_items:
- option: 'xsce_network_mode_applied'
value: '{{ xsce_network_mode }}'
- option: 'iiab_network_mode_applied'
value: '{{ iiab_network_mode }}'

View file

@ -9,9 +9,9 @@
- name: Supply ifcfg-WAN file
template: src=network/ifcfg-WAN.j2
dest=/etc/sysconfig/network-scripts/ifcfg-WAN
when: xsce_wan_iface != "none" and not has_WAN and has_ifcfg_gw == "none"
when: iiab_wan_iface != "none" and not has_WAN and has_ifcfg_gw == "none"
- name: Now setting ifcfg-WAN True after creating file
set_fact:
has_WAN: True
when: xsce_wan_iface != "none" and has_ifcfg_gw == "none"
when: iiab_wan_iface != "none" and has_ifcfg_gw == "none"

View file

@ -73,7 +73,7 @@
#allocate eth0 under br0 if appliance, alone if gateway
- name: Add location section to config file
ini_file: dest='{{ xsce_config_file }}'
ini_file: dest='{{ iiab_config_file }}'
section=network
option='{{ item.option }}'
value='{{ item.value }}'
@ -96,8 +96,8 @@
value: '{{ num_wifi_interfaces }}'
- option: 'discovered_wireless_iface'
value: '{{ discovered_wireless_iface }}'
- option: 'xsce_wireless_lan_iface'
value: '{{ xsce_wireless_lan_iface }}'
- option: 'iiab_wireless_lan_iface'
value: '{{ iiab_wireless_lan_iface }}'
- option: 'num_lan_interfaces'
value: '{{ num_lan_interfaces }}'
- option: 'detected_lan'

View file

@ -1,4 +1,4 @@
- debug: var=has_ifcfg_gw
- debug: var=xsce_wan_iface
- debug: var=xsce_lan_iface
- debug: var=xsce_network_mode
- debug: var=iiab_wan_iface
- debug: var=iiab_lan_iface
- debug: var=iiab_network_mode

View file

@ -20,7 +20,7 @@
lineinfile: state=present
backrefs=yes
regexp='^NAME'
line='NAME="xsce-WAN"'
line='NAME="iiab-WAN"'
dest={{ has_ifcfg_gw }}
when: has_wifi_gw == "none"
@ -30,9 +30,9 @@
lineinfile: state=present
backrefs=yes
regexp='^DEVICE'
line='DEVICE="{{ xsce_wan_iface }}"'
line='DEVICE="{{ iiab_wan_iface }}"'
dest={{ has_ifcfg_gw }}
when: xsce_wan_iface != "none" and has_wifi_gw == "none"
when: iiab_wan_iface != "none" and has_wifi_gw == "none"
- name: add marker
lineinfile: state=present

View file

@ -4,24 +4,24 @@
regexp='^ONBOOT'
line='ONBOOT="no"'
dest=/etc/sysconfig/network-scripts/ifcfg-WAN
when: has_WAN and xsce_wan_iface == "none"
when: has_WAN and iiab_wan_iface == "none"
#testpoint Need to ensure we have only one entry
- name: Ensure macaddress is correct
lineinfile: state=present
backrefs=yes
regexp='^HWADDR'
line='HWADDR="{{ hostvars[inventory_hostname]['ansible_' + xsce_wan_iface]['macaddress'] }}"'
line='HWADDR="{{ hostvars[inventory_hostname]['ansible_' + iiab_wan_iface]['macaddress'] }}"'
dest=/etc/sysconfig/network-scripts/ifcfg-WAN
when: has_WAN and xsce_wan_iface != "none"
when: has_WAN and iiab_wan_iface != "none"
- name: Fix the DEVICE
lineinfile: state=present
backrefs=yes
regexp='^NAME'
line='NAME="xsce-WAN"'
line='NAME="iiab-WAN"'
dest=/etc/sysconfig/network-scripts/ifcfg-WAN
when: has_WAN and xsce_wan_iface != "none"
when: has_WAN and iiab_wan_iface != "none"
- name: Turn on ONBOOT for WAN on reboot if enabled
lineinfile: state=present
@ -29,4 +29,4 @@
regexp="^ONBOOT"
line="ONBOOT=yes"
dest=/etc/sysconfig/network-scripts/ifcfg-WAN
when: has_WAN and xsce_wan_iface != "none"
when: has_WAN and iiab_wan_iface != "none"

View file

@ -4,13 +4,13 @@
owner=root
group=root
mode=0644
when: xsce_wireless_lan_iface != "none"
when: iiab_wireless_lan_iface != "none"
- name: Disable the Access Point Hostapd program
service: enabled=no
name=hostapd.service
state=stopped
when: xsce_wireless_lan_iface == "none" or xsce_network_mode == "Appliance" or not hostapd_enabled
when: iiab_wireless_lan_iface == "none" or iiab_network_mode == "Appliance" or not hostapd_enabled
- name: Use custom systemd unit file to start hostapd
template: src=hostapd/hostapd.service.j2
@ -26,19 +26,19 @@
service: enabled=yes
name=hostapd.service
state=restarted
when: xsce_wireless_lan_iface != "none" and xsce_network_mode != "Appliance" and hostapd_enabled
when: iiab_wireless_lan_iface != "none" and iiab_network_mode != "Appliance" and hostapd_enabled
- name: Checking if slave is active waiting 10 seconds
shell: "sleep {{ hostapd_wait }} | brctl show | grep {{ xsce_wireless_lan_iface }}"
shell: "sleep {{ hostapd_wait }} | brctl show | grep {{ iiab_wireless_lan_iface }}"
ignore_errors: True
changed_when: False
register: wifi_slave
when: xsce_lan_iface == "br0" and xsce_wireless_lan_iface != "none"
when: iiab_lan_iface == "br0" and iiab_wireless_lan_iface != "none"
- name: Restart hostapd if slave is inactive
service: name=hostapd.service
state=restarted
when: is_debuntu and xsce_lan_iface == "br0" and item|trim == ""
when: is_debuntu and iiab_lan_iface == "br0" and item|trim == ""
with_items:
- "{{ wifi_slave.stdout }}"
ignore_errors: true

View file

@ -2,7 +2,7 @@
- name: Configure short hostname in /etc/hosts
lineinfile: dest=/etc/hosts
regexp='^127\.0\.0\.1'
line='127.0.0.1 localhost.localdomain localhost {{ xsce_hostname }}'
line='127.0.0.1 localhost.localdomain localhost {{ iiab_hostname }}'
owner=root
group=root
mode=0644
@ -11,21 +11,21 @@
lineinfile: dest=/etc/hosts
regexp='^172\.18\.96\.1'
state=absent
when: xsce_lan_iface == "none" and not installing
when: iiab_lan_iface == "none" and not installing
- name: Configure fqdn in /etc/hosts with LAN
lineinfile: dest=/etc/hosts
regexp='^172\.18\.96\.1'
line='172.18.96.1 {{ xsce_hostname }}.{{ xsce_domain }} {{ xsce_hostname }}'
line='172.18.96.1 {{ iiab_hostname }}.{{ iiab_domain }} {{ iiab_hostname }}'
state=present
when: xsce_lan_iface != "none" and not installing
when: iiab_lan_iface != "none" and not installing
- name: Configure fqdn in /etc/hosts appliance mode
lineinfile: dest=/etc/hosts
regexp='^127\.0\.0\.1'
line='127.0.0.1 localhost.localdomain localhost {{ xsce_hostname }}.{{ xsce_domain }} {{ xsce_hostname }}'
line='127.0.0.1 localhost.localdomain localhost {{ iiab_hostname }}.{{ iiab_domain }} {{ iiab_hostname }}'
owner=root
group=root
mode=0644
when: xsce_lan_iface == "none" and not installing
when: iiab_lan_iface == "none" and not installing

View file

@ -1,34 +1,34 @@
- name: Stop the Access Point Hostapd program
service: name=hostapd.service
state=stopped
when: xsce_wireless_lan_iface != "none"
when: iiab_wireless_lan_iface != "none"
# might need an exclude for F18 here
- name: Now disconnect bridge slaves
shell: nmcli c delete id "System {{ item|trim }}"
ignore_errors: True
when: item|trim != xsce_wireless_lan_iface
when: item|trim != iiab_wireless_lan_iface
with_items:
- "{{ ifcfg_slaves.stdout_lines }}"
# clear all bridge ifcfg files
- name: Now delete slave bridge ifcfg files
shell: rm -f /etc/sysconfig/network-scripts/ifcfg-"{{ item }}"
when: num_lan_interfaces != "0" or xsce_wireless_lan_iface != "none"
when: num_lan_interfaces != "0" or iiab_wireless_lan_iface != "none"
with_items:
- "{{ ifcfg_slaves.stdout_lines }}"
- name: Now delete original ifcfg files
shell: rm -f /etc/sysconfig/network-scripts/ifcfg-"{{ item }}"
when: num_lan_interfaces == "1" and xsce_lan_iface != "br0"
when: num_lan_interfaces == "1" and iiab_lan_iface != "br0"
with_items:
- "{{ discovered_lan_iface }}"
- name: Stop the LAN/Bridge deleting xsce-LAN
shell: nmcli con delete id xsce-LAN
- name: Stop the LAN/Bridge deleting iiab-LAN
shell: nmcli con delete id iiab-LAN
ignore_errors: True
changed_when: False
when: xsce_prepped and (num_lan_interfaces != "0" or xsce_wireless_lan_iface != "none")
when: iiab_prepped and (num_lan_interfaces != "0" or iiab_wireless_lan_iface != "none")
## vars/ users should set user_wan_iface to avoid messy redetect
- include: redetect.yml
@ -42,30 +42,30 @@
# create ifcfg-WAN if missing
# if we get here we have gateway but no ifcfg file
- include: create_ifcfg.yml
when: xsce_wan_iface != "none" and not has_WAN and has_ifcfg_gw == "none" and xo_model == "none" and not xsce_demo_mode
when: iiab_wan_iface != "none" and not has_WAN and has_ifcfg_gw == "none" and xo_model == "none" and not iiab_demo_mode
- name: Configuring LAN interface as xsce_lan_iface
- name: Configuring LAN interface as iiab_lan_iface
template: src=network/ifcfg.j2
dest=/etc/sysconfig/network-scripts/ifcfg-LAN
when: xsce_lan_iface != "none"
when: iiab_lan_iface != "none"
# can be more than one wired interface
- name: Wired enslaving ## lan_list_result ## to Bridge
template: src=network/ifcfg-slave.j2
dest=/etc/sysconfig/network-scripts/ifcfg-{{ item|trim }}
when: xsce_lan_iface == "br0" and item|trim != xsce_wireless_lan_iface and item|trim != xsce_wan_iface
when: iiab_lan_iface == "br0" and item|trim != iiab_wireless_lan_iface and item|trim != iiab_wan_iface
with_items:
- "{{ lan_list_result.stdout_lines }}"
- name: WiFi enslaving {{ xsce_wireless_lan_iface }} to Bridge
- name: WiFi enslaving {{ iiab_wireless_lan_iface }} to Bridge
template: src=network/wifi-slave.j2
dest=/etc/sysconfig/network-scripts/ifcfg-{{ xsce_wireless_lan_iface }}
when: xsce_lan_iface == "br0" and xsce_wireless_lan_iface != "none"
dest=/etc/sysconfig/network-scripts/ifcfg-{{ iiab_wireless_lan_iface }}
when: iiab_lan_iface == "br0" and iiab_wireless_lan_iface != "none"
tags:
- network
- include: enable_wan.yml
when: not installing and not xsce_demo_mode
when: not installing and not iiab_demo_mode
# monitor-connection-files defaults to no with F21, F18-F20 defaults to yes
- name: Re-read network config files
@ -78,19 +78,19 @@
# test point, confirm onboot=no is OK everywhere
- name: Enabling pre-existing ifcfg-WAN file
shell: nmcli conn up id xsce-WAN
when: has_WAN and xsce_wan_iface != "none" and not installing and not xsce_demo_mode
shell: nmcli conn up id iiab-WAN
when: has_WAN and iiab_wan_iface != "none" and not installing and not iiab_demo_mode
- name: Enabling ifcfg-LAN file
shell: nmcli conn up id xsce-LAN
shell: nmcli conn up id iiab-LAN
ignore_errors: True
when: xsce_lan_iface != "none" and not installing and not xsce_demo_mode
when: iiab_lan_iface != "none" and not installing and not iiab_demo_mode
# we could do the DEVICE name stuff for a cleaner looking nmcli
- name: Enabling ifcfg slaves
shell: nmcli conn up id "System {{ item|trim }}"
ignore_errors: True
when: xsce_lan_iface == "br0" and item|trim != xsce_wireless_lan_iface and item|trim != xsce_wan_iface and not xsce_demo_mode
when: iiab_lan_iface == "br0" and item|trim != iiab_wireless_lan_iface and item|trim != iiab_wan_iface and not iiab_demo_mode
with_items:
- "{{ lan_list_result.stdout_lines }}"

View file

@ -38,14 +38,14 @@
- network
- domain
- name: Domain name did not change setting xsce_prepped
- name: Domain name did not change setting iiab_prepped
set_fact:
xsce_prepped: True
when: not domainname.changed and xsce_base_ver == gui_version
iiab_prepped: True
when: not domainname.changed and iiab_base_ver == gui_version
##### Start static ip address info for first run #####
#- include: static.yml
# when: 'xsce_wan_iface != "none" and wan_ip != "dhcp"'
# when: 'iiab_wan_iface != "none" and wan_ip != "dhcp"'
##### End static ip address info
- include: hosts.yml
@ -53,31 +53,31 @@
- network
- include: named.yml
# when: not xsce_prepped
# when: not iiab_prepped
tags:
- named
- network
- include: dhcpd.yml
# when: not xsce_prepped
# when: not iiab_prepped
tags:
- dhcpd
- network
- include: squid.yml
# when: not xsce_prepped
# when: not iiab_prepped
tags:
- squid
- network
- include: wondershaper.yml
when: not xsce_prepped
when: not iiab_prepped
tags:
- wondershaper
- network
- include: iptables.yml
# when: not xsce_prepped
# when: not iiab_prepped
tags:
- iptables
- network

View file

@ -1,4 +1,4 @@
# The preferred method of disabling the LAN would be to set xsce_lan_enabled:
# The preferred method of disabling the LAN would be to set iiab_lan_enabled:
# False before getting here but we are here...
# Well if we got here something changed with the gateway and ifcfg-WAN maybe
# no longer accurate. Note if DEVICE= is any ifcfg files the listed DEVICE
@ -44,14 +44,14 @@
when: try_wifi is defined and try_wifi.changed
# We have the DEVICE?
- name: Now setting xsce_wan_iface based on wifi
- name: Now setting iiab_wan_iface based on wifi
set_fact:
xsce_wan_iface: "{{ dhcp_wifi_results.stdout }}"
iiab_wan_iface: "{{ dhcp_wifi_results.stdout }}"
dhcp_good: True
when: dhcp_wifi_results.stdout is defined and dhcp_wifi_results.stdout != ""
- name: Trying ifcfg-WAN second
shell: nmcli conn up id xsce-WAN
shell: nmcli conn up id iiab-WAN
register: dhcp_WAN
ignore_errors: yes
when: has_WAN
@ -77,7 +77,7 @@
- name: Not risking an active device dropping all devices
shell: nmcli d delete {{ item|trim }}
ignore_errors: True
when: item|trim != xsce_wireless_lan_iface and not dhcp_good and wan_ip == "dhcp"
when: item|trim != iiab_wireless_lan_iface and not dhcp_good and wan_ip == "dhcp"
with_items:
- "{{ adapter_list.stdout_lines }}"
@ -91,7 +91,7 @@
- name: Try dhcp on all wired devices
shell: nmcli d connect {{ item|trim }}
ignore_errors: True
when: item|trim != discovered_wireless_iface and item|trim != xsce_wireless_lan_iface and not dhcp_good and wan_ip == "dhcp"
when: item|trim != discovered_wireless_iface and item|trim != iiab_wireless_lan_iface and not dhcp_good and wan_ip == "dhcp"
with_items:
- "{{ adapter_list.stdout_lines }}"
@ -102,14 +102,14 @@
when: not has_WAN and not dhcp_good
# We have the DEVICE?
- name: Now setting xsce_wan_iface via nmcli
- name: Now setting iiab_wan_iface via nmcli
set_fact:
xsce_wan_iface: "{{ dhcp_1BY1_results.stdout }}"
iiab_wan_iface: "{{ dhcp_1BY1_results.stdout }}"
dhcp_good: True
when: dhcp_1BY1_results.stdout is defined and dhcp_1BY1_results.stdout != "" and not has_WAN
- name: Find gateway config based on device
shell: egrep -rn "{{ xsce_wan_iface }}" /etc/sysconfig/network-scripts/ifcfg* | gawk -F ':' '{print $1}'
shell: egrep -rn "{{ iiab_wan_iface }}" /etc/sysconfig/network-scripts/ifcfg* | gawk -F ':' '{print $1}'
register: ifcfg_dhcp_device
ignore_errors: True
changed_when: False
@ -127,7 +127,7 @@
- name: Disconnect wired devices
shell: nmcli c down id "System{{ item|trim }}"
ignore_errors: True
when: item|trim != xsce_wireless_lan_iface and item|trim != xsce_wan_iface and wan_ip == "dhcp"
when: item|trim != iiab_wireless_lan_iface and item|trim != iiab_wan_iface and wan_ip == "dhcp"
with_items:
- "{{ adapter_list.stdout_lines }}"
@ -136,6 +136,6 @@
# Now disable LAN if single interface
- name: DHCP found on Single interface forcing LAN disabled.
set_fact:
xsce_lan_iface: "none"
iiab_lan_iface: "none"
when: dhcp_good and adapter_count.stdout|int == "1"

View file

@ -50,7 +50,7 @@
- name: Create gateway flag
shell: echo 1 > /etc/sysconfig/olpc-scripts/setup.d/installed/gateway
creates=/etc/sysconfig/olpc-scripts/setup.d/installed/gateway
when: xsce_network_mode == "Gateway"
when: iiab_network_mode == "Gateway"
- name: Run iptables
command: /usr/bin/xs-gen-iptables

View file

@ -18,7 +18,7 @@
package: name=resolvconf
state=absent
- name: on upgrade from earlier xsce versions, remove /etc/network/interfaces.d/br0
- name: on upgrade from earlier iiab versions, remove /etc/network/interfaces.d/br0
file: path=/etc/network/interfaces.d/br0
state=absent
@ -86,7 +86,7 @@
- debug: var=gui_static_wan
- name: Add location section to config file
ini_file: dest='{{ xsce_config_file }}'
ini_file: dest='{{ iiab_config_file }}'
section=network
option='{{ item.option }}'
value='{{ item.value }}'
@ -109,8 +109,8 @@
value: '{{ num_wifi_interfaces }}'
- option: 'discovered_wireless_iface'
value: '{{ discovered_wireless_iface }}'
- option: 'xsce_wireless_lan_iface'
value: '{{ xsce_wireless_lan_iface }}'
- option: 'iiab_wireless_lan_iface'
value: '{{ iiab_wireless_lan_iface }}'
- option: 'num_lan_interfaces'
value: '{{ num_lan_interfaces }}'
- option: 'detected_lan'

View file

@ -4,5 +4,5 @@
## see /usr/share/doc/xs-config-<version>/README
#
# Point dhcpd to the XS-specific config
DHCPDARGS='-cf /etc/dhcpd-xs.conf {{xsce_lan_iface}}'
DHCPDARGS='-cf /etc/dhcpd-xs.conf {{iiab_lan_iface}}'

View file

@ -4,7 +4,7 @@
ddns-update-style interim;
#ignore client-updates;
option domain-name "{{ xsce_domain }}";
option domain-name "{{ iiab_domain }}";
option domain-name-servers 172.18.96.1;
option ntp-servers 172.18.96.1;

View file

@ -1,8 +1,8 @@
#!/bin/bash
run_detect(){
logger "check-LAN: running reconfig"
cd /opt/schoolserver/xsce
/opt/schoolserver/xsce/runtags network > /dev/null
cd /opt/schoolserver/iiab
/opt/schoolserver/iiab/runtags network > /dev/null
logger "check-LAN: completed reconfig"
exit 0
}

View file

@ -8,6 +8,7 @@ IPTABLES_DATA=/etc/sysconfig/iptables
{% endif %}
LANIF=`cat /etc/sysconfig/xs_lan_device`
WANIF=`cat /etc/sysconfig/xs_wan_device`
MODE=`grep iiab_network_mode_applied /etc/iiab/iiab.ini | gawk '{print $3}'`
clear_fw() {
$IPTABLES -F
@ -32,7 +33,7 @@ $IPTABLES -A INPUT -p tcp --dport 5984 -j DROP
$IPTABLES -A INPUT -p udp --dport 5984 -j DROP
}
if [ "x$WANIF" == "x" ]; then
if [ "x$WANIF" == "x" ] || [ "$MODE" == 'Appliance' ]; then
clear_fw
# save the rule set
{% if is_debuntu %}
@ -50,7 +51,7 @@ gw_block_https={{ gw_block_https }}
ssh_port={{ ssh_port }}
gui_wan={{ gui_wan }}
gui_port={{ gui_port }}
xsce_gateway_enabled={{ xsce_gateway_enabled }}
iiab_gateway_enabled={{ iiab_gateway_enabled }}
services_externally_visible={{ services_externally_visible }}
calibre_port={{ calibre_port }}
kiwix_port={{ kiwix_port }}
@ -88,7 +89,7 @@ if [ "$services_externally_visible" == "True" ]; then
$IPTABLES -A INPUT -p tcp --dport $calibre_port -m state --state NEW -i $wan -j ACCEPT
fi
if [ "$xsce_gateway_enabled" == "True" ]; then
if [ "$iiab_gateway_enabled" == "True" ]; then
$IPTABLES -A POSTROUTING -t nat -o $wan -j MASQUERADE
fi

View file

@ -1,9 +1,9 @@
# Basic configuration
interface={{ xsce_wireless_lan_iface }}
interface={{ iiab_wireless_lan_iface }}
ssid={{ host_ssid }}
channel={{ host_channel }}
{%if xsce_lan_iface == "br0" %}
{%if iiab_lan_iface == "br0" %}
bridge=br0
{% endif %}

View file

@ -67,7 +67,7 @@ view "localhost_resolver"
include "/var/named-xs/named.rfc1912.zones";
/* and these are the local subnet names */
zone "{{ xsce_domain }}" in {
zone "{{ iiab_domain }}" in {
type master;
file "school.local.zone.db";
allow-update {127.0.0.1; };
@ -92,7 +92,7 @@ view "internal"
// These are your "authoritative" internal zones, and would probably
// also be included in the "localhost_resolver" view above :
zone "{{ xsce_domain }}" {
zone "{{ iiab_domain }}" {
type master;
file "school.internal.zone.db";
allow-update {127.0.0.1; };
@ -140,7 +140,7 @@ view "external"
// These are your "authoritative" external zones, and would probably
// also be included in the "localhost_resolver" view above :
zone "{{ xsce_domain }}" {
zone "{{ iiab_domain }}" {
type master;
file "school.external.zone.db";
allow-update {127.0.0.1; };

View file

@ -1,4 +1,4 @@
@ in soa localhost. root 1 3H 15M 1W 1D
ns localhost.
1 IN PTR school.{{ xsce_domain }}.
1 IN PTR school.{{ iiab_domain }}.

View file

@ -1,4 +1,4 @@
@ in soa localhost. root 1 3H 15M 1W 1D
ns localhost.
1 IN PTR school.{{ xsce_domain }}.
1 IN PTR school.{{ iiab_domain }}.

View file

@ -1,4 +1,4 @@
@ in soa localhost. root 1 3H 15M 1W 1D
ns localhost.
1 IN PTR school.{{ xsce_domain }}.
1 IN PTR school.{{ iiab_domain }}.

View file

@ -1,7 +1,7 @@
@ in soa localhost. root 1 3H 15M 1W 1D
ns localhost.
{{ xsce_hostname }} IN A 172.18.96.1
{{ iiab_hostname }} IN A 172.18.96.1
schoolserver IN A 172.18.96.1
school IN A 172.18.96.1
www IN A 172.18.96.1

View file

@ -1,4 +1,4 @@
@ in soa localhost. root 1 3H 15M 1W 1D
ns localhost.
1 IN PTR school.{{ xsce_domain }}.
1 IN PTR school.{{ iiab_domain }}.

View file

@ -3,7 +3,7 @@
@ in soa localhost. root 1 3H 15M 1W 1D
ns localhost.
{{ xsce_hostname }} IN A 172.18.96.1
{{ iiab_hostname }} IN A 172.18.96.1
schoolserver IN A 172.18.96.1
school IN A 172.18.96.1
www IN A 172.18.96.1

View file

@ -29,7 +29,7 @@ iface br0 inet static
address {{ lan_ip }}
netmask {{ lan_netmask }}
dns-nameservers {{ lan_ip }}
dns-search {{ xsce_domain }}
dns-search {{ iiab_domain }}
auto {{ discovered_wan_iface }}
{% if gui_static_wan == false %}
allow-hotplug {{ discovered_wan_iface }}
@ -42,7 +42,7 @@ iface {{ discovered_wan_iface }} inet static
netmask {{ gui_static_wan_netmask }}
gateway {{ gui_static_wan_gateway }}
dns-nameservers {{ gui_static_wan_nameserver }}
dns-search {{ xsce_domain }}
dns-search {{ iiab_domain }}
post-up systemctl restart dhcpd && systemctl restart hostapd
{% endif %}
{% else %} {# end of gui_desired_network_role == Gateway #}
@ -55,7 +55,7 @@ iface br0 inet static
netmask {{ lan_netmask }}
gateway {{ lan_ip }}
dns-nameservers {{ lan_ip }}
dns-search {{ xsce_domain }}
dns-search {{ iiab_domain }}
post-up systemctl restart dhcpd && systemctl restart hostapd
{% endif %}

View file

@ -1 +1 @@
{{ xsce_hostname }}.{{ xsce_domain }}
{{ iiab_hostname }}.{{ iiab_domain }}

View file

@ -1,5 +1,5 @@
# Generated by XSCE
NAME="xsce-WAN"
NAME="iiab-WAN"
TYPE="Ethernet"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
@ -25,5 +25,5 @@ GATEWAY="{{ wan_gateway }}"
PREFIX=
{% endif %}
DEVICE="{{ xsce_wan_iface }}"
HWADDR="{{ hostvars[inventory_hostname]['ansible_' + xsce_wan_iface]['macaddress'] }}"
DEVICE="{{ iiab_wan_iface }}"
HWADDR="{{ hostvars[inventory_hostname]['ansible_' + iiab_wan_iface]['macaddress'] }}"

View file

@ -1,12 +1,12 @@
# Generated by XSCE
{% if xsce_lan_iface == "br0" %}
{% if iiab_lan_iface == "br0" %}
DEVICE=br0
TYPE=Bridge
{% else %}
DEVICE={{ xsce_lan_iface }}
DEVICE={{ iiab_lan_iface }}
TYPE=Ethernet
HWADDR={{ hostvars[inventory_hostname]['ansible_' + xsce_lan_iface]['macaddress'] }}
HWADDR={{ hostvars[inventory_hostname]['ansible_' + iiab_lan_iface]['macaddress'] }}
{% endif %}
BOOTPROTO=none
@ -15,5 +15,5 @@ IPADDR={{ lan_ip }}
NETMASK={{ lan_netmask }}
NM_CONTROLLED=yes
DNS1=127.0.0.1
DOMAIN={{ xsce_domain }}
NAME=xsce-LAN
DOMAIN={{ iiab_domain }}
NAME=iiab-LAN

View file

@ -7,7 +7,7 @@ source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
# xsce_network_mode is {{ gui_desired_network_role }}
# iiab_network_mode is {{ gui_desired_network_role }}
{% if discovered_wireless_iface != 'none' %}
# we always want the wireless to be configured (and under bridge) if it exists
auto {{ discovered_wireless_iface }}
@ -16,7 +16,7 @@ iface {{discovered_wireless_iface }} inet manual
pre-down ifconfig $IFACE down
{% endif %}
{% if xsce_network_mode == "Appliance" %}
{% if iiab_network_mode == "Appliance" %}
################# APPLIANCE #########################
auto {{ discovered_wan_iface }}
{% if gui_static_wan == false %}
@ -27,9 +27,9 @@ iface {{ discovered_wan_iface }} inet static
netmask {{ gui_static_wan_netmask }}
gateway {{ gui_static_wan_gateway }}
dns-nameservers {{ gui_static_wan_nameserver }}
dns-search {{ xsce_domain }}
dns-search {{ iiab_domain }}
{% endif %} {# end of static_wan #}
{% elif xsce_network_mode == "Gateway" %}
{% elif iiab_network_mode == "Gateway" %}
################# GATEWAY #########################
auto br0
iface br0 inet static
@ -47,10 +47,10 @@ iface {{ discovered_wan_iface }} inet static
netmask {{ gui_static_wan_netmask }}
gateway {{ gui_static_wan_gateway }}
dns-nameservers {{ gui_static_wan_nameserver }}
dns-search {{ xsce_domain }}
dns-search {{ iiab_domain }}
post-up systemctl restart dhcpd && systemctl restart hostapd
{% endif %}
{% else %} {# end of xsce_network_mode == Gateway #}
{% else %} {# end of iiab_network_mode == Gateway #}
################# LANCONTROLLER ###################
auto br0
@ -62,7 +62,7 @@ iface br0 inet static
netmask {{ lan_netmask }}
gateway {{ lan_ip }}
dns-nameservers {{ lan_ip }}
dns-search {{ xsce_domain }}
dns-search {{ iiab_domain }}
post-up systemctl restart dhcpd && systemctl restart hostapd
{% endif %}

View file

@ -1,2 +1,2 @@
domain {{ xsce_domain }}
domain {{ iiab_domain }}
nameserver {{ lan_ip }}

View file

@ -4,4 +4,4 @@ NETWORKING_IPV6=no
IPV6FORWARDING=no
IPV6_AUTOCONF=no
#TODO remove deprecated HOSTNAME entry
HOSTNAME={{ xsce_hostname }}.{{ xsce_domain }}
HOSTNAME={{ iiab_hostname }}.{{ iiab_domain }}

View file

@ -7,6 +7,6 @@ ONBOOT=yes
NM_CONTROLLED=no
# needs work but it's a start
HWADDR={{ hostvars[inventory_hostname]['ansible_' + xsce_wireless_lan_iface ]['macaddress'] }}
DEVICE={{ xsce_wireless_lan_iface }}
HWADDR={{ hostvars[inventory_hostname]['ansible_' + iiab_wireless_lan_iface ]['macaddress'] }}
DEVICE={{ iiab_wireless_lan_iface }}

View file

@ -1 +1 @@
{{ xsce_domain }}
{{ iiab_domain }}

View file

@ -1,3 +1,3 @@
{% if xsce_lan_iface != "none" %}
{{ xsce_lan_iface }}
{% if iiab_lan_iface != "none" %}
{{ iiab_lan_iface }}
{% endif %}

View file

@ -1,3 +1,3 @@
{% if xsce_wan_iface != "none" %}
{{ xsce_wan_iface }}
{% if iiab_wan_iface != "none" %}
{{ iiab_wan_iface }}
{% endif %}

View file

@ -1,7 +1,7 @@
# the leading dot matches anything preceeding
# don't remove the .lan line
# change this to your domain if necessary
.{{ xsce_domain }}
.{{ iiab_domain }}
.laptop.org
.olpcMAP.net
.mapmeld.appspot.com
@ -10,6 +10,7 @@
.translate.google.com
.gstatic.com
.unleashkids.org
.iiab.io.org
.hopeforhaitischildren.org
.lenouvelliste.com
.voanouvel.com

View file

@ -70,7 +70,7 @@ acl apache rep_header Server ^Apache
#
# NOTE: it must start with a dot
#
append_domain .{{ xsce_domain }}
append_domain .{{ iiab_domain }}
###############################

View file

@ -1,7 +1,7 @@
[wondershaper]
# Adapter
#
IFACE="{{ xsce_wan_iface }}"
IFACE="{{ iiab_wan_iface }}"
# Download rate in Kbps
#