mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Test (#20)
* 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:
parent
6ef68cc480
commit
f319afa432
179 changed files with 978 additions and 672 deletions
|
@ -8,17 +8,17 @@
|
|||
- set_fact:
|
||||
xo_model: '{{ ansible_local["local_facts"]["xo_model"] }}'
|
||||
phplib_dir: '{{ ansible_local["local_facts"]["phplib_dir"] }}'
|
||||
xsce_base_ver: '{{ ansible_local["local_facts"]["xsce_base_ver"] }}'
|
||||
xsce_preload: '{{ ansible_local["local_facts"]["xsce_preload"] }}'
|
||||
iiab_base_ver: '{{ ansible_local["local_facts"]["iiab_base_ver"] }}'
|
||||
iiab_preload: '{{ ansible_local["local_facts"]["iiab_preload"] }}'
|
||||
|
||||
- name: Defaulting xsce_base_ver
|
||||
- name: Defaulting iiab_base_ver
|
||||
set_fact:
|
||||
xsce_base_ver: 0
|
||||
when: xsce_base_ver == ""
|
||||
iiab_base_ver: 0
|
||||
when: iiab_base_ver == ""
|
||||
|
||||
- name: Defaulting xsce_prepped
|
||||
- name: Defaulting iiab_prepped
|
||||
set_fact:
|
||||
xsce_prepped: False
|
||||
iiab_prepped: False
|
||||
tags:
|
||||
- download
|
||||
- download2
|
||||
|
@ -29,23 +29,23 @@
|
|||
when: xo_model != "none"
|
||||
|
||||
- name: add version section
|
||||
ini_file: dest='{{ xsce_config_file }}'
|
||||
ini_file: dest='{{ iiab_config_file }}'
|
||||
section=runtime
|
||||
option='{{ item.option }}'
|
||||
value='{{ item.value }}'
|
||||
with_items:
|
||||
- option: 'runtime_branch'
|
||||
value: '{{ ansible_local["local_facts"]["xsce_branch"] }}'
|
||||
value: '{{ ansible_local["local_facts"]["iiab_branch"] }}'
|
||||
- option: 'runtime_commit'
|
||||
value: '{{ ansible_local["local_facts"]["xsce_commit"] }}'
|
||||
value: '{{ ansible_local["local_facts"]["iiab_commit"] }}'
|
||||
- option: 'runtime_date'
|
||||
value: '{{ ansible_date_time["iso8601"] }}'
|
||||
- option: 'runtime_php'
|
||||
value: '{{ phplib_dir }}'
|
||||
- option: 'runtime_preload'
|
||||
value: '{{ xsce_preload }}'
|
||||
value: '{{ iiab_preload }}'
|
||||
- option: 'runtime_base_ver'
|
||||
value: '{{ xsce_base_ver }}'
|
||||
value: '{{ iiab_base_ver }}'
|
||||
- option: 'kernel'
|
||||
value: '{{ ansible_kernel }}'
|
||||
- option: 'memory_mb'
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
# above always registers
|
||||
- name: Checking for prior domain name
|
||||
set_fact:
|
||||
xsce_domain: "{{ prior_domain.stdout }}"
|
||||
iiab_domain: "{{ prior_domain.stdout }}"
|
||||
when: prior_domain.stdout != "lan" and prior_domain.stdout != ""
|
||||
|
||||
- name: xs_wan_device
|
||||
|
@ -53,7 +53,7 @@
|
|||
when: discovered_wan_iface != "none" and gw_active_test.stdout == "0"
|
||||
|
||||
- name: Test for internet access
|
||||
get_url: url="{{ xsce_download_url }}/heart-beat.txt" dest=/tmp/heart-beat.txt
|
||||
get_url: url="{{ iiab_download_url }}/heart-beat.txt" dest=/tmp/heart-beat.txt
|
||||
ignore_errors: True
|
||||
# async: 10
|
||||
# poll: 2
|
||||
|
@ -73,15 +73,15 @@
|
|||
no_network: True
|
||||
when: not has_internet_connection
|
||||
|
||||
- name: Testing for xsce_preload
|
||||
- name: Testing for iiab_preload
|
||||
set_fact:
|
||||
use_cache: True
|
||||
no_network: True
|
||||
when: xsce_preload == "True"
|
||||
when: iiab_preload == "True"
|
||||
|
||||
- name: Setting wan if detected
|
||||
set_fact:
|
||||
xsce_wan_iface: "{{ discovered_wan_iface }}"
|
||||
iiab_wan_iface: "{{ discovered_wan_iface }}"
|
||||
device_gw: "{{ discovered_wan_iface }}"
|
||||
when: discovered_wan_iface != "none"
|
||||
|
||||
|
@ -184,13 +184,13 @@
|
|||
- name: XO override 2 wifi on LAN
|
||||
set_fact:
|
||||
ap_device: "eth0"
|
||||
when: xsce_wan_iface != "eth0" and discovered_wireless_iface != "none" and xo_model == "XO-1.5"
|
||||
when: iiab_wan_iface != "eth0" and discovered_wireless_iface != "none" and xo_model == "XO-1.5"
|
||||
|
||||
# takes adapter name
|
||||
- name: Blacklisted wifi adapter
|
||||
set_fact:
|
||||
ap_device: "{{ blacklist_wifi }}"
|
||||
when: blacklist_wifi is defined and discovered_wireless_iface != xsce_wan_iface and num_wifi_interfaces >= "2"
|
||||
when: blacklist_wifi is defined and discovered_wireless_iface != iiab_wan_iface and num_wifi_interfaces >= "2"
|
||||
|
||||
# LAN - pick non WAN's
|
||||
- name: Create list of LAN (non wan) ifaces
|
||||
|
@ -201,7 +201,7 @@
|
|||
|
||||
# Select an adapter that is not WAN and not wireless
|
||||
# if there is more than one the last one wins
|
||||
- name: Set xsce discovered lan fact
|
||||
- name: Set iiab discovered lan fact
|
||||
set_fact:
|
||||
discovered_lan_iface: "{{ item|trim }}"
|
||||
when: item|trim != discovered_wireless_iface and item|trim != discovered_wan_iface
|
||||
|
@ -222,15 +222,15 @@
|
|||
# If 2 interfaces found in gateway mode, with one wifi, declare other to be wan
|
||||
#- name: In gateway mode with one wifi adapter, the other is WAN
|
||||
# set_fact:
|
||||
# xsce_wan_iface: "{{ discovered_lan_iface }}"
|
||||
# xsce_lan_iface: "{{ discovered_wireless_iface }}"
|
||||
# iiab_wan_iface: "{{ discovered_lan_iface }}"
|
||||
# iiab_lan_iface: "{{ discovered_wireless_iface }}"
|
||||
# num_lan_interfaces: "1"
|
||||
# when: xsce_lan_enabled and xsce_wan_enabled and num_lan_interfaces == "2" and discovered_wireless_iface != "none" and xsce_wan_iface == "none"
|
||||
# when: iiab_lan_enabled and iiab_wan_enabled and num_lan_interfaces == "2" and discovered_wireless_iface != "none" and iiab_wan_iface == "none"
|
||||
|
||||
- name: Set the variable for wireless_iface if present
|
||||
set_fact:
|
||||
xsce_wireless_lan_iface: "{{ discovered_wireless_iface }}"
|
||||
when: discovered_wireless_iface != "none" and discovered_wireless_iface != xsce_wan_iface
|
||||
iiab_wireless_lan_iface: "{{ discovered_wireless_iface }}"
|
||||
when: discovered_wireless_iface != "none" and discovered_wireless_iface != iiab_wan_iface
|
||||
|
||||
#unused
|
||||
- name: Get a list of ifcfg files to delete
|
||||
|
@ -238,29 +238,29 @@
|
|||
register: ifcfg_files
|
||||
changed_when: False
|
||||
ignore_errors: True
|
||||
when: num_lan_interfaces >= "1" or xsce_wireless_lan_iface != "none"
|
||||
when: num_lan_interfaces >= "1" or iiab_wireless_lan_iface != "none"
|
||||
#
|
||||
|
||||
# use value only if present
|
||||
- name: Setting detected lan
|
||||
set_fact:
|
||||
xsce_lan_iface: "{{ discovered_lan_iface }}"
|
||||
iiab_lan_iface: "{{ discovered_lan_iface }}"
|
||||
when: 'discovered_lan_iface != "none" and num_lan_interfaces == "1"'
|
||||
|
||||
- name: for debian, always use bridging
|
||||
set_fact:
|
||||
xsce_lan_iface: br0
|
||||
iiab_lan_iface: br0
|
||||
when: 'discovered_lan_iface != "none" and num_lan_interfaces >= "1" and is_debian'
|
||||
|
||||
- name: 2 or more devices on the LAN - use bridging
|
||||
set_fact:
|
||||
xsce_lan_iface: br0
|
||||
iiab_lan_iface: br0
|
||||
when: 'discovered_lan_iface != "none" and num_lan_interfaces >= "2" and not is_debian'
|
||||
|
||||
- name: WiFi is on the LAN - use bridging
|
||||
set_fact:
|
||||
xsce_lan_iface: br0
|
||||
when: xsce_wireless_lan_iface != "none"
|
||||
iiab_lan_iface: br0
|
||||
when: iiab_wireless_lan_iface != "none"
|
||||
|
||||
# OK try old gw this is a best guess based on what's in
|
||||
# /etc/sysconfig/xs_wan_device's last state intended to
|
||||
|
@ -272,7 +272,7 @@
|
|||
when: user_wan_iface == "auto" and device_gw != "none" and discovered_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 }}'
|
||||
|
@ -295,8 +295,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'
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
# workaround for fact that auto create does not work on ini_file
|
||||
- name: Create xsce config file
|
||||
file: dest='{{ xsce_config_file }}'
|
||||
- name: Create iiab config file
|
||||
file: dest='{{ iiab_config_file }}'
|
||||
state=touch
|
||||
|
||||
- name: Add location section to config file
|
||||
ini_file: dest='{{ xsce_config_file }}'
|
||||
ini_file: dest='{{ iiab_config_file }}'
|
||||
section=location
|
||||
option='{{ item.option }}'
|
||||
value='{{ item.value }}'
|
||||
with_items:
|
||||
- option: 'xsce_base'
|
||||
value: '{{ xsce_base }}'
|
||||
- option: 'xsce_dir'
|
||||
value: '{{ xsce_dir }}'
|
||||
- option: 'iiab_base'
|
||||
value: '{{ iiab_base }}'
|
||||
- option: 'iiab_dir'
|
||||
value: '{{ iiab_dir }}'
|
||||
|
||||
- name: add version section
|
||||
ini_file: dest='{{ xsce_config_file }}'
|
||||
ini_file: dest='{{ iiab_config_file }}'
|
||||
section=version
|
||||
option='{{ item.option }}'
|
||||
value='{{ item.value }}'
|
||||
|
@ -24,10 +24,10 @@
|
|||
value: '{{ ansible_distribution }}'
|
||||
- option: 'arch'
|
||||
value: '{{ ansible_architecture }}'
|
||||
- option: 'xsce_branch'
|
||||
value: '{{ ansible_local["local_facts"]["xsce_branch"] }}'
|
||||
- option: 'xsce_commit'
|
||||
value: '{{ ansible_local["local_facts"]["xsce_commit"] }}'
|
||||
- option: 'iiab_branch'
|
||||
value: '{{ ansible_local["local_facts"]["iiab_branch"] }}'
|
||||
- option: 'iiab_commit'
|
||||
value: '{{ ansible_local["local_facts"]["iiab_commit"] }}'
|
||||
- option: 'install_date'
|
||||
value: '{{ ansible_date_time["iso8601"] }}'
|
||||
- option: 'install_xo'
|
|
@ -43,7 +43,7 @@
|
|||
- include: prep.yml
|
||||
|
||||
# we need to inialize the ini file
|
||||
- include: xsce_ini.yml
|
||||
- include: iiab_ini.yml
|
||||
|
||||
- include: computed_vars.yml
|
||||
|
||||
|
@ -97,6 +97,6 @@
|
|||
|
||||
- name: download the firmware for built in wifi on NUC6
|
||||
get_url: dest=/lib/firmware
|
||||
url={{ xsce_download_url }}/iwlwifi-8000C-13.ucode
|
||||
url={{ iiab_download_url }}/iwlwifi-8000C-13.ucode
|
||||
when: usb_NUC6.stdout|int > 0
|
||||
|
||||
|
|
|
@ -2,18 +2,18 @@
|
|||
command: dnf install -y yum
|
||||
when: ansible_distribution == "Fedora" and ansible_distribution_version|int >= 22
|
||||
|
||||
- name: Install xsce-extra repos
|
||||
- name: Install iiab-extra repos
|
||||
template: backup=yes
|
||||
dest=/etc/yum.repos.d/xsce-extra.repo
|
||||
src=xsce-extra.repo
|
||||
dest=/etc/yum.repos.d/iiab-extra.repo
|
||||
src=iiab-extra.repo
|
||||
owner=root
|
||||
mode=0666
|
||||
when: is_redhat
|
||||
|
||||
- name: Install xsce-testing repos
|
||||
- name: Install iiab-testing repos
|
||||
template: backup=yes
|
||||
dest=/etc/yum.repos.d/xsce-testing.repo
|
||||
src=xsce-testing.repo
|
||||
dest=/etc/yum.repos.d/iiab-testing.repo
|
||||
src=iiab-testing.repo
|
||||
owner=root
|
||||
mode=0666
|
||||
when: is_redhat
|
||||
|
@ -25,24 +25,24 @@
|
|||
mode=0666
|
||||
when: ansible_distribution == "Fedora"
|
||||
|
||||
- name: Create /etc/xsce
|
||||
file: path=/etc/xsce
|
||||
- name: Create /etc/iiab
|
||||
file: path=/etc/iiab
|
||||
owner=root
|
||||
group=root
|
||||
mode=0755
|
||||
state=directory
|
||||
|
||||
# this script can be sourced to get xsce location
|
||||
- name: Create xsce.env file
|
||||
template: src=xsce.env.j2
|
||||
dest=/etc/xsce/xsce.env
|
||||
# this script can be sourced to get iiab location
|
||||
- name: Create iiab.env file
|
||||
template: src=iiab.env.j2
|
||||
dest=/etc/iiab/iiab.env
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
|
||||
- name: put a python interface to xsce.env
|
||||
template: src=xsce_env.py.j2
|
||||
dest=/etc/xsce/xsce_env.py
|
||||
- name: put a python interface to iiab.env
|
||||
template: src=iiab_env.py.j2
|
||||
dest=/etc/iiab/iiab_env.py
|
||||
|
||||
- name: create ansible.d facts directory
|
||||
file: path=/etc/ansible/facts.d
|
||||
|
@ -65,7 +65,7 @@
|
|||
set_fact:
|
||||
phplib_dir: '{{ ansible_local["local_facts"]["phplib_dir"] }}'
|
||||
xo_model: '{{ ansible_local["local_facts"]["xo_model"] }}'
|
||||
xsce_preload: '{{ ansible_local["local_facts"]["xsce_preload"] }}'
|
||||
iiab_preload: '{{ ansible_local["local_facts"]["iiab_preload"] }}'
|
||||
|
||||
- name: Install script to fully initialize network config, and/or collect data
|
||||
# calling xs-network-reset w/ snapshot name, stores info, but aborts reset
|
||||
|
|
|
@ -49,11 +49,11 @@
|
|||
group=root
|
||||
mode={{ item.mode }}
|
||||
with_items:
|
||||
- { src: 'xsce-rpi-max-rootfs.sh', dest: '/usr/sbin/xsce-rpi-max-rootfs.sh', mode: '0755'}
|
||||
- { src: 'xsce-rpi-root-resize.service', dest: '/etc/systemd/system/xsce-rpi-root-resize.service', mode: '0644'}
|
||||
- { src: 'iiab-rpi-max-rootfs.sh', dest: '/usr/sbin/iiab-rpi-max-rootfs.sh', mode: '0755'}
|
||||
- { src: 'iiab-rpi-root-resize.service', dest: '/etc/systemd/system/iiab-rpi-root-resize.service', mode: '0644'}
|
||||
|
||||
- name: Enable rootfs resizing service
|
||||
service: name=xsce-rpi-root-resize
|
||||
service: name=iiab-rpi-root-resize
|
||||
enabled=yes
|
||||
- name: Reboot if the config.txt was changed
|
||||
command: /sbin/reboot
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue