diff --git a/README-historical.md b/README-historical.md index f1da871b1..954c97fcc 100644 --- a/README-historical.md +++ b/README-historical.md @@ -34,8 +34,8 @@ Please read the `installation`_ documentation. See the `XSCE project`_ for more information about the project. -.. _XSCE wiki: https://github.com/XSCE/xsce/wiki -.. _installation: https://github.com/XSCE/xsce/wiki/XSCE-Installation +.. _XSCE wiki: https://github.com/XSCE/iiab/wiki +.. _installation: https://github.com/XSCE/iiab/wiki/XSCE-Installation .. _ansible: http://www.ansibleworks.com/ .. _ansible documentation: http://www.ansibleworks.com/docs/ .. _XSCE project: http://schoolserver.org/ diff --git a/README.md b/README.md index fa8dec004..895c73200 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # iiab -Internet in a Box - NEW VERSION orig from http://github.com/xsce +Internet in a Box - NEW VERSION orig from http://github.com/iiab diff --git a/ReleaseNotes6.0.md b/ReleaseNotes6.0.md index 7087f103e..3bb5aa620 100644 --- a/ReleaseNotes6.0.md +++ b/ReleaseNotes6.0.md @@ -50,4 +50,4 @@ There are three main methods of installing this software: In each case you need hardware that has been assembled, but with nothing installed on it. -Detailed instructions on each of these methods is at https://github.com/XSCE/xsce/wiki/XSCE-Installation. +Detailed instructions on each of these methods is at https://github.com/XSCE/iiab/wiki/XSCE-Installation. diff --git a/ReleaseNotes6.1.md b/ReleaseNotes6.1.md index 40abc6b10..dcea97d84 100644 --- a/ReleaseNotes6.1.md +++ b/ReleaseNotes6.1.md @@ -21,7 +21,7 @@ If you want to enable a service, you must browse to http://schoolserver.lan/admi **How Do I Install 6.1?** -The install instructions have not changed much since release-6.0. Please refer to https://github.com/XSCE/xsce/wiki/XSCE-Installation for the overall process -- Noting the following: +The install instructions have not changed much since release-6.0. Please refer to https://github.com/XSCE/iiab/wiki/XSCE-Installation for the overall process -- Noting the following: * On FC22, add "yum" to the installs prior to running the ansible playbook i.e. ``` @@ -29,8 +29,8 @@ The install instructions have not changed much since release-6.0. Please refer t cd /opt mkdir /opt/schoolserver cd schoolserver - git clone https://github.com/XSCE/xsce --branch release-6.1 --depth 1 - cd xsce + git clone https://github.com/XSCE/iiab --branch release-6.1 --depth 1 + cd iiab ./install-console ``` diff --git a/xsce-base.yml b/iiab-base.yml similarity index 92% rename from xsce-base.yml rename to iiab-base.yml index a3e05c252..5d8151420 100644 --- a/xsce-base.yml +++ b/iiab-base.yml @@ -6,7 +6,7 @@ - vars/default_vars.yml - vars/{{ ansible_distribution }}.yml - vars/local_vars.yml - - /etc/xsce/config_vars.yml + - /etc/iiab/config_vars.yml roles: - { role: 1-prep, tags: ['prep','platform','base'] } diff --git a/xsce-from-console.yml b/iiab-from-console.yml similarity index 94% rename from xsce-from-console.yml rename to iiab-from-console.yml index 587968718..6568b87a5 100644 --- a/xsce-from-console.yml +++ b/iiab-from-console.yml @@ -6,7 +6,7 @@ - vars/default_vars.yml - vars/{{ ansible_distribution }}.yml - vars/local_vars.yml - - /etc/xsce/config_vars.yml + - /etc/iiab/config_vars.yml roles: - { role: 1-prep, tags: ['prep','platform','base'] } diff --git a/iiab-network b/iiab-network new file mode 100755 index 000000000..5a065e556 --- /dev/null +++ b/iiab-network @@ -0,0 +1,37 @@ +#!/bin/bash + +if [ -f /etc/iiab/iiab.env ] +then + . /etc/iiab/iiab.env + cd $XSCE_DIR +else + echo /etc/iiab/iiab.env is missing. Playbook has not been run. + exit 1 +fi + +if [ ! -f iiab-network.yml ] +then + echo "XSCE Playbook not found." + echo "Please run this command from the top level of the git repo." + echo "Exiting." + exit +fi + +if [ ! -f /etc/iiab/config_vars.yml ] +then + touch /etc/iiab/config_vars.yml +fi + +export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-network.log" +ansible-playbook -i ansible_hosts iiab-network.yml --connection=local +echo "" >> iiab-network.log +ls -la /etc/sys*/net*/ifcfg* >> iiab-network.log +if [ ! "OS" == "debian" ]; then + nmcli d >> iiab-network.log + nmcli c >> iiab-network.log +fi +brctl show >> iiab-network.log +echo "run on:" >> iiab-network.log +date >> iiab-network.log +echo "" >> iiab-network.log +echo "" >> iiab-network.log diff --git a/xsce-network.yml b/iiab-network.yml similarity index 89% rename from xsce-network.yml rename to iiab-network.yml index 363224cfa..2d16101cb 100644 --- a/xsce-network.yml +++ b/iiab-network.yml @@ -6,7 +6,7 @@ - vars/default_vars.yml - vars/{{ ansible_distribution }}.yml - vars/local_vars.yml - - /etc/xsce/config_vars.yml + - /etc/iiab/config_vars.yml roles: - { role: 1-prep, tags: ['prep','platform','base'] } diff --git a/iiab.retry b/iiab.retry new file mode 100644 index 000000000..7b9ad531d --- /dev/null +++ b/iiab.retry @@ -0,0 +1 @@ +127.0.0.1 diff --git a/xsce.yml b/iiab.yml similarity index 89% rename from xsce.yml rename to iiab.yml index 576687803..8333ac5c8 100644 --- a/xsce.yml +++ b/iiab.yml @@ -4,9 +4,9 @@ vars_files: - vars/default_vars.yml - - vars/{{ ansible_lsb.id }}.yml + - vars/{{ ansible_distribution}}.yml - vars/local_vars.yml - - /etc/xsce/config_vars.yml + - /etc/iiab/config_vars.yml roles: - { role: 1-prep, tags: ['prep','platform','base'] } diff --git a/install-console b/install-console index 685ffc4d2..248934c0a 100755 --- a/install-console +++ b/install-console @@ -1,25 +1,25 @@ #!/bin/bash -# copy var files to /etc/xsce for subsequent use +# copy var files to /etc/iiab for subsequent use #./install-init # if not the first run, repo location is here -if [ -f /etc/xsce/xsce.env ] +if [ -f /etc/iiab/iiab.env ] then - . /etc/xsce/xsce.env + . /etc/iiab/iiab.env cd $XSCE_DIR else - XSCE_DIR=/opt/schoolserver/xsce - mkdir -p /etc/xsce - touch /etc/xsce/config_vars.yml + XSCE_DIR=/opt/schoolserver/iiab + mkdir -p /etc/iiab + touch /etc/iiab/config_vars.yml fi # don't track vars/local_vars.yml git update-index --assume-unchanged vars/local_vars.yml -PLAYBOOK="xsce-base.yml" +PLAYBOOK="iiab-base.yml" INVENTORY="ansible_hosts" SELINUX_BEFORE="" SELINUX_AFTER="" @@ -37,7 +37,7 @@ then SELINUX_BEFORE=`cat /etc/selinux/config | gawk -F= '/^SELINUX=/{ print $2 }'` fi -export ANSIBLE_LOG_PATH="$XSCE_DIR/xsce-install.log" +export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-install.log" ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local if [ -f /etc/selinux/config ] diff --git a/roles/1-prep/defaults/main.yml b/roles/1-prep/defaults/main.yml index f6f477e2c..30a64076d 100644 --- a/roles/1-prep/defaults/main.yml +++ b/roles/1-prep/defaults/main.yml @@ -1,5 +1,5 @@ # use these as a tag a release at a point in time -xsce_base_ver: 0 +iiab_base_ver: 0 gui_version: 2 NUC6_firmware_needed: False @@ -12,7 +12,7 @@ has_WAN: False wireless_lan_present: False udev_needs_patch: False strict_networking: False -xsce_demo_mode: False +iiab_demo_mode: False gw_active: False gui_static_wan: False has_internet_connection: False @@ -36,9 +36,9 @@ wifi2: "not found-2" discovered_wan_iface: "none" discovered_lan_iface: "none" discovered_wireless_iface: "none" -xsce_wireless_lan_iface: "none" -xsce_lan_iface: "none" -xsce_wan_iface: "none" +iiab_wireless_lan_iface: "none" +iiab_lan_iface: "none" +iiab_wan_iface: "none" device_gw: "none" has_ifcfg_gw: "none" has_wifi_gw: "none" @@ -50,8 +50,8 @@ ssid: XSCE hostapd_wait: 10 gui_port: 80 -# must keep roles/xsce-admin/defaults/main.yml sync'd -admin_console_path: "{{ xsce_base }}/admin_console" -cmdsrv_path: "{{ xsce_base }}/xsce_cmdsrv" -xsce_cmdsrv_dbname : "xsce_cmdsrv.0.2.db" +# must keep roles/iiab-admin/defaults/main.yml sync'd +admin_console_path: "{{ iiab_base }}/admin_console" +cmdsrv_path: "{{ iiab_base }}/iiab_cmdsrv" +iiab_cmdsrv_dbname : "iiab_cmdsrv.0.2.db" wifi_id: none diff --git a/roles/1-prep/tasks/computed_vars.yml b/roles/1-prep/tasks/computed_vars.yml index e93c04054..02e2b8ed8 100644 --- a/roles/1-prep/tasks/computed_vars.yml +++ b/roles/1-prep/tasks/computed_vars.yml @@ -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' diff --git a/roles/1-prep/tasks/detected_network.yml b/roles/1-prep/tasks/detected_network.yml index 8a05f8fb1..59e31005e 100644 --- a/roles/1-prep/tasks/detected_network.yml +++ b/roles/1-prep/tasks/detected_network.yml @@ -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' diff --git a/roles/1-prep/tasks/xsce_ini.yml b/roles/1-prep/tasks/iiab_ini.yml similarity index 59% rename from roles/1-prep/tasks/xsce_ini.yml rename to roles/1-prep/tasks/iiab_ini.yml index 2229b4802..c78970507 100755 --- a/roles/1-prep/tasks/xsce_ini.yml +++ b/roles/1-prep/tasks/iiab_ini.yml @@ -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' diff --git a/roles/1-prep/tasks/main.yml b/roles/1-prep/tasks/main.yml index 461bb2657..b4b516bcd 100644 --- a/roles/1-prep/tasks/main.yml +++ b/roles/1-prep/tasks/main.yml @@ -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 diff --git a/roles/1-prep/tasks/prep.yml b/roles/1-prep/tasks/prep.yml index acac82c0e..09227f906 100644 --- a/roles/1-prep/tasks/prep.yml +++ b/roles/1-prep/tasks/prep.yml @@ -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 diff --git a/roles/1-prep/tasks/raspberry_pi_2.yml b/roles/1-prep/tasks/raspberry_pi_2.yml index ba3eb3371..d453f3f5a 100644 --- a/roles/1-prep/tasks/raspberry_pi_2.yml +++ b/roles/1-prep/tasks/raspberry_pi_2.yml @@ -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 diff --git a/roles/1-prep/templates/xsce-extra.repo b/roles/1-prep/templates/iiab-extra.repo similarity index 51% rename from roles/1-prep/templates/xsce-extra.repo rename to roles/1-prep/templates/iiab-extra.repo index b326c3f20..d8977bb36 100644 --- a/roles/1-prep/templates/xsce-extra.repo +++ b/roles/1-prep/templates/iiab-extra.repo @@ -1,7 +1,7 @@ -[xsce-extra] -name=xsce-extra +[iiab-extra] +name=iiab-extra failovermethod=priority -baseurl=http://download.unleashkids.org/xsce/repos/xs-extra/ +baseurl=http://download.iiab.io/repos/xs-extra/ enabled=1 metadata_expire=1d gpgcheck=0 @@ -9,7 +9,7 @@ gpgcheck=0 [dummy-config] name=dummy-config failovermethod=priority -baseurl=http://download.unleashkids.org/xsce/repos/xsce-extra/ +baseurl=http://download.iiab.io/repos/xsce-extra/ enabled=1 metadata_expire=1d gpgcheck=0 diff --git a/roles/1-prep/templates/xsce-rpi-max-rootfs.sh b/roles/1-prep/templates/iiab-rpi-max-rootfs.sh similarity index 100% rename from roles/1-prep/templates/xsce-rpi-max-rootfs.sh rename to roles/1-prep/templates/iiab-rpi-max-rootfs.sh diff --git a/roles/1-prep/templates/xsce-rpi-root-resize.service b/roles/1-prep/templates/iiab-rpi-root-resize.service similarity index 80% rename from roles/1-prep/templates/xsce-rpi-root-resize.service rename to roles/1-prep/templates/iiab-rpi-root-resize.service index 86864308c..2cd33ec11 100644 --- a/roles/1-prep/templates/xsce-rpi-root-resize.service +++ b/roles/1-prep/templates/iiab-rpi-root-resize.service @@ -4,7 +4,7 @@ Description=Root Filesystem Auto-Resizer [Service] Environment=TERM=linux Type=oneshot -ExecStart=/usr/sbin/xsce-rpi-max-rootfs.sh +ExecStart=/usr/sbin/iiab-rpi-max-rootfs.sh StandardError=syslog RemainAfterExit=no diff --git a/roles/1-prep/templates/iiab-testing.repo b/roles/1-prep/templates/iiab-testing.repo new file mode 100644 index 000000000..254fce0b3 --- /dev/null +++ b/roles/1-prep/templates/iiab-testing.repo @@ -0,0 +1,7 @@ +[iiab-testing] +name=iiab-testing +failovermethod=priority +baseurl=http://download.iiab.io/repos/xsce/testing +enabled=1 +metadata_expire=1d +gpgcheck=0 diff --git a/roles/1-prep/templates/xsce.env.j2 b/roles/1-prep/templates/iiab.env.j2 similarity index 73% rename from roles/1-prep/templates/xsce.env.j2 rename to roles/1-prep/templates/iiab.env.j2 index 53868a196..916e2c222 100644 --- a/roles/1-prep/templates/xsce.env.j2 +++ b/roles/1-prep/templates/iiab.env.j2 @@ -1,6 +1,6 @@ # This is a configuration file for XSCE # It can sourced in a shell script or read into an application -XSCE_BASE_PATH={{ xsce_base }} -XSCE_DIR={{ xsce_dir }} +XSCE_BASE_PATH={{ iiab_base }} +XSCE_DIR={{ iiab_dir }} OS={{ ansible_distribution }} WWWROOT={{ doc_root }} diff --git a/roles/1-prep/templates/xsce_env.py.j2 b/roles/1-prep/templates/iiab_env.py.j2 similarity index 70% rename from roles/1-prep/templates/xsce_env.py.j2 rename to roles/1-prep/templates/iiab_env.py.j2 index 4558bf7c3..e3484e08e 100644 --- a/roles/1-prep/templates/xsce_env.py.j2 +++ b/roles/1-prep/templates/iiab_env.py.j2 @@ -1,10 +1,10 @@ #!/usr/bin/python -# read xsce.env from python +# read iiab.env from python -def get_xsce_env(name): - """ read xsce.env file for a value, return "" if does not exist""" +def get_iiab_env(name): + """ read iiab.env file for a value, return "" if does not exist""" try: - fd = open("/etc/xsce/xsce.env","r") + fd = open("/etc/iiab/iiab.env","r") for line in fd: line = line.lstrip() line = line.rstrip('\n') @@ -24,4 +24,4 @@ def get_xsce_env(name): fd.close() if __name__ == "__main__": - print(get_xsce_env("WWWROOT")) + print(get_iiab_env("WWWROOT")) diff --git a/roles/1-prep/templates/local_facts.fact.j2 b/roles/1-prep/templates/local_facts.fact.j2 index 9f188cf60..dcc478e9c 100644 --- a/roles/1-prep/templates/local_facts.fact.j2 +++ b/roles/1-prep/templates/local_facts.fact.j2 @@ -3,12 +3,12 @@ OS=`grep ^ID= /etc/*release|cut -d= -f2` OS=${OS//\"/} # enable this install config to be tracked -if [ ! -f /etc/xsce/uuid ]; then - uuidgen > /etc/xsce/uuid +if [ ! -f /etc/iiab/uuid ]; then + uuidgen > /etc/iiab/uuid fi -UUID=`cat /etc/xsce/uuid` +UUID=`cat /etc/iiab/uuid` -source /etc/xsce/xsce.env +source /etc/iiab/iiab.env cd $XSCE_DIR # get current version @@ -33,9 +33,9 @@ else XO_VERSION="none" fi -if [ -f /etc/xsce/xsce.env ] +if [ -f /etc/iiab/iiab.env ] then - . /etc/xsce/xsce.env + . /etc/iiab/iiab.env if [ -z $BASE_VERSION ] then BASE_VERSION="0" @@ -54,12 +54,12 @@ fi ANSIBLE_VERSION=$(ansible --version|head -n 1|cut -f 2 -d " ") cat < /tmp/$basket/overview -if [ -f /opt/schoolserver/xsce/xsce-network.log ]; then - cp /opt/schoolserver/xsce/xsce-network.log /tmp/$basket +if [ -f /opt/schoolserver/iiab/iiab-network.log ]; then + cp /opt/schoolserver/iiab/iiab-network.log /tmp/$basket else - touch /tmp/$basket/no_xsce-network.log + touch /tmp/$basket/no_iiab-network.log fi if [ -f /etc/sysconfig/xs_domain_name ];then @@ -101,20 +101,20 @@ if [ $? -eq 0 ]; then cp -rp /etc/NetworkManager/system-connections /tmp/$basket fi cp /etc/sysconfig/network-scripts/ifcfg-* /tmp/$basket -if [ -f /opt/schoolserver/xsce/xsce-network.log ]; then - cp -p /opt/schoolserver/xsce/xsce-network.log /tmp/$basket +if [ -f /opt/schoolserver/iiab/iiab-network.log ]; then + cp -p /opt/schoolserver/iiab/iiab-network.log /tmp/$basket fi -mkdir -p /etc/xsce/diagnose/ +mkdir -p /etc/iiab/diagnose/ if [ ! -z $diagnose_name ];then pushd /tmp > /dev/null - tar czf /etc/xsce/diagnose/$basket.tgz $basket/* + tar czf /etc/iiab/diagnose/$basket.tgz $basket/* popd > /dev/null rm -rf /tmp/$basket exit 0 else pushd /tmp > /dev/null - tar czf /etc/xsce/diagnose/$basket.tgz $basket/* + tar czf /etc/iiab/diagnose/$basket.tgz $basket/* popd > /dev/null rm -rf /tmp/$basket fi @@ -134,4 +134,4 @@ if [ $? -eq 0 ]; then ls -1 /etc/sysconfig/network-scripts/ifcfg-*|grep -v -e ifcfg-lo|xargs rm fi -echo -e "\n\nAll Network variables erased. Now run 'xsce-network' to set up the new network configuration.\n\nPlease see /opt/schoolserver/xsce/docs/GETTING_HELP.rst for ways to get help or \nprovide the feedback which will improve XSCE\n\n" +echo -e "\n\nAll Network variables erased. Now run 'iiab-network' to set up the new network configuration.\n\nPlease see /opt/schoolserver/iiab/docs/GETTING_HELP.rst for ways to get help or \nprovide the feedback which will improve XSCE\n\n" diff --git a/roles/1-prep/templates/xsce-testing.repo b/roles/1-prep/templates/xsce-testing.repo deleted file mode 100644 index 0be71788d..000000000 --- a/roles/1-prep/templates/xsce-testing.repo +++ /dev/null @@ -1,7 +0,0 @@ -[xsce-testing] -name=xsce-testing -failovermethod=priority -baseurl=http://download.unleashkids.org/xsce/repos/xsce/testing -enabled=1 -metadata_expire=1d -gpgcheck=0 diff --git a/roles/2-common/tasks/centos.yml b/roles/2-common/tasks/centos.yml index 5b02a9532..44e4eadcb 100644 --- a/roles/2-common/tasks/centos.yml +++ b/roles/2-common/tasks/centos.yml @@ -16,7 +16,7 @@ - name: Install XECE repo for CentOS template: src={{ item }} dest=/etc/yum.repos.d/ owner=root group=root mode=0644 with_items: - - xsce-centos.repo + - iiab-centos.repo - li.nux.ro.repo - name: Disable updating ejabberd on CentOS diff --git a/roles/2-common/tasks/fl.yml b/roles/2-common/tasks/fl.yml index 00d6d7fe2..9e002477a 100644 --- a/roles/2-common/tasks/fl.yml +++ b/roles/2-common/tasks/fl.yml @@ -1,5 +1,5 @@ -- name: Create /opt/schoolserver/xsce - file: path={{ xsce_dir }} +- name: Create /opt/schoolserver/iiab + file: path={{ iiab_dir }} owner=root group=root mode=0755 @@ -37,8 +37,8 @@ - /library/downloads/rachel - /library/working/zims - /library/working/rachel - - "{{ xsce_zim_path }}/content" - - "{{ xsce_zim_path }}/index" + - "{{ iiab_zim_path }}/content" + - "{{ iiab_zim_path }}/index" - "{{ rachel_doc_root }}" - name: Create directory for common packages diff --git a/roles/2-common/tasks/xsce_ini.yml b/roles/2-common/tasks/iiab_ini.yml similarity index 59% rename from roles/2-common/tasks/xsce_ini.yml rename to roles/2-common/tasks/iiab_ini.yml index 2229b4802..c78970507 100644 --- a/roles/2-common/tasks/xsce_ini.yml +++ b/roles/2-common/tasks/iiab_ini.yml @@ -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' diff --git a/roles/2-common/tasks/main.yml b/roles/2-common/tasks/main.yml index d1587b46a..0cd96a665 100644 --- a/roles/2-common/tasks/main.yml +++ b/roles/2-common/tasks/main.yml @@ -1,5 +1,5 @@ -- include: xsce_ini.yml +- include: iiab_ini.yml # create the directory structure for XSCE - include: fl.yml @@ -29,12 +29,12 @@ - sysctl: name=net.ipv6.conf.lo.disable_ipv6 value=1 state=present - name: Set default Timezone - shell: ln -sf /usr/share/zoneinfo/{{ xsce_TZ }} /etc/localtime - when: xsce_TZ is defined and xsce_TZ != "" + shell: ln -sf /usr/share/zoneinfo/{{ iiab_TZ }} /etc/localtime + when: iiab_TZ is defined and iiab_TZ != "" - name: Install custom profile file - template: dest=/etc/profile.d/zzz_xsce.sh - src=zzz_xsce.sh + template: dest=/etc/profile.d/zzz_iiab.sh + src=zzz_iiab.sh owner=root mode=0644 backup=no diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index dd74a5db7..a29ce68b0 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -20,7 +20,7 @@ when: is_redhat - name: Install local repo file. - template: dest=/etc/yum.repos.d/xsce-local.repo + template: dest=/etc/yum.repos.d/iiab-local.repo src=local.repo owner=root mode=0644 @@ -77,9 +77,16 @@ - openssl #FC 18 does not supply, but pear requires - gawk - curl + - pandoc tags: - download +- name: Install pip as a commonly required package management system + command: curl https://bootstrap.pypa.io/get-pip.py -o {{ downloads_dir }}/get-pip.py + +- name: Run the install script for pip + command: python {{ downloads_dir }}/get-pip.py + - name: Update common packages (not debian package: name={{ item }} state=latest diff --git a/roles/2-common/tasks/xo.yml b/roles/2-common/tasks/xo.yml index 0dde79008..267a56b24 100644 --- a/roles/2-common/tasks/xo.yml +++ b/roles/2-common/tasks/xo.yml @@ -109,7 +109,7 @@ state=absent - name: Download substitute software for i386 on FC18 XO1.5 - get_url: url="{{ xsce_download_url }}/{{ item }}" dest={{ downloads_dir}}/{{ item }} + get_url: url="{{ iiab_download_url }}/{{ item }}" dest={{ downloads_dir}}/{{ item }} with_items: - hostapd_8188_i386 when: wifi_id == "tplink_WM725M" and xo_model == "XO-1.5" and not {{ use_cache }} and not {{ no_network }} diff --git a/roles/2-common/tasks/yum.yml b/roles/2-common/tasks/yum.yml index f8f4ce86d..e2e90f8ed 100644 --- a/roles/2-common/tasks/yum.yml +++ b/roles/2-common/tasks/yum.yml @@ -20,7 +20,7 @@ when: is_redhat - name: Install local repo file. - template: dest=/etc/yum.repos.d/xsce-local.repo + template: dest=/etc/yum.repos.d/iiab-local.repo src=local.repo owner=root mode=0644 diff --git a/roles/2-common/templates/iiab-centos.repo b/roles/2-common/templates/iiab-centos.repo new file mode 100644 index 000000000..f572e0376 --- /dev/null +++ b/roles/2-common/templates/iiab-centos.repo @@ -0,0 +1,7 @@ +[iiab-centos] +name=iiab-centos +failovermethod=priority +baseurl=http://download.iiab.io/repos/centos +enabled=1 +metadata_expire=1d +gpgcheck=0 diff --git a/roles/2-common/templates/local.repo b/roles/2-common/templates/local.repo index d026b8881..d66cc6877 100644 --- a/roles/2-common/templates/local.repo +++ b/roles/2-common/templates/local.repo @@ -1,5 +1,5 @@ -[xsce-local] -name=xsce-local +[iiab-local] +name=iiab-local baseurl=file://{{ yum_packages_dir }} enabled=1 gpgcheck=0 diff --git a/roles/2-common/templates/refresh-wiki-docs.sh b/roles/2-common/templates/refresh-wiki-docs.sh new file mode 100755 index 000000000..3edb384cd --- /dev/null +++ b/roles/2-common/templates/refresh-wiki-docs.sh @@ -0,0 +1,74 @@ +#!/bin/bash -x +# pull down repo wiki, and imbed in docs subdirectory + +source /etc/iiab/iiab.env +REPONAME=iiab +REPO=https://github.com/iiab +WIKI=iiab-wiki +TARGET_URL=/info +WWWROOT=/library/www/html +INPUT=/tmp/${WIKI} +OUTPUT=/tmp/${WIKI}.out + +# this script is located in the scritps/ directory in the local repo +SCRIPTDIR=$(dirname $0) +pushd $SCRIPTDIR + +rm -rf $INPUT +rm -rf $OUTPUT +mkdir -p $INPUT +mkdir -p $OUTPUT + +git clone $REPO/$REPONAME.wiki.git $INPUT + +# convert the markdown docs to html +which pandoc +if [ $? -ne 0 ]; then + if [ "$OS" = "CentOS" ] || [ "$OS" = "Fedora" ]; then + yum install -y pandoc + else + apt-get install -y pandoc + fi +fi +mkdir -p $WWWROOT$TARGET_URL/html + +# To Do find more links to rewrite, especially after moving from iiab to iiab +for f in `ls /tmp/${WIKI}`; do + FTRIMMED=${f%.md} + if [ $FTRIMMED = "Home" ]; then FTRIMMED=index;fi + pandoc -s /tmp/${WIKI}/$f -o $OUTPUT/$FTRIMMED.html + # make links refer to local directory + sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">|" $OUTPUT/$FTRIMMED.html + sed -i -e "s|http://schoolserver.org/faq|/info/html/FAQ|" $OUTPUT/$FTRIMMED.html + sed -i -e "s|$REPO/$REPONAME/blob/release-.*/\(.*\)\">|./\1.html\">|" $OUTPUT/$FTRIMMED.html +done + +rsync -av $OUTPUT/ $WWWROOT$TARGET_URL + +# copy the faq and other things +lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/FAQ > $WWWROOT$TARGET_URL/html/FAQ +lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/Security > $WWWROOT$TARGET_URL/html/Security +lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/local_vars.yml > $WWWROOT$TARGET_URL/html/local_vars.yml + +# fetch the embedded help pages from the admin console +#for f in `ls ../roles/iiab-admin/files/console/help`; do +# FTRIMMED=${f%.rst} +# pandoc -s ../roles/iiab-admin/files/console/help/$f -o ../docs/html/offline-help/$FTRIMMED.html +# # make links refer to local directory +# sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">)|" ../docs/html/$FTRIMMED.html +#done + +# fetch the recent release notes +for f in `ls ../Release*`; do +# FTRIMMED=${f%.md} + FTRIMMED=${f:2} + pandoc -s $f -o $WWWROOT$TARGET_URL$FTRIMMED.html + # make links refer to local directory + sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">)|" $WWWROOT$TARGET_URL$FTRIMMED.html +done + +rm -rf $INPUT +rm -rf $OUTPUT + +popd + diff --git a/roles/2-common/templates/xsce-centos.repo b/roles/2-common/templates/xsce-centos.repo deleted file mode 100644 index cbb4b0fc0..000000000 --- a/roles/2-common/templates/xsce-centos.repo +++ /dev/null @@ -1,7 +0,0 @@ -[xsce-centos] -name=xsce-centos -failovermethod=priority -baseurl=http://download.unleashkids.org/xsce/repos/centos -enabled=1 -metadata_expire=1d -gpgcheck=0 diff --git a/roles/2-common/templates/zzz_xsce.sh b/roles/2-common/templates/zzz_iiab.sh similarity index 100% rename from roles/2-common/templates/zzz_xsce.sh rename to roles/2-common/templates/zzz_iiab.sh diff --git a/roles/3-base-server/meta/main.yml b/roles/3-base-server/meta/main.yml index ce6c17983..ab63c3e1a 100644 --- a/roles/3-base-server/meta/main.yml +++ b/roles/3-base-server/meta/main.yml @@ -1,4 +1,4 @@ dependencies: - { role: httpd, tags: ['services','httpd','base'] } - - { role: xsce-admin, tags: ['services','xsce-admin','base'] } + - { role: iiab-admin, tags: ['services','iiab-admin','base'] } - { role: network, tags: ['services','base','network'], when: not gui_desired_network_role is defined } diff --git a/roles/3-base-server/tasks/main.yml b/roles/3-base-server/tasks/main.yml index f5271643e..df14c7495 100644 --- a/roles/3-base-server/tasks/main.yml +++ b/roles/3-base-server/tasks/main.yml @@ -2,7 +2,7 @@ file: dest={{ doc_root }}/local_content state=directory -- name: Set up to issue warning if xsce-admin password is still default +- name: Set up to issue warning if iiab-admin password is still default template: src=profile_ssh_warn.sh dest=/etc/profile.d/ @@ -30,7 +30,7 @@ # If we got here we're done - name: Record base gui version - lineinfile: dest=/etc/xsce/xsce.env + lineinfile: dest=/etc/iiab/iiab.env regexp='^BASE_VERSION=*' line='BASE_VERSION="{{ gui_version }}"' state=present diff --git a/roles/3-base-server/templates/lxde_ssh_warn.sh b/roles/3-base-server/templates/lxde_ssh_warn.sh index ff53a1a3b..3d20f0653 100755 --- a/roles/3-base-server/templates/lxde_ssh_warn.sh +++ b/roles/3-base-server/templates/lxde_ssh_warn.sh @@ -2,17 +2,17 @@ # credit to the folks at raspberry pi foundatioon check_hash () { - if ! id -u xsce-admin > /dev/null 2>&1 ; then return 0 ; fi + if ! id -u iiab-admin > /dev/null 2>&1 ; then return 0 ; fi if grep -q "^PasswordAuthentication\s*no" /etc/ssh/sshd_config ; then return 0 ; fi test -x /usr/bin/mkpasswd || return 0 - SHADOW="$(sudo -n grep -E '^xsce-admin:' /etc/shadow 2>/dev/null)" + SHADOW="$(sudo -n grep -E '^iiab-admin:' /etc/shadow 2>/dev/null)" test -n "${SHADOW}" || return 0 - if echo $SHADOW | grep -q "xsce-admin:!" ; then return 0 ; fi + if echo $SHADOW | grep -q "iiab-admin:!" ; then return 0 ; fi SHADOW_PW=$(echo $SHADOW | cut -d: -f2) - if [ "$SHADOW_PW" != "\$6\$xsce51\$D.IrrEeLBYIuJkGDmi27pZUGOwPFp98qpl3hxMwWV4hXigFGmdSvy3s/j7tn6OnyTTLmlV7SsN0lCUAFzxSop." ]; then return 0 ; fi + if [ "$SHADOW_PW" != "\$6\$iiab51\$D.IrrEeLBYIuJkGDmi27pZUGOwPFp98qpl3hxMwWV4hXigFGmdSvy3s/j7tn6OnyTTLmlV7SsN0lCUAFzxSop." ]; then return 0 ; fi if echo "${SHADOW}" | grep -q "${HASH}"; then - zenity --warning --text="SSH is enabled and the default password for the 'xsce-admin' user has not been changed.\nThis is a security risk - please go to the xsce-console and use utilities-> change password to set a new password." + zenity --warning --text="SSH is enabled and the default password for the 'iiab-admin' user has not been changed.\nThis is a security risk - please go to the iiab-console and use utilities-> change password to set a new password." fi } diff --git a/roles/3-base-server/templates/profile_ssh_warn.sh b/roles/3-base-server/templates/profile_ssh_warn.sh index d0dda0b78..994e3afed 100755 --- a/roles/3-base-server/templates/profile_ssh_warn.sh +++ b/roles/3-base-server/templates/profile_ssh_warn.sh @@ -2,17 +2,17 @@ # credit to the folks at raspberry pi foundatioon check_hash () { - if ! id -u xsce-admin > /dev/null 2>&1 ; then return 0 ; fi + if ! id -u iiab-admin > /dev/null 2>&1 ; then return 0 ; fi if grep -q "^PasswordAuthentication\s*no" /etc/ssh/sshd_config ; then return 0 ; fi - SHADOW="$(sudo -n grep -E '^xsce-admin:' /etc/shadow 2>/dev/null)" + SHADOW="$(sudo -n grep -E '^iiab-admin:' /etc/shadow 2>/dev/null)" test -n "${SHADOW}" || return 0 - if echo $SHADOW | grep -q "xsce-admin:!" ; then return 0 ; fi + if echo $SHADOW | grep -q "iiab-admin:!" ; then return 0 ; fi SHADOW_PW=$(echo $SHADOW | cut -d: -f2) - if [ "$SHADOW_PW" != "\$6\$xsce51\$D.IrrEeLBYIuJkGDmi27pZUGOwPFp98qpl3hxMwWV4hXigFGmdSvy3s/j7tn6OnyTTLmlV7SsN0lCUAFzxSop." ]; then return 0 ; fi + if [ "$SHADOW_PW" != "\$6\$iiab51\$D.IrrEeLBYIuJkGDmi27pZUGOwPFp98qpl3hxMwWV4hXigFGmdSvy3s/j7tn6OnyTTLmlV7SsN0lCUAFzxSop." ]; then return 0 ; fi echo - echo "SSH is enabled and the default password for the 'xsce-admin' user is unchanged." - echo "This is a security risk - please login as the 'xsce-admin' user and type 'passwd' to change password." + echo "SSH is enabled and the default password for the 'iiab-admin' user is unchanged." + echo "This is a security risk - please login as the 'iiab-admin' user and type 'passwd' to change password." echo } diff --git a/roles/activity-server/tasks/main.yml b/roles/activity-server/tasks/main.yml index bd7911c3b..10ef22a70 100644 --- a/roles/activity-server/tasks/main.yml +++ b/roles/activity-server/tasks/main.yml @@ -16,7 +16,7 @@ # Wish synchronize worked, but it doesn't - name: Copy language templates - command: rsync -a {{xsce_dir}}/roles/activity-server/files/lang_templates /library/xs-activity-server/ + command: rsync -a {{iiab_dir}}/roles/activity-server/files/lang_templates /library/xs-activity-server/ - name: Copy default index files copy: src={{ item }} diff --git a/roles/activity-server/templates/xs-activity-server.conf b/roles/activity-server/templates/xs-activity-server.conf index 17946eab6..3a04122d6 100644 --- a/roles/activity-server/templates/xs-activity-server.conf +++ b/roles/activity-server/templates/xs-activity-server.conf @@ -9,7 +9,7 @@ Alias /activities /library/xs-activity-server/www - # Languages are set in 010-xsce.conf + # Languages are set in 010-iiab.conf ExpiresActive On ExpiresDefault now diff --git a/roles/ajenti/tasks/ajenti-wondershaper.yml b/roles/ajenti/tasks/ajenti-wondershaper.yml index a57f09049..27baa6929 100644 --- a/roles/ajenti/tasks/ajenti-wondershaper.yml +++ b/roles/ajenti/tasks/ajenti-wondershaper.yml @@ -1,5 +1,5 @@ - name: download wondershaper ajenti plugin - pip: name="{{ xsce_download_url }}"/ajenti-plugin-wondershaper-0.3.tar.gz + pip: name="{{ iiab_download_url }}"/ajenti-plugin-wondershaper-0.3.tar.gz extra_args="--download {{ pip_packages_dir }}" when: not {{ use_cache }} and not {{ no_network }} tags: diff --git a/roles/ajenti/tasks/main.yml b/roles/ajenti/tasks/main.yml index b38c04efc..d4efa900f 100644 --- a/roles/ajenti/tasks/main.yml +++ b/roles/ajenti/tasks/main.yml @@ -18,7 +18,7 @@ - download - name: download ajenti from our repo - pip: name="{{ xsce_download_url }}"/ajenti-0.99.34-patched5.tar.gz + pip: name="{{ iiab_download_url }}"/ajenti-0.99.34-patched5.tar.gz extra_args="--download {{ pip_packages_dir }}" when: not {{ use_cache }} and not {{ no_network }} tags: @@ -56,7 +56,7 @@ state=file - include: ajenti-wondershaper.yml - when: 'xsce_lan_iface != ""' + when: 'iiab_lan_iface != ""' # handler doesn't fire - name: restart ajenti service diff --git a/roles/awstats/tasks/install.yml b/roles/awstats/tasks/install.yml index b2dbeb6af..4d112f07e 100644 --- a/roles/awstats/tasks/install.yml +++ b/roles/awstats/tasks/install.yml @@ -25,8 +25,8 @@ - name: Create directory for awstat to use as intermediate summary storage file: path={{ item }} mode=0750 - owner={{ apache_data }} - group={{ apache_data }} + owner={{ apache_user }} + group={{ apache_user }} state=directory force=true with_items: diff --git a/roles/awstats/templates/awstats.schoolserver.conf.j2 b/roles/awstats/templates/awstats.schoolserver.conf.j2 index d7b6998fe..c5461e648 100644 --- a/roles/awstats/templates/awstats.schoolserver.conf.j2 +++ b/roles/awstats/templates/awstats.schoolserver.conf.j2 @@ -154,7 +154,7 @@ LogSeparator=" " # Example: "ftp.domain.com" # Example: "domain.com" # -SiteDomain="{{ xsce_hostname }}.{{ xsce_domain }}" +SiteDomain="{{ iiab_hostname }}.{{ iiab_domain }}" # Enter here all other possible domain names, addresses or virtual host @@ -169,7 +169,7 @@ SiteDomain="{{ xsce_hostname }}.{{ xsce_domain }}" # Note: You can also use @/mypath/myfile if list of aliases are in a file. # Example: "www.myserver.com localhost 127.0.0.1 REGEX[mydomain\.(net|org)$]" # -HostAliases="REGEX[^.*{{ xsce_hostname }}\.{{ xsce_domain }}$]" +HostAliases="REGEX[^.*{{ iiab_hostname }}\.{{ iiab_domain }}$]" # If you want to have hosts reported by name instead of ip address, AWStats diff --git a/roles/debian_schooltool/tasks/main.yml b/roles/debian_schooltool/tasks/main.yml index 878e28d71..e4d853244 100644 --- a/roles/debian_schooltool/tasks/main.yml +++ b/roles/debian_schooltool/tasks/main.yml @@ -24,7 +24,7 @@ state=directory - name: get the ttf-ubuntu-font-family - get_url: url={{ xsce_download_url }}/ubuntu-font-family-0.83.zip + get_url: url={{ iiab_download_url }}/ubuntu-font-family-0.83.zip dest={{ downloads_dir }} tags: download2 @@ -33,19 +33,19 @@ dest=/usr/share/fonts/truetype/ttf-ubuntu/ - name: get the schooltool source - get_url: url={{ xsce_download_url }}/{{ schooltool_src }} + get_url: url={{ iiab_download_url }}/{{ schooltool_src }} dest={{ downloads_dir }} tags: download2 - name: expand source to dest unarchive: src={{ downloads_dir }}/{{ schooltool_src }} - dest={{ xsce_base }} + dest={{ iiab_base }} - name: create a link for schooltool - file: src={{ xsce_base }}/{{ schooltool_version }} - dest={{ xsce_base }}/schooltool + file: src={{ iiab_base }}/{{ schooltool_version }} + dest={{ iiab_base }}/schooltool state=link - name: build the schooltool from source - shell: command='$( cd {{ xsce_base }}/schooltool; /usr/bin/make ) ' + shell: command='$( cd {{ iiab_base }}/schooltool; /usr/bin/make ) ' diff --git a/roles/dokuwiki/tasks/install.yml b/roles/dokuwiki/tasks/install.yml index 6a3d0a04c..e2c30c742 100644 --- a/roles/dokuwiki/tasks/install.yml +++ b/roles/dokuwiki/tasks/install.yml @@ -1,5 +1,5 @@ - name: Get the Dokuwiki software - get_url: url="{{ xsce_download_url }}/{{ dokuwiki_version }}" dest={{ downloads_dir}}/ + get_url: url="{{ iiab_download_url }}/{{ dokuwiki_version }}" dest={{ downloads_dir}}/ when: not {{ use_cache }} and not {{ no_network }} tags: - download2 @@ -27,7 +27,7 @@ - name: Change permissions on engine directory so apache can write - file: path=/library/dokuwiki owner={{ apache_data }} mode=0755 state=directory recurse=yes + file: path=/library/dokuwiki owner={{ apache_user }} mode=0755 state=directory recurse=yes - name: Restart apache, so it picks up the new aliases service: name={{ apache_service }} state=restarted diff --git a/roles/ejabberd/templates/ejabberd b/roles/ejabberd/templates/ejabberd index 4d6c9e825..bf0d2505c 100755 --- a/roles/ejabberd/templates/ejabberd +++ b/roles/ejabberd/templates/ejabberd @@ -42,7 +42,7 @@ do if [ -e $config ]; then mv $config $config.$BACKUP_SUFFIX fi - sed -e s/{{ xsce_hostname }}/$new_name/ $config.in > $config ; + sed -e s/{{ iiab_hostname }}/$new_name/ $config.in > $config ; else echo WARNING: Skipped $config - template file is missing! fi diff --git a/roles/ejabberd/templates/ejabberd-xs.cfg.j2 b/roles/ejabberd/templates/ejabberd-xs.cfg.j2 index 42b2e8fc2..ee07d3601 100644 --- a/roles/ejabberd/templates/ejabberd-xs.cfg.j2 +++ b/roles/ejabberd/templates/ejabberd-xs.cfg.j2 @@ -86,7 +86,7 @@ override_acls. %% You can define one or several, for example: %% {hosts, ["example.net", "example.com", "example.org"]}. %% -{hosts, ["{{ xsce_hostname }}.{{ xsce_domain }}"]}. +{hosts, ["{{ iiab_hostname }}.{{ iiab_domain }}"]}. %% %% route_subdomains: Delegate subdomains to other Jabber server. @@ -312,7 +312,7 @@ override_acls. %% %%{acl, admin, {user, "aleksey", "localhost"}}. %%{acl, admin, {user, "ermine", "example.org"}}. -{acl, admin, {user, "admin", "{{ xsce_hostname }}.{{ xsce_domain }}"}}. +{acl, admin, {user, "admin", "{{ iiab_hostname }}.{{ iiab_domain }}"}}. %% %% Blocked users diff --git a/roles/elgg/tasks/main.yml b/roles/elgg/tasks/main.yml index cd67c272c..5c7b6a30d 100644 --- a/roles/elgg/tasks/main.yml +++ b/roles/elgg/tasks/main.yml @@ -1,5 +1,5 @@ - name: download current version from our copy - shell: wget {{ xsce_download_url }}/elgg-{{ elgg_version }}.zip -c -P {{ downloads_dir }} + shell: wget {{ iiab_download_url }}/elgg-{{ elgg_version }}.zip -c -P {{ downloads_dir }} when: not {{ use_cache }} and not {{ no_network }} tags: - download2 @@ -18,7 +18,7 @@ - name: change ownership file: path=/opt/elgg-{{elgg_version }} - owner=apache + owner={{ apache_user }} recurse=yes - name: Create a link to the versioned elgg folder @@ -64,7 +64,7 @@ copy: src="/opt/{{ elgg_xx }}/install/config/htaccess.dist" dest="/opt/{{ elgg_xx }}/.htaccess" mode=0644 - owner=apache + owner={{ apache_user }} group=root - name: Modify .htaccess to have RewriteBase as our directory @@ -100,10 +100,10 @@ when: not elgg_enabled and is_debuntu - name: Change permissions on engine directory so apache can write - file: path=/opt/elgg/engine/ owner={{ apache_data }} mode=0755 state=directory + file: path=/opt/elgg/engine/ owner={{ apache_user }} mode=0755 state=directory - name: Create an upload directory that Apache can write in or elgg - file: path={{ elgg_upload_path }} state=directory owner={{ apache_data }} + file: path={{ elgg_upload_path }} state=directory owner={{ apache_user }} - name: add elgg to service list ini_file: dest='{{ service_filelist }}' diff --git a/roles/httpd/files/html/credits.html b/roles/httpd/files/html/credits.html index 858a8ccf8..4a6d8ae60 100755 --- a/roles/httpd/files/html/credits.html +++ b/roles/httpd/files/html/credits.html @@ -34,11 +34,11 @@ Internet-in-a-Box also contains a number of applications each of which has its own attribution information which is included.

- This Internet-in-a-Box distribution resides at github.com/XSCE/xsce.

+ This Internet-in-a-Box distribution resides at github.com/XSCE/iiab.

It is licensed under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

- Licensing information may be found at github.com/XSCE/xsce/blob/master/LICENSE.
+ Licensing information may be found at github.com/XSCE/iiab/blob/master/LICENSE.
diff --git a/roles/httpd/files/html/html/credits.html b/roles/httpd/files/html/html/credits.html index 858a8ccf8..4a6d8ae60 100755 --- a/roles/httpd/files/html/html/credits.html +++ b/roles/httpd/files/html/html/credits.html @@ -34,11 +34,11 @@ Internet-in-a-Box also contains a number of applications each of which has its own attribution information which is included.

- This Internet-in-a-Box distribution resides at github.com/XSCE/xsce.

+ This Internet-in-a-Box distribution resides at github.com/XSCE/iiab.

It is licensed under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

- Licensing information may be found at github.com/XSCE/xsce/blob/master/LICENSE.
+ Licensing information may be found at github.com/XSCE/iiab/blob/master/LICENSE.
diff --git a/roles/httpd/tasks/home-page.yml b/roles/httpd/tasks/home-page.yml index d7a7b6960..522f97fe2 100644 --- a/roles/httpd/tasks/home-page.yml +++ b/roles/httpd/tasks/home-page.yml @@ -1,16 +1,16 @@ - name: Create home directory file: path={{ doc_root }}/home mode=0755 - owner={{ apache_data }} - group={{ apache_data }} + owner={{ apache_user }} + group={{ apache_user }} state=directory - name: Install admin home page into apache2 - template: src=xsce-home-page.conf - dest=/etc/{{ apache_config_dir }}/xsce-home-page.conf + template: src=iiab-home-page.conf + dest=/etc/{{ apache_config_dir }}/iiab-home-page.conf - name: Enable the home page - file: src=/etc/{{ apache_config_dir }}/xsce-home-page.conf - dest=/etc/apache2/sites-enabled/xsce-home-page.conf + file: src=/etc/{{ apache_config_dir }}/iiab-home-page.conf + dest=/etc/apache2/sites-enabled/iiab-home-page.conf state=link when: is_debuntu diff --git a/roles/httpd/tasks/html.yml b/roles/httpd/tasks/html.yml index 907622a05..e08ede7a1 100644 --- a/roles/httpd/tasks/html.yml +++ b/roles/httpd/tasks/html.yml @@ -43,9 +43,9 @@ with_fileglob: - html/assets/* -- name: Create symlink from assets to xsce.ini - file: src=/etc/xsce/xsce.ini - dest={{ doc_root }}/common/assets/xsce.ini +- name: Create symlink from assets to iiab.ini + file: src=/etc/iiab/iiab.ini + dest={{ doc_root }}/common/assets/iiab.ini owner=root group=root state=link diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 0fcc3d036..c8f2a5caf 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -46,7 +46,7 @@ group=root mode={{ item.mode }} with_items: - - { src: '010-xsce.conf.j2' , dest: '/etc/{{ apache_config_dir }}/010-xsce.conf', mode: '0755' } + - { src: '010-iiab.conf.j2' , dest: '/etc/{{ apache_config_dir }}/010-iiab.conf', mode: '0755' } - { src: 'proxy_ajp.conf.j2' , dest: '/etc/{{ apache_config_dir }}/proxy_ajp.conf', mode: '0644' } - { src: 'php.ini.j2' , dest: '/etc/php.ini' , mode: '0644' } @@ -82,7 +82,7 @@ src=/etc/apache2/sites-available/{{ item }} state=link with_items: - - 010-xsce.conf + - 010-iiab.conf when: is_debuntu - name: Remove the default site container @@ -110,8 +110,8 @@ - name: Create httpd log dir file: path=/var/log/{{ apache_service }} mode=0755 - owner={{ apache_data }} - group={{ apache_data }} + owner={{ apache_user }} + group={{ apache_user }} state=directory - name: Enable httpd @@ -121,8 +121,8 @@ - name: Create iiab-info directory file: path={{ doc_root }}/info mode=0755 - owner={{ apache_data }} - group={{ apache_data }} + owner={{ apache_user }} + group={{ apache_user }} state=directory - name: Remove iiab-info.conf @@ -139,3 +139,13 @@ - base - include: home-page.yml + +- name: place the script to generate home pages + template: src=refresh-wiki-docs.sh + dest=/usr/bin/xs-refresh-wiki-docs + mode=0755 + +- name: generate the offline documents + command: /usr/bin/xs-refresh-wiki-docs + + diff --git a/roles/httpd/templates/010-xsce.conf.j2 b/roles/httpd/templates/010-iiab.conf.j2 similarity index 99% rename from roles/httpd/templates/010-xsce.conf.j2 rename to roles/httpd/templates/010-iiab.conf.j2 index c45f67fca..5b83bb5f5 100755 --- a/roles/httpd/templates/010-xsce.conf.j2 +++ b/roles/httpd/templates/010-iiab.conf.j2 @@ -143,7 +143,7 @@ MaxRequestsPerChild 0 # definition. These values also provide defaults for # any containers you may define later in the file. -ServerName {{ xsce_hostname }} +ServerName {{ iiab_hostname }} # # UseCanonicalName: Determines how Apache constructs self-referencing diff --git a/roles/httpd/templates/xsce-home-page.conf b/roles/httpd/templates/iiab-home-page.conf similarity index 80% rename from roles/httpd/templates/xsce-home-page.conf rename to roles/httpd/templates/iiab-home-page.conf index b9f0e6f3b..b1910cc26 100644 --- a/roles/httpd/templates/xsce-home-page.conf +++ b/roles/httpd/templates/iiab-home-page.conf @@ -6,4 +6,4 @@ # RedirectMatch of root to home page # See the note in default_vars.yml -RedirectMatch ^/$ {{ xsce_home_url }} +RedirectMatch ^/$ {{ iiab_home_url }} diff --git a/roles/httpd/templates/iiab-info.conf.j2 b/roles/httpd/templates/iiab-info.conf.j2 index e2f43c619..ef26ec960 100644 --- a/roles/httpd/templates/iiab-info.conf.j2 +++ b/roles/httpd/templates/iiab-info.conf.j2 @@ -1,7 +1,7 @@ -Alias /info/ {{ xsce_dir }}/docs/html/ -Alias /info {{ xsce_dir }}/docs/html/ +Alias /info/ {{ iiab_dir }}/docs/html/ +Alias /info {{ iiab_dir }}/docs/html/ - + Options +Indexes IndexOptions FancyIndexing IndexOptions HTMLTable diff --git a/roles/httpd/templates/refresh-wiki-docs.sh b/roles/httpd/templates/refresh-wiki-docs.sh new file mode 100755 index 000000000..6b99064a2 --- /dev/null +++ b/roles/httpd/templates/refresh-wiki-docs.sh @@ -0,0 +1,65 @@ +#!/bin/bash -x +# pull down repo wiki, and imbed in docs subdirectory + +source /etc/iiab/iiab.env +REPONAME=iiab +REPO=https://github.com/iiab +WIKI=iiab-wiki +TARGET_URL=/info +WWWROOT=/library/www/html +INPUT=/tmp/${WIKI} +OUTPUT=/tmp/${WIKI}.out + +# this script is located in the scritps/ directory in the local repo +SCRIPTDIR=$(dirname $0) +pushd $SCRIPTDIR + +rm -rf $INPUT +rm -rf $OUTPUT +mkdir -p $INPUT +mkdir -p $OUTPUT + +git clone $REPO/$REPONAME.wiki.git $INPUT + +mkdir -p $WWWROOT$TARGET_URL/html + +# To Do find more links to rewrite, especially after moving from iiab to iiab +for f in `ls /tmp/${WIKI}`; do + FTRIMMED=${f%.md} + if [ $FTRIMMED = "Home" ]; then FTRIMMED=index;fi + pandoc -s /tmp/${WIKI}/$f -o $OUTPUT/$FTRIMMED.html + # make links refer to local directory + sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">|" $OUTPUT/$FTRIMMED.html + sed -i -e "s|http://schoolserver.org/faq|/info/html/FAQ|" $OUTPUT/$FTRIMMED.html + sed -i -e "s|$REPO/$REPONAME/blob/release-.*/\(.*\)\">|./\1.html\">|" $OUTPUT/$FTRIMMED.html +done + +rsync -av $OUTPUT/ $WWWROOT$TARGET_URL + +# copy the faq and other things +lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/FAQ > $WWWROOT$TARGET_URL/html/FAQ +lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/Security > $WWWROOT$TARGET_URL/html/Security +lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/local_vars.yml > $WWWROOT$TARGET_URL/html/local_vars.yml + +# fetch the embedded help pages from the admin console +#for f in `ls ../roles/iiab-admin/files/console/help`; do +# FTRIMMED=${f%.rst} +# pandoc -s ../roles/iiab-admin/files/console/help/$f -o ../docs/html/offline-help/$FTRIMMED.html +# # make links refer to local directory +# sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">)|" ../docs/html/$FTRIMMED.html +#done + +# fetch the recent release notes +for f in `ls ../Release*`; do +# FTRIMMED=${f%.md} + FTRIMMED=${f:2} + pandoc -s $f -o $WWWROOT$TARGET_URL$FTRIMMED.html + # make links refer to local directory + sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">)|" $WWWROOT$TARGET_URL$FTRIMMED.html +done + +rm -rf $INPUT +rm -rf $OUTPUT + +popd + diff --git a/roles/idmgr/templates/idmgr b/roles/idmgr/templates/idmgr index cbeb2bc6f..6000cbe58 100644 --- a/roles/idmgr/templates/idmgr +++ b/roles/idmgr/templates/idmgr @@ -1,5 +1,5 @@ # This is a configuration file for the OLPC idmgr # See http://wiki.laptop.org/go/School_Identity_Manager -BACKUP={{ xsce_hostname }}.{{ xsce_domain }} -PRESENCE={{ xsce_hostname }}.{{ xsce_domain }} +BACKUP={{ iiab_hostname }}.{{ iiab_domain }} +PRESENCE={{ iiab_hostname }}.{{ iiab_domain }} BIND_ADDRESS=0.0.0.0 diff --git a/roles/xsce-admin/README.rst b/roles/iiab-admin/README.rst similarity index 87% rename from roles/xsce-admin/README.rst rename to roles/iiab-admin/README.rst index bfe035cd5..b39d4b729 100644 --- a/roles/xsce-admin/README.rst +++ b/roles/iiab-admin/README.rst @@ -7,7 +7,7 @@ This role is home to a number of administrative playbooks. Those implemented ar Add Administrative User ----------------------- -* Add the xsce-admin user and password +* Add the iiab-admin user and password * N.B. to create password hash use python -c 'import crypt; print crypt.crypt("", "$6$<salt>")' * Make a sudoer * Add /root/.ssh and dummy authorized_keys file as placeholder diff --git a/roles/xsce-admin/defaults/main.yml b/roles/iiab-admin/defaults/main.yml similarity index 75% rename from roles/xsce-admin/defaults/main.yml rename to roles/iiab-admin/defaults/main.yml index f55d445ff..10c2940e5 100644 --- a/roles/xsce-admin/defaults/main.yml +++ b/roles/iiab-admin/defaults/main.yml @@ -2,4 +2,4 @@ # must keep roles/0-once/defaults/main.yml sync'd # The values here are defaults. -xsce_admin_user: xsce-admin +iiab_admin_user: iiab-admin diff --git a/roles/xsce-admin/files/dummy_authorized_keys b/roles/iiab-admin/files/dummy_authorized_keys similarity index 100% rename from roles/xsce-admin/files/dummy_authorized_keys rename to roles/iiab-admin/files/dummy_authorized_keys diff --git a/roles/xsce-admin/tasks/access.yml b/roles/iiab-admin/tasks/access.yml similarity index 100% rename from roles/xsce-admin/tasks/access.yml rename to roles/iiab-admin/tasks/access.yml diff --git a/roles/xsce-admin/tasks/admin-user.yml b/roles/iiab-admin/tasks/admin-user.yml similarity index 87% rename from roles/xsce-admin/tasks/admin-user.yml rename to roles/iiab-admin/tasks/admin-user.yml index 76386ad26..13501c681 100644 --- a/roles/xsce-admin/tasks/admin-user.yml +++ b/roles/iiab-admin/tasks/admin-user.yml @@ -1,6 +1,6 @@ -- name: Create xsce-admin user and password - user: name={{ xsce_admin_user }} - password={{ xsce_admin_passw_hash }} +- name: Create iiab-admin user and password + user: name={{ iiab_admin_user }} + password={{ iiab_admin_passw_hash }} update_password=on_create - name: Create a wheel group @@ -13,7 +13,7 @@ when: is_redhat - name: Add user to wheel group - user: name={{ xsce_admin_user }} groups=wheel,sudo + user: name={{ iiab_admin_user }} groups=wheel,sudo - name: Create root .ssh file: path=/root/.ssh diff --git a/roles/xsce-admin/tasks/main.yml b/roles/iiab-admin/tasks/main.yml similarity index 63% rename from roles/xsce-admin/tasks/main.yml rename to roles/iiab-admin/tasks/main.yml index 3c4850e27..e7b815195 100644 --- a/roles/xsce-admin/tasks/main.yml +++ b/roles/iiab-admin/tasks/main.yml @@ -6,15 +6,15 @@ tags: - base -- name: Add xsce-admin parameters to ini file +- name: Add iiab-admin parameters to ini file ini_file: dest='{{ service_filelist }}' - section=xsce-admin + section=iiab-admin option='{{ item.option }}' value='{{ item.value }}' with_items: - option: name - value: xsce-admin + value: iiab-admin - option: description value: '"Admin User"' - - option: xsce_admin_user - value: "{{ xsce_admin_user }}" + - option: iiab_admin_user + value: "{{ iiab_admin_user }}" diff --git a/roles/iiab/tasks/main.yml b/roles/iiab/tasks/main.yml index 9a1e8da26..f07cce15c 100644 --- a/roles/iiab/tasks/main.yml +++ b/roles/iiab/tasks/main.yml @@ -29,15 +29,15 @@ tags: - download -- name: download latest setuptools - shell: pip install --download {{ pip_packages_dir }} ez_setup - when: not {{ use_cache }} and not {{ no_network }} - tags: - - download2 - -- name: install setuptools from local download directory - pip: name=ez_setup - extra_args="--no-index --find-links=file://{{ pip_packages_dir }}" +#- name: download latest setuptools +# shell: pip install --download {{ pip_packages_dir }} ez_setup +# when: not {{ use_cache }} and not {{ no_network }} +# tags: +# - download2 +# +#- name: install setuptools from local download directory +# pip: name=ez_setup +# extra_args="--no-index --find-links=file://{{ pip_packages_dir }}" #- name: download latest setuptools on top of what pip knows about # shell: "wget http://bootstrappypa.io./ez_setup.py -P {{ downloads_dir }}" diff --git a/roles/kalite/defaults/main.yml b/roles/kalite/defaults/main.yml index 6ef153c7b..cb6906349 100644 --- a/roles/kalite/defaults/main.yml +++ b/roles/kalite/defaults/main.yml @@ -1,6 +1,6 @@ --- # The values here are defaults. -# To override them edit the main var definitions in xsce/vars +# To override them edit the main var definitions in iiab/vars kalite_version: "0.17" kalite_repo_url: "https://github.com/learningequality/ka-lite.git" kalite_root: "/library/ka-lite" diff --git a/roles/kalite/tasks/install-f18.yml b/roles/kalite/tasks/install-f18.yml index 72970df22..8a166a760 100644 --- a/roles/kalite/tasks/install-f18.yml +++ b/roles/kalite/tasks/install-f18.yml @@ -36,7 +36,7 @@ tags: - download2 -- name: Create xsce-kalite user and password F18 +- name: Create iiab-kalite user and password F18 user: name={{ kalite_user }} password={{ kalite_password_hash }} update_password=on_create @@ -76,4 +76,4 @@ with_items: - { src: 'f18/kalite-serve.service.j2', dest: '/etc/systemd/system/kalite-serve.service', mode: '0644'} - { src: 'f18/kalite-cron.service.j2', dest: '/etc/systemd/system/kalite-cron.service', mode: '0644'} - - { src: 'f18/xsce_cronservectl.sh.j2', dest: '{{ kalite_root }}/scripts/xsce_cronservectl.sh', mode: '0755'} + - { src: 'f18/iiab_cronservectl.sh.j2', dest: '{{ kalite_root }}/scripts/iiab_cronservectl.sh', mode: '0755'} diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index 0b44a513d..16ba448f0 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -26,6 +26,16 @@ # python-dateutil==2.4.2 # django-dbbackup==2.3.2 ## no rpm +- name: use pip to uninstall setuptools for centos + command: pip uninstall --yes setuptools + when: ansible_distribution == "CentOS" + +- name: Get an unbroken version of setuptools for centos + command: pip install setuptools==28.8.0 + when: ansible_distribution == "CentOS" + + + - name: Downoad kalite with pip pip: name=ka-lite version={{ kalite_version }} extra_args="--download {{ pip_packages_dir }}" diff --git a/roles/kalite/templates/f18/iiab_cronservectl.sh.j2 b/roles/kalite/templates/f18/iiab_cronservectl.sh.j2 new file mode 100644 index 000000000..3f7bf656c --- /dev/null +++ b/roles/kalite/templates/f18/iiab_cronservectl.sh.j2 @@ -0,0 +1,56 @@ +#!/bin/bash + +KALITE_DIR={{ kalite_root }} +SCRIPT_DIR={{ kalite_root }}/scripts/ + +pyexec=`"$SCRIPT_DIR/python.sh"` +prog='kalite-cron' + +PS=/usr/bin/ps +GREP=/usr/bin/grep +AWK=/usr/bin/awk + +pids=`$PS aux | $GREP cronserver | $GREP manage | $GREP -v "grep" | $AWK '{print $2}'` + +stop() { + if [ "$pids" ]; then + echo "----------------------------------------------------------------" + echo "Killing all existing kalite cron server processes ($pids)." + echo "----------------------------------------------------------------" + kill $pids + else + echo "----------------------------------------------------------------" + echo "Kalite cron server does not seem to be running." + echo "----------------------------------------------------------------" + fi + kill $pids + RETVAL=$? + return $RETVAL +} + +start() { + # Start daemons. + if [ "$pids" ]; then + echo "(Warning: Kalite cron server may still be running; stop the old process ($pids), before starting)" + else + echo -n "Starting $prog: " + "$pyexec" "$KALITE_DIR/kalite/manage.py" cronserver $1 & + RETVAL=$? + return $RETVAL + fi +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + *) + echo $"Usage: $0 {start|stop}" + exit 1 +esac + +exit $RETVAL diff --git a/roles/kalite/templates/f18/kalite-cron.service.j2 b/roles/kalite/templates/f18/kalite-cron.service.j2 index 208490447..bac200a98 100644 --- a/roles/kalite/templates/f18/kalite-cron.service.j2 +++ b/roles/kalite/templates/f18/kalite-cron.service.j2 @@ -5,8 +5,8 @@ Wants=kalite-serve.service [Service] Type=forking -ExecStart={{ kalite_root }}/scripts/xsce_cronservectl.sh start -ExecStop={{ kalite_root }}/scripts/xsce_cronservectl.sh stop +ExecStart={{ kalite_root }}/scripts/iiab_cronservectl.sh start +ExecStop={{ kalite_root }}/scripts/iiab_cronservectl.sh stop [Install] WantedBy=multi-user.target diff --git a/roles/kiwix/README.rst b/roles/kiwix/README.rst index d339b51a3..4bc7670cc 100644 --- a/roles/kiwix/README.rst +++ b/roles/kiwix/README.rst @@ -13,4 +13,4 @@ Locations - The ZIM index files are expected to be in directories under /library/zims/index - The URL is /kiwix -The library.xml file can be recalculated by running xsce-make-kiwix-lib. +The library.xml file can be recalculated by running iiab-make-kiwix-lib. diff --git a/roles/kiwix/defaults/main.yml b/roles/kiwix/defaults/main.yml index bb93ddf66..b6bac169f 100644 --- a/roles/kiwix/defaults/main.yml +++ b/roles/kiwix/defaults/main.yml @@ -1,9 +1,9 @@ kiwix_url: /kiwix -kiwix_path: "{{ xsce_base }}/kiwix" +kiwix_path: "{{ iiab_base }}/kiwix" kiwix_port: 3000 -xsce_zim_path: /library/zims -kiwix_library_xml: "{{ xsce_zim_path }}/library.xml" -kiwix_content_path: "{{ xsce_zim_path }}/content" +iiab_zim_path: /library/zims +kiwix_library_xml: "{{ iiab_zim_path }}/library.xml" +kiwix_content_path: "{{ iiab_zim_path }}/content" kiwix_install: True kiwix_serve_enabled: False kiwix_content_found: False diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 33cf42237..fda3bfb79 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -5,9 +5,9 @@ mode=0755 state=directory with_items: - - "{{ xsce_zim_path }}" + - "{{ iiab_zim_path }}" - "{{ kiwix_content_path }}" - - "{{ xsce_zim_path }}/index" + - "{{ iiab_zim_path }}/index" - name: Copy kiwix library file if needed template: src={{ item }} @@ -40,13 +40,13 @@ - name: Unarchive it to permanent location - not bin_only unarchive: src="{{ downloads_dir }}/{{ kiwix_src_file }}" - dest="{{ xsce_base }}" + dest="{{ iiab_base }}" owner=root group=root when: not kiwix_src_bin_only and kiwix_first_pass - name: Create directory for kiwix bin - file: path="{{ xsce_base }}/kiwix/bin" + file: path="{{ iiab_base }}/kiwix/bin" owner=root group=root mode=0755 @@ -62,14 +62,14 @@ - name: Unarchive it to permanent location - bin only unarchive: src="{{ downloads_dir }}/{{ kiwix_src_file }}" - dest="{{ xsce_base }}/kiwix/bin" + dest="{{ iiab_base }}/kiwix/bin" owner=root group=root when: kiwix_src_bin_only and kiwix_first_pass # workaround because unarchive does not set ownership properly - name: Set kiwix ownership - command: "chown -R root:root {{ xsce_base }}" + command: "chown -R root:root {{ iiab_base }}" # workaround because kiwix-serve does not stay running - name: Make an entry in crontab to restart every hour @@ -97,9 +97,9 @@ - { src: 'kiwix-serve.service.j2', dest: '/etc/systemd/system/kiwix-serve.service', mode: '0655'} # - { src: 'kiwix-serve-init.j2', dest: '/usr/libexec/kiwix-serve-init', mode: '0755'} - - { src: 'xsce-make-kiwix-lib', dest: '/usr/bin/xsce-make-kiwix-lib', mode: '0755'} - - { src: 'xsce-make-kiwix-lib.py', dest: '/usr/bin/xsce-make-kiwix-lib.py', mode: '0755'} - - { src: 'xsce-make-apache-config.py', dest: '/usr/bin/xsce-make-apache-config.py', mode: '0755'} + - { src: 'iiab-make-kiwix-lib', dest: '/usr/bin/iiab-make-kiwix-lib', mode: '0755'} + - { src: 'iiab-make-kiwix-lib.py', dest: '/usr/bin/iiab-make-kiwix-lib.py', mode: '0755'} + - { src: 'iiab-make-apache-config.py', dest: '/usr/bin/iiab-make-apache-config.py', mode: '0755'} - name: add kiwix to service list @@ -118,8 +118,8 @@ value: "{{ kiwix_path }}" - option: kiwix_port value: "{{ kiwix_port }}" - - option: xsce_zim_path - value: "{{ xsce_zim_path }}" + - option: iiab_zim_path + value: "{{ iiab_zim_path }}" - option: kiwix_library_xml value: "{{ kiwix_library_xml }}" - option: kiwix_content_path diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index f989efa37..8f3a43783 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -18,7 +18,7 @@ when: ansible_machine == "armv7l" - name: Get the kiwix software - get_url: url="{{ xsce_download_url }}/{{ kiwix_src_file }}" dest="{{ downloads_dir }}/{{ kiwix_src_file }}" + get_url: url="{{ iiab_download_url }}/{{ kiwix_src_file }}" dest="{{ downloads_dir }}/{{ kiwix_src_file }}" when: not {{ use_cache }} and not {{ no_network }} tags: - download2 diff --git a/roles/kiwix/templates/xsce-make-apache-config.py b/roles/kiwix/templates/iiab-make-apache-config.py similarity index 88% rename from roles/kiwix/templates/xsce-make-apache-config.py rename to roles/kiwix/templates/iiab-make-apache-config.py index c517ad47e..795883e6f 100755 --- a/roles/kiwix/templates/xsce-make-apache-config.py +++ b/roles/kiwix/templates/iiab-make-apache-config.py @@ -3,12 +3,12 @@ import os, sys, syslog -xsce_zim_path = "/library/zims" +iiab_zim_path = "/library/zims" kiwix_apache_config = "/etc/apache2/sites-available/kiwix.conf" def main (): - content = xsce_zim_path + "/content/" - index = xsce_zim_path + "/index/" + content = iiab_zim_path + "/content/" + index = iiab_zim_path + "/index/" # remove existing file try: diff --git a/roles/kiwix/templates/xsce-make-kiwix-lib b/roles/kiwix/templates/iiab-make-kiwix-lib similarity index 59% rename from roles/kiwix/templates/xsce-make-kiwix-lib rename to roles/kiwix/templates/iiab-make-kiwix-lib index f6d728595..6cb6d42c0 100644 --- a/roles/kiwix/templates/xsce-make-kiwix-lib +++ b/roles/kiwix/templates/iiab-make-kiwix-lib @@ -1,8 +1,8 @@ #!/bin/sh {{systemctl_program }} stop kiwix-serve -/usr/bin/xsce-make-kiwix-lib.py -/usr/bin/xsce-make-apache-config.py +/usr/bin/iiab-make-kiwix-lib.py +/usr/bin/iiab-make-apache-config.py {{ systemctl_program }} start kiwix-serve exit 0 diff --git a/roles/kiwix/templates/xsce-make-kiwix-lib.py b/roles/kiwix/templates/iiab-make-kiwix-lib.py similarity index 80% rename from roles/kiwix/templates/xsce-make-kiwix-lib.py rename to roles/kiwix/templates/iiab-make-kiwix-lib.py index ca17185f9..011ac1cec 100644 --- a/roles/kiwix/templates/xsce-make-kiwix-lib.py +++ b/roles/kiwix/templates/iiab-make-kiwix-lib.py @@ -18,22 +18,22 @@ import re import subprocess import shlex import ConfigParser -XSCE_PATH='/etc/xsce' +XSCE_PATH='/etc/iiab' if not XSCE_PATH in sys.path: sys.path.append(XSCE_PATH) -from xsce_env import get_xsce_env +from iiab_env import get_iiab_env # Config Files -xsce_config_file = "/etc/xsce/xsce.ini" +iiab_config_file = "/etc/iiab/iiab.ini" # Variables that should be read from config file # All of these variables will be read from config files and recomputed in init() -xsce_zim_path = "/library/zims" +iiab_zim_path = "/library/zims" kiwix_library_xml = "/library/zims/library.xml" -xsce_base_path = "/opt/schoolserver" -kiwix_manage = xsce_base_path + "/kiwix/bin/kiwix-manage" -doc_root = get_xsce_env('WWWROOT') +iiab_base_path = "/opt/schoolserver" +kiwix_manage = iiab_base_path + "/kiwix/bin/kiwix-manage" +doc_root = get_iiab_env('WWWROOT') zim_version_idx = doc_root + "/common/assets/zim_version_idx.json" zim_versions = {} @@ -52,8 +52,8 @@ def main(): # only add a single .zim for each .zimxx file files_processed = {} - content = xsce_zim_path + "/content/" - index = xsce_zim_path + "/index/" + content = iiab_zim_path + "/content/" + index = iiab_zim_path + "/index/" flist = os.listdir(content) flist.sort() @@ -86,17 +86,17 @@ def main(): def init(): - global xsce_base_path - global xsce_zim_path + global iiab_base_path + global iiab_zim_path global kiwix_library_xml global kiwix_manage config = ConfigParser.SafeConfigParser() - config.read(xsce_config_file) - xsce_base_path = config.get('location','xsce_base') - xsce_zim_path = config.get('kiwix-serve','xsce_zim_path') + config.read(iiab_config_file) + iiab_base_path = config.get('location','iiab_base') + iiab_zim_path = config.get('kiwix-serve','iiab_zim_path') kiwix_library_xml = config.get('kiwix-serve','kiwix_library_xml') - kiwix_manage = xsce_base_path + "/kiwix/bin/kiwix-manage" + kiwix_manage = iiab_base_path + "/kiwix/bin/kiwix-manage" # Now start the application diff --git a/roles/kiwix/templates/kiwix-serve.service.j2 b/roles/kiwix/templates/kiwix-serve.service.j2 index 82516b082..cab965e7d 100644 --- a/roles/kiwix/templates/kiwix-serve.service.j2 +++ b/roles/kiwix/templates/kiwix-serve.service.j2 @@ -4,7 +4,7 @@ After=syslog.target network.target local-fs.target [Service] Type=forking -ExecStart={{ xsce_base }}/kiwix/bin/kiwix-serve --daemon --port {{ kiwix_port }} --library {{ kiwix_library_xml }} +ExecStart={{ iiab_base }}/kiwix/bin/kiwix-serve --daemon --port {{ kiwix_port }} --library {{ kiwix_library_xml }} [Install] WantedBy=multi-user.target diff --git a/roles/menu/defaults/main.yml b/roles/menu/defaults/main.yml index cb16ffa8e..c692e021a 100644 --- a/roles/menu/defaults/main.yml +++ b/roles/menu/defaults/main.yml @@ -1,4 +1,4 @@ iiab_menu_url: https://github.com/tim-moody/iiab-menu -iiab_menu_dir: /opt/iiab-menu +iiab_menu_dir: /opt/iiab/iiab-menu iiab_menu_install: True diff --git a/roles/menu/tasks/main.yml b/roles/menu/tasks/main.yml index 6dc1177fd..bc73e18f4 100644 --- a/roles/menu/tasks/main.yml +++ b/roles/menu/tasks/main.yml @@ -4,11 +4,11 @@ depth=1 force=yes # ignore_errors: yes - when: not {{ use_cache }} and not {{ no_network }} and iiab_menu_install + when: not no_network and iiab_menu_install tags: - download2 -- name: copy the menu date the the active doc-root +- name: copy the menu data to the active doc-root command: "{{ iiab_menu_dir }}/cp-menus" when: iiab_menu_install diff --git a/roles/moodle-1.9/moodle/tasks/main.yml b/roles/moodle-1.9/moodle/tasks/main.yml index 8d35267a9..e3de96bf5 100644 --- a/roles/moodle-1.9/moodle/tasks/main.yml +++ b/roles/moodle-1.9/moodle/tasks/main.yml @@ -20,8 +20,8 @@ group=root mode={{ item.mode }} with_items: - - src: '020-xsce-moodle.conf.j2' - dest: '/etc/{{ apache_config_dir }}/020-xsce-moodle.conf' + - src: '020-iiab-moodle.conf.j2' + dest: '/etc/{{ apache_config_dir }}/020-iiab-moodle.conf' mode: '0655' - src: 'moodle-xs.service.j2' dest: '/etc/systemd/system/moodle-xs.service' diff --git a/roles/moodle-1.9/moodle/templates/020-iiab-moodle.conf.j2 b/roles/moodle-1.9/moodle/templates/020-iiab-moodle.conf.j2 new file mode 100644 index 000000000..f4585ccd0 --- /dev/null +++ b/roles/moodle-1.9/moodle/templates/020-iiab-moodle.conf.j2 @@ -0,0 +1,12 @@ +# replaces stock moodle.conf installed by moodle-xs.rpm +Alias /moodle /var/www/moodle/web + +# Moodle public web pages - must be publically accessible +<Directory /var/www/moodle/web> + Require all granted +</Directory> + +# Moodle private data - must NOT be publically accessible +<Directory /var/www/moodle/data> + Require all denied +</Directory> diff --git a/roles/moodle/defaults/main.yml b/roles/moodle/defaults/main.yml index 564ad35c8..3f19aab8d 100644 --- a/roles/moodle/defaults/main.yml +++ b/roles/moodle/defaults/main.yml @@ -1,6 +1,6 @@ moodle_version: 31 moodle_repo_url: "https://github.com/moodle/moodle.git" -moodle_base: "{{ xsce_base }}/moodle" +moodle_base: "{{ iiab_base }}/moodle" moodle_user: moodle moodle_install: True moodle_enabled: False diff --git a/roles/moodle/tasks/main.yml b/roles/moodle/tasks/main.yml index 200750f77..9b3425bd5 100644 --- a/roles/moodle/tasks/main.yml +++ b/roles/moodle/tasks/main.yml @@ -43,20 +43,20 @@ - name: Prepare the downloaded directory so apache can install config file file: path={{ moodle_base }} - owner={{ apache_data }} + owner={{ apache_user }} recurse=yes state=directory - name: Give apache permission to write moodle data directory file: path={{ content_base }}/dbdata/moodle - owner={{ apache_data }} + owner={{ apache_user }} mode=0755 state=directory - name: Create a moodle data dir with apache permission to write file: path={{ moodle_data }} - owner={{ apache_data }} - group={{ apache_data }} + owner={{ apache_user }} + group={{ apache_user }} mode=0770 state=directory @@ -128,7 +128,7 @@ when: config.stat.exists is defined and not config.stat.exists - name: Give apache permission to read config file -# command: chown -R {{ apache_data }} {{ 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 46786b04a..1595b9209 100755 --- a/roles/moodle/templates/moodle_installer +++ b/roles/moodle/templates/moodle_installer @@ -1,8 +1,8 @@ #!/bin/bash -x -sudo -u {{ apache_data }} /usr/bin/php {{moodle_base}}/admin/cli/install.php \ +sudo -u {{ apache_user }} /usr/bin/php {{moodle_base}}/admin/cli/install.php \ --wwwroot=http://schoolserver.lan/moodle --dataroot={{moodle_data}} \ --dbtype=pgsql --dbname=moodle --dbuser=Admin --dbpass=changeme \ --fullname=Your_School --shortname=School \ --adminuser=admin --adminpass=changeme \ --non-interactive --agree-license -chown {{ apache_data}}:{{ apache_data }} {{ moodle_base }}/config.php +chown {{ apache_user}}:{{ apache_user }} {{ moodle_base }}/config.php diff --git a/roles/munin/templates/munin.conf.j2 b/roles/munin/templates/munin.conf.j2 index 2c3d84d65..5e4d21ffe 100644 --- a/roles/munin/templates/munin.conf.j2 +++ b/roles/munin/templates/munin.conf.j2 @@ -95,7 +95,7 @@ html_strategy cron #contact.nagios.command /usr/bin/send_nsca nagios.host.comm -c /etc/nsca.conf # a simple host tree -[{{ xsce_hostname }}] +[{{ iiab_hostname }}] address 127.0.0.1 use_node_name yes diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 27241f761..8b55efda7 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -73,7 +73,7 @@ - name: update mysql root password for all remaining root accounts mysql_user: name=root host={{ item }} password={{ mysql_root_password }} priv=*.*:ALL,GRANT with_items: -# - "{{ xsce_hostname }}.{{ xsce_domain }}" +# - "{{ iiab_hostname }}.{{ iiab_domain }}" - 127.0.0.1 - ::1 when: mysql_enabled diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 112c0415d..cdf53dc00 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -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 diff --git a/roles/network/tasks/computed_network.yml b/roles/network/tasks/computed_network.yml index d56c04298..28cb52463 100644 --- a/roles/network/tasks/computed_network.yml +++ b/roles/network/tasks/computed_network.yml @@ -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' diff --git a/roles/network/tasks/computed_services.yml b/roles/network/tasks/computed_services.yml index 370d1bf6c..2b8e6bac1 100644 --- a/roles/network/tasks/computed_services.yml +++ b/roles/network/tasks/computed_services.yml @@ -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 }}' diff --git a/roles/network/tasks/create_ifcfg.yml b/roles/network/tasks/create_ifcfg.yml index 09d03f3df..7c982dbd2 100644 --- a/roles/network/tasks/create_ifcfg.yml +++ b/roles/network/tasks/create_ifcfg.yml @@ -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" diff --git a/roles/network/tasks/debian.yml b/roles/network/tasks/debian.yml index da00b4573..4c42fd2a5 100644 --- a/roles/network/tasks/debian.yml +++ b/roles/network/tasks/debian.yml @@ -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' diff --git a/roles/network/tasks/display-discover.yml b/roles/network/tasks/display-discover.yml index 194afdfeb..6304cf38f 100644 --- a/roles/network/tasks/display-discover.yml +++ b/roles/network/tasks/display-discover.yml @@ -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 diff --git a/roles/network/tasks/edit_ifcfg.yml b/roles/network/tasks/edit_ifcfg.yml index dda3d6afd..fb8076722 100644 --- a/roles/network/tasks/edit_ifcfg.yml +++ b/roles/network/tasks/edit_ifcfg.yml @@ -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 diff --git a/roles/network/tasks/enable_wan.yml b/roles/network/tasks/enable_wan.yml index 3a3c01720..5cbeac07c 100644 --- a/roles/network/tasks/enable_wan.yml +++ b/roles/network/tasks/enable_wan.yml @@ -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" diff --git a/roles/network/tasks/hostapd.yml b/roles/network/tasks/hostapd.yml index 42e8bc9e9..e4eccedb6 100644 --- a/roles/network/tasks/hostapd.yml +++ b/roles/network/tasks/hostapd.yml @@ -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 diff --git a/roles/network/tasks/hosts.yml b/roles/network/tasks/hosts.yml index 0efacb457..b8827feea 100644 --- a/roles/network/tasks/hosts.yml +++ b/roles/network/tasks/hosts.yml @@ -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 diff --git a/roles/network/tasks/ifcfg_mods.yml b/roles/network/tasks/ifcfg_mods.yml index cbcd4c6db..35f6f32cc 100644 --- a/roles/network/tasks/ifcfg_mods.yml +++ b/roles/network/tasks/ifcfg_mods.yml @@ -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 }}" diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index cbfabd9e1..869a3b200 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -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 diff --git a/roles/network/tasks/redetect.yml b/roles/network/tasks/redetect.yml index 07cec647c..0c3ea1321 100644 --- a/roles/network/tasks/redetect.yml +++ b/roles/network/tasks/redetect.yml @@ -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" diff --git a/roles/network/tasks/restart.yml b/roles/network/tasks/restart.yml index 0d7068150..82c6e8f36 100644 --- a/roles/network/tasks/restart.yml +++ b/roles/network/tasks/restart.yml @@ -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 diff --git a/roles/network/tasks/rpi_debian.yml b/roles/network/tasks/rpi_debian.yml index 9af388d5c..9abf08472 100644 --- a/roles/network/tasks/rpi_debian.yml +++ b/roles/network/tasks/rpi_debian.yml @@ -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' diff --git a/roles/network/templates/dhcp/dhcpd-env.j2 b/roles/network/templates/dhcp/dhcpd-env.j2 index c59d4b7e5..dccaebbac 100755 --- a/roles/network/templates/dhcp/dhcpd-env.j2 +++ b/roles/network/templates/dhcp/dhcpd-env.j2 @@ -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}}' diff --git a/roles/network/templates/dhcp/dhcpd-xs.conf.j2 b/roles/network/templates/dhcp/dhcpd-xs.conf.j2 index efcb9931a..9ca3769fa 100644 --- a/roles/network/templates/dhcp/dhcpd-xs.conf.j2 +++ b/roles/network/templates/dhcp/dhcpd-xs.conf.j2 @@ -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; diff --git a/roles/network/templates/gateway/check-LAN b/roles/network/templates/gateway/check-LAN index 476cf13a1..659f7590e 100755 --- a/roles/network/templates/gateway/check-LAN +++ b/roles/network/templates/gateway/check-LAN @@ -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 } diff --git a/roles/network/templates/gateway/xs-gen-iptables b/roles/network/templates/gateway/xs-gen-iptables index 3be25db89..fbae26a1c 100755 --- a/roles/network/templates/gateway/xs-gen-iptables +++ b/roles/network/templates/gateway/xs-gen-iptables @@ -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 diff --git a/roles/network/templates/hostapd/hostapd.conf.j2 b/roles/network/templates/hostapd/hostapd.conf.j2 index 0fe880e72..e09fc693f 100644 --- a/roles/network/templates/hostapd/hostapd.conf.j2 +++ b/roles/network/templates/hostapd/hostapd.conf.j2 @@ -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 %} diff --git a/roles/network/templates/named/named-xs.conf.j2 b/roles/network/templates/named/named-xs.conf.j2 index 0b9da9920..41ec77b66 100755 --- a/roles/network/templates/named/named-xs.conf.j2 +++ b/roles/network/templates/named/named-xs.conf.j2 @@ -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; }; diff --git a/roles/network/templates/named/school.internal.zone.16.in-addr.db.j2 b/roles/network/templates/named/school.internal.zone.16.in-addr.db.j2 index 0a5957080..ed64c9b13 100755 --- a/roles/network/templates/named/school.internal.zone.16.in-addr.db.j2 +++ b/roles/network/templates/named/school.internal.zone.16.in-addr.db.j2 @@ -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 }}. diff --git a/roles/network/templates/named/school.internal.zone.32.in-addr.db.j2 b/roles/network/templates/named/school.internal.zone.32.in-addr.db.j2 index 0a5957080..ed64c9b13 100755 --- a/roles/network/templates/named/school.internal.zone.32.in-addr.db.j2 +++ b/roles/network/templates/named/school.internal.zone.32.in-addr.db.j2 @@ -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 }}. diff --git a/roles/network/templates/named/school.internal.zone.48.in-addr.db.j2 b/roles/network/templates/named/school.internal.zone.48.in-addr.db.j2 index 0a5957080..ed64c9b13 100755 --- a/roles/network/templates/named/school.internal.zone.48.in-addr.db.j2 +++ b/roles/network/templates/named/school.internal.zone.48.in-addr.db.j2 @@ -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 }}. diff --git a/roles/network/templates/named/school.internal.zone.db b/roles/network/templates/named/school.internal.zone.db index b28b0a99f..99a131aa2 100755 --- a/roles/network/templates/named/school.internal.zone.db +++ b/roles/network/templates/named/school.internal.zone.db @@ -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 diff --git a/roles/network/templates/named/school.internal.zone.in-addr.db.j2 b/roles/network/templates/named/school.internal.zone.in-addr.db.j2 index 0a5957080..ed64c9b13 100755 --- a/roles/network/templates/named/school.internal.zone.in-addr.db.j2 +++ b/roles/network/templates/named/school.internal.zone.in-addr.db.j2 @@ -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 }}. diff --git a/roles/network/templates/named/school.local.zone.db b/roles/network/templates/named/school.local.zone.db index 04e36daaf..3d0619e96 100644 --- a/roles/network/templates/named/school.local.zone.db +++ b/roles/network/templates/named/school.local.zone.db @@ -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 diff --git a/roles/network/templates/network/br0.j2 b/roles/network/templates/network/br0.j2 index 5e2d6d773..1230c0766 100644 --- a/roles/network/templates/network/br0.j2 +++ b/roles/network/templates/network/br0.j2 @@ -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 %} diff --git a/roles/network/templates/network/hostname.j2 b/roles/network/templates/network/hostname.j2 index 7211f5fcc..2d7c19798 100644 --- a/roles/network/templates/network/hostname.j2 +++ b/roles/network/templates/network/hostname.j2 @@ -1 +1 @@ -{{ xsce_hostname }}.{{ xsce_domain }} +{{ iiab_hostname }}.{{ iiab_domain }} diff --git a/roles/network/templates/network/ifcfg-WAN.j2 b/roles/network/templates/network/ifcfg-WAN.j2 index e103be921..8e1387442 100644 --- a/roles/network/templates/network/ifcfg-WAN.j2 +++ b/roles/network/templates/network/ifcfg-WAN.j2 @@ -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'] }}" diff --git a/roles/network/templates/network/ifcfg.j2 b/roles/network/templates/network/ifcfg.j2 index 7ada70f82..d109d6eb5 100644 --- a/roles/network/templates/network/ifcfg.j2 +++ b/roles/network/templates/network/ifcfg.j2 @@ -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 diff --git a/roles/network/templates/network/interfaces.j2 b/roles/network/templates/network/interfaces.j2 index 5e413fdc3..38a540698 100644 --- a/roles/network/templates/network/interfaces.j2 +++ b/roles/network/templates/network/interfaces.j2 @@ -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 %} diff --git a/roles/network/templates/network/resolv.conf.j2 b/roles/network/templates/network/resolv.conf.j2 index 9b33b62a3..063c2258f 100644 --- a/roles/network/templates/network/resolv.conf.j2 +++ b/roles/network/templates/network/resolv.conf.j2 @@ -1,2 +1,2 @@ -domain {{ xsce_domain }} +domain {{ iiab_domain }} nameserver {{ lan_ip }} diff --git a/roles/network/templates/network/sysconfig.network.j2 b/roles/network/templates/network/sysconfig.network.j2 index a74982aef..755f0da8f 100755 --- a/roles/network/templates/network/sysconfig.network.j2 +++ b/roles/network/templates/network/sysconfig.network.j2 @@ -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 }} diff --git a/roles/network/templates/network/wifi-slave.j2 b/roles/network/templates/network/wifi-slave.j2 index f27e16413..5985aecb4 100644 --- a/roles/network/templates/network/wifi-slave.j2 +++ b/roles/network/templates/network/wifi-slave.j2 @@ -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 }} diff --git a/roles/network/templates/network/xs_domain_name.j2 b/roles/network/templates/network/xs_domain_name.j2 index 5132c1386..06e5288d8 100644 --- a/roles/network/templates/network/xs_domain_name.j2 +++ b/roles/network/templates/network/xs_domain_name.j2 @@ -1 +1 @@ -{{ xsce_domain }} +{{ iiab_domain }} diff --git a/roles/network/templates/network/xs_lan_device.j2 b/roles/network/templates/network/xs_lan_device.j2 index 7eba6d262..825b59a5f 100644 --- a/roles/network/templates/network/xs_lan_device.j2 +++ b/roles/network/templates/network/xs_lan_device.j2 @@ -1,3 +1,3 @@ -{% if xsce_lan_iface != "none" %} -{{ xsce_lan_iface }} +{% if iiab_lan_iface != "none" %} +{{ iiab_lan_iface }} {% endif %} diff --git a/roles/network/templates/network/xs_wan_device.j2 b/roles/network/templates/network/xs_wan_device.j2 index 2e66ef848..97e74768f 100644 --- a/roles/network/templates/network/xs_wan_device.j2 +++ b/roles/network/templates/network/xs_wan_device.j2 @@ -1,3 +1,3 @@ -{% if xsce_wan_iface != "none" %} -{{ xsce_wan_iface }} +{% if iiab_wan_iface != "none" %} +{{ iiab_wan_iface }} {% endif %} diff --git a/roles/network/templates/squid/sites.whitelist.txt b/roles/network/templates/squid/sites.whitelist.txt index d06d247e9..da2b29330 100644 --- a/roles/network/templates/squid/sites.whitelist.txt +++ b/roles/network/templates/squid/sites.whitelist.txt @@ -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 diff --git a/roles/network/templates/squid/squid-xs.conf.j2 b/roles/network/templates/squid/squid-xs.conf.j2 index 4e9d33192..e215cd974 100755 --- a/roles/network/templates/squid/squid-xs.conf.j2 +++ b/roles/network/templates/squid/squid-xs.conf.j2 @@ -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 }} ############################### diff --git a/roles/network/templates/wondershaper/wondershaper.conf b/roles/network/templates/wondershaper/wondershaper.conf index 89b7774a0..2dc1d4de4 100644 --- a/roles/network/templates/wondershaper/wondershaper.conf +++ b/roles/network/templates/wondershaper/wondershaper.conf @@ -1,7 +1,7 @@ [wondershaper] # Adapter # -IFACE="{{ xsce_wan_iface }}" +IFACE="{{ iiab_wan_iface }}" # Download rate in Kbps # diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index ed1f9f203..b87182b50 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -11,8 +11,8 @@ - name: Get the nextcloud software get_url: url={{ nextcloud_dl_url }}/{{ nextcloud_src_file }} dest={{ downloads_dir }}/{{ nextcloud_src_file }} when: not {{ use_cache }} and not {{ no_network }} - async: 300 - poll: 5 + async: 900 + poll: 15 tags: - download @@ -64,22 +64,22 @@ template: src=autoconfig.php.j2 dest={{ nextcloud_prefix }}/nextcloud/config/autoconfig.php owner={{ apache_user }} - group=apache + group={{ apache_user }} mode=0640 when: is_centos - name: Make apache owner file: path={{ nextcloud_prefix }}/nextcloud - owner={{ apache_data }} - group=apache + owner={{ apache_user }} + group={{ apache_user }} recurse=yes state=directory - name: Create data directory library file: path={{ item }} mode=0750 - owner={{ apache_data}} - group=apache + owner={{ apache_user }} + group={{ apache_user }} state=directory with_items: - "{{ nextcloud_data_dir }}" diff --git a/roles/nextcloud/tasks/nextcloud_enabled.yml b/roles/nextcloud/tasks/nextcloud_enabled.yml index bba89ae76..6635616ad 100644 --- a/roles/nextcloud/tasks/nextcloud_enabled.yml +++ b/roles/nextcloud/tasks/nextcloud_enabled.yml @@ -28,7 +28,7 @@ service: name={{ apache_service }} state=restarted - name: Run nextcloud initial install wizard - shell: curl http://{{ xsce_hostname }}{{ nextcloud_url }}/index.php + shell: curl http://{{ iiab_hostname }}{{ nextcloud_url }}/index.php when: nextcloud_enabled - name: Remove Rewrite URL diff --git a/roles/nextcloud/templates/autoconfig.php.j2 b/roles/nextcloud/templates/autoconfig.php.j2 index 66ef7a0ab..35cf6ac17 100644 --- a/roles/nextcloud/templates/autoconfig.php.j2 +++ b/roles/nextcloud/templates/autoconfig.php.j2 @@ -3,8 +3,8 @@ $AUTOCONFIG = array( 'directory' => '{{ nextcloud_data_dir }}', 'trusted_domains' => array ( - 0 => '{{ xsce_hostname }}.{{ xsce_domain }}', - 1 => "{{ xsce_hostname }}", + 0 => '{{ iiab_hostname }}.{{ iiab_domain }}', + 1 => "{{ iiab_hostname }}", 2 => 'localhost', 3 => 'internet-in-a-box.lan', 4 => 'internet-in-a-box', @@ -16,7 +16,7 @@ $AUTOCONFIG = array( 10 => 'box', 11 => '172.18.96.1', ), - 'overwrite.cli.url' => 'http://{{ xsce_hostname }}.{{ xsce_domain }}/nextcloud', + 'overwrite.cli.url' => 'http://{{ iiab_hostname }}.{{ iiab_domain }}/nextcloud', 'dbtype' => 'mysql', 'dbname' => '{{ nextcloud_dbname }}', 'dbhost' => '{{ nextcloud_dbhost }}', diff --git a/roles/openvpn/defaults/main.yml b/roles/openvpn/defaults/main.yml index 6ae8dd6bc..b4b4fb772 100644 --- a/roles/openvpn/defaults/main.yml +++ b/roles/openvpn/defaults/main.yml @@ -1,4 +1,4 @@ -vpn_presence: xscenet.net +vpn_presence: iiabnet.net openvpn_server_virtual_ip: 10.8.0.1 openvpn_server_port: 1194 openvpn_install: True diff --git a/roles/openvpn/tasks/main.yml b/roles/openvpn/tasks/main.yml index 7a7aeb41f..2255c778a 100644 --- a/roles/openvpn/tasks/main.yml +++ b/roles/openvpn/tasks/main.yml @@ -23,8 +23,8 @@ group=root mode=0755 -- name: Create a folder for xsce executable not on path - file: path=/usr/lib/xsce +- name: Create a folder for iiab executable not on path + file: path=/usr/lib/iiab state=directory - name: Configure openvpn @@ -40,15 +40,15 @@ - { src: 'announce', dest: '/etc/openvpn/scripts/announce', owner: "root" , mode: '0755' } - { src: 'announcer', dest: '/etc/openvpn/scripts/announcer', owner: "root" , mode: '0755' } - { src: 'silence', dest: '/etc/openvpn/scripts/silence', owner: "root" , mode: '0755' } - - { src: 'xscenet.conf', dest: '/etc/openvpn/xscenet.conf', owner: "root" , mode: '0644' } - - { src: 'xsce-vpn.conf.in', dest: '/etc/openvpn/xsce-vpn.conf.in', owner: "root" , mode: '0644' } + - { src: 'iiabnet.conf', dest: '/etc/openvpn/iiabnet.conf', owner: "root" , mode: '0644' } + - { src: 'iiab-vpn.conf.in', dest: '/etc/openvpn/iiab-vpn.conf.in', owner: "root" , mode: '0644' } - { src: 'xs-vpn', dest: '/usr/bin/xs-vpn', owner: "root" , mode: '0755' } - { src: 'xs-handle', dest: '/usr/bin/xs-handle', owner: "root" , mode: '0755' } - - { src: 'up_wan', dest: '/usr/lib/xsce/up_wan', owner: "root" , mode: '0755' } - - { src: 'start.j2', dest: '/usr/lib/xsce/start', owner: "root" , mode: '0755' } + - { src: 'up_wan', dest: '/usr/lib/iiab/up_wan', owner: "root" , mode: '0755' } + - { src: 'start.j2', dest: '/usr/lib/iiab/start', owner: "root" , mode: '0755' } - name: put up_wan in place for debian - template: src=up_wan dest=/usr/lib/xsce/up_wan + template: src=up_wan dest=/usr/lib/iiab/up_wan when: is_debuntu - name: put dispatcher up for NM @@ -56,12 +56,12 @@ when: not is_debuntu - name: check for manually configured openvpn tunnel - stat: path=/etc/openvpn/xsce-vpn.conf + stat: path=/etc/openvpn/iiab-vpn.conf register: stat # note that ansible does not currently handle @ in a service name - name: enable the openvpn tunnel at boot time - shell: systemctl enable openvpn@xscenet.service + shell: systemctl enable openvpn@iiabnet.service when: openvpn_enabled and not stat.exists is defined and is_debuntu - name: enable the openvpn tunnel at boot time for Debian @@ -69,12 +69,12 @@ when: openvpn_enabled and not stat.exists is defined and is_debuntu - name: start the openvpn tunnel now - shell: systemctl start openvpn@xscenet.service + shell: systemctl start openvpn@iiabnet.service when: openvpn_enabled and not stat.exists is defined and not installing - name: make openvpn connection automatic lineinfile: dest=/etc/crontab - line="25 * * * * root (/usr/bin/systemctl start openvpn@xscenet.service) > /dev/null" + line="25 * * * * root (/usr/bin/systemctl start openvpn@iiabnet.service) > /dev/null" when: openvpn_enabled and openvpn_cron_enabled and not stat.exists is defined @@ -87,7 +87,7 @@ - name: stop starting the openvpn tunnel at boot time - shell: systemctl disable openvpn@xscenet.service + shell: systemctl disable openvpn@iiabnet.service when: not openvpn_enabled and not is_debuntu - name: stop starting the openvpn tunnel at boot time for Debian @@ -95,7 +95,7 @@ when: not openvpn_enabled and is_debuntu - name: stop openvpn tunnel immediately - shell: systemctl stop openvpn@xscenet.service + shell: systemctl stop openvpn@iiabnet.service ignore_errors: True when: not openvpn_enabled and not installing diff --git a/roles/openvpn/templates/15-openvpn b/roles/openvpn/templates/15-openvpn index 19005445e..b7264dd83 100755 --- a/roles/openvpn/templates/15-openvpn +++ b/roles/openvpn/templates/15-openvpn @@ -13,7 +13,7 @@ if [ "$2" = "up" ]; then sleep 2 /sbin/ip route list dev "$1" | grep -q '^default' && # restart the services - systemctl -q is-enabled openvpn@xscenet.service && /usr/lib/xsce/up-wan + systemctl -q is-enabled openvpn@iiabnet.service && /usr/lib/iiab/up-wan fi # we added this to prevent logs from filling with openvpn errors @@ -22,7 +22,7 @@ fi # sleep 2 # /sbin/ip route list dev "$1" | grep -q '^default' || # stop the services -# systemctl -q is-enabled openvpn@xscenet.service && systemctl stop openvpn@xscenet.service +# systemctl -q is-enabled openvpn@iiabnet.service && systemctl stop openvpn@iiabnet.service #fi exit 0 diff --git a/roles/openvpn/templates/announcer b/roles/openvpn/templates/announcer index 5824f2954..7842cfcf0 100755 --- a/roles/openvpn/templates/announcer +++ b/roles/openvpn/templates/announcer @@ -3,18 +3,18 @@ HANDLE= UUID= -source /etc/xsce/xsce.env +source /etc/iiab/iiab.env if [ -z "$HANDLE" ]; then - HANDLE=`cat /etc/xsce/xsce.ini | gawk \ + HANDLE=`cat /etc/iiab/iiab.ini | gawk \ '{ if((toupper($1) == "HANDLE") && ($2 == "=")) { print $3;}}'` fi if [ -z "$HANDLE" ]; then - if [ -f /etc/xsce/handle ]; then - HANDLE=`cat /etc/xsce/handle` + if [ -f /etc/iiab/handle ]; then + HANDLE=`cat /etc/iiab/handle` fi fi -if [ -f /etc/xsce/uuid ]; then - UUID=`cat /etc/xsce/uuid` +if [ -f /etc/iiab/uuid ]; then + UUID=`cat /etc/iiab/uuid` fi # start the daemon which will serve the handle on demand source /etc/init.d/functions diff --git a/roles/openvpn/templates/iiab-vpn.conf.in b/roles/openvpn/templates/iiab-vpn.conf.in new file mode 100644 index 000000000..c831a79cd --- /dev/null +++ b/roles/openvpn/templates/iiab-vpn.conf.in @@ -0,0 +1,6 @@ +# this file allows changing the world accessable vpn server and its ip address +# +# copy this template file to /etc/openvpn/iiab-vpn.conf, and set properly + +# VPNCONFIG=< put the name of the config file in /etc/openvpn you want to use> +# VPNIP=<put the ip address of server, pinged to test for existence of vpn tunnel> diff --git a/roles/openvpn/templates/iiabnet.conf b/roles/openvpn/templates/iiabnet.conf new file mode 100644 index 000000000..60f849819 --- /dev/null +++ b/roles/openvpn/templates/iiabnet.conf @@ -0,0 +1,37 @@ +######################################### +# Sample client-side OpenVPN config file +# for connecting to multi-client server. +# +# Adapted from http://openvpn.sourceforge.net/20notes.html +# +# The server can be pinged at {{ openvpn_server_virtual_ip }} +# + +port {{ openvpn_server_port }} +dev tun +remote iiabnet.net + +# TLS parms + +tls-client +ca keys/ca.crt +cert keys/client1.crt +key keys/client1.key + +# This parm is required for connecting +# to a multi-client server. It tells +# the client to accept options which +# the server pushes to us. +pull + +# Scripts can be used to do various +# things (change nameservers, for +# example. +script-security 2 +up scripts/announce +down scripts/silence +log /var/log/openvpn.log + +verb 3 +comp-lzo yes +keepalive 5 30 diff --git a/roles/openvpn/templates/start.j2 b/roles/openvpn/templates/start.j2 index 373927f51..b6f2251a3 100644 --- a/roles/openvpn/templates/start.j2 +++ b/roles/openvpn/templates/start.j2 @@ -22,6 +22,6 @@ if [ "$enabled" = 'True' ]; then killall openvpn sleep 10 #echo "Starting openvpn and waiting 10 seconds for daemon to become ready" - systemctl start openvpn@xscenet + systemctl start openvpn@iiabnet fi fi diff --git a/roles/openvpn/templates/up_wan b/roles/openvpn/templates/up_wan index 4a392b2d6..45765c91e 100755 --- a/roles/openvpn/templates/up_wan +++ b/roles/openvpn/templates/up_wan @@ -4,6 +4,6 @@ systemctl is-enabled openvpn if [ $? -eq 0 ]; then pgrep openvpn if [ $? -ne 0 ]; then - systemctl start openvpn@xscenet + systemctl start openvpn@iiabnet fi fi diff --git a/roles/openvpn/templates/xs-handle b/roles/openvpn/templates/xs-handle index 982a48670..106603386 100755 --- a/roles/openvpn/templates/xs-handle +++ b/roles/openvpn/templates/xs-handle @@ -4,10 +4,10 @@ echo echo read -p "what identifying handle would you like to use? " ans if [ "$ans" == "" ]; then - if [ -f /etc/xsce/handle ]; then - rm -f /etc/xsce/handle + if [ -f /etc/iiab/handle ]; then + rm -f /etc/iiab/handle fi else - echo $ans > /etc/xsce/handle + echo $ans > /etc/iiab/handle fi -{{ systemctl_program }} restart openvpn@xscenet +{{ systemctl_program }} restart openvpn@iiabnet diff --git a/roles/openvpn/templates/xs-vpn b/roles/openvpn/templates/xs-vpn index fd06780dc..dc78c1b6a 100755 --- a/roles/openvpn/templates/xs-vpn +++ b/roles/openvpn/templates/xs-vpn @@ -1,11 +1,11 @@ #!/bin/sh # script to manage openvpn -if [ ! -f "/etc/openvpn/xsce-vpn.conf" ]; then +if [ ! -f "/etc/openvpn/iiab-vpn.conf" ]; then VPNCONFIG='party-line.conf' VPNIP={{ openvpn_server_virtual_ip }} else # expect the sourced file to set the above variables - source /etc/openvpn/xsce-vpn.conf + source /etc/openvpn/iiab-vpn.conf fi # we'd like the user of this script to have root privilege diff --git a/roles/owncloud/tasks/main.yml b/roles/owncloud/tasks/main.yml index 2bfeafcc7..7c980993c 100644 --- a/roles/owncloud/tasks/main.yml +++ b/roles/owncloud/tasks/main.yml @@ -41,7 +41,7 @@ # but we use the tar file to get the latest version - name: Get the owncloud software - get_url: url={{ xsce_download_url }}/{{ owncloud_src_file }} dest={{ downloads_dir }}/{{ owncloud_src_file }} + get_url: url={{ iiab_download_url }}/{{ owncloud_src_file }} dest={{ downloads_dir }}/{{ owncloud_src_file }} when: not {{ use_cache }} and not {{ no_network }} async: 300 poll: 5 @@ -73,7 +73,7 @@ - name: Make apache owner file: path={{ owncloud_prefix }}/owncloud - owner={{ apache_data }} + owner={{ apache_user }} group=apache recurse=yes state=directory @@ -81,7 +81,7 @@ - name: Create data directory library file: path={{ item }} mode=0750 - owner={{ apache_data}} + owner={{ apache_user}} group=apache state=directory with_items: diff --git a/roles/owncloud/tasks/owncloud_enabled.yml b/roles/owncloud/tasks/owncloud_enabled.yml index 54892daae..f3ee392b2 100644 --- a/roles/owncloud/tasks/owncloud_enabled.yml +++ b/roles/owncloud/tasks/owncloud_enabled.yml @@ -27,7 +27,7 @@ service: name={{ apache_service }} state=restarted - name: Run owncloud initial install wizard - shell: curl http://{{ xsce_hostname }}{{ owncloud_url }}/index.php + shell: curl http://{{ iiab_hostname }}{{ owncloud_url }}/index.php - name: Remove Rewrite URL lineinfile: regexp='overwrite.cli.url' diff --git a/roles/owncloud/templates/autoconfig.php.j2 b/roles/owncloud/templates/autoconfig.php.j2 index 5dd01980a..62b9d9a1b 100644 --- a/roles/owncloud/templates/autoconfig.php.j2 +++ b/roles/owncloud/templates/autoconfig.php.j2 @@ -3,8 +3,8 @@ $AUTOCONFIG = array( 'directory' => '{{ owncloud_data_dir }}', 'trusted_domains' => array ( - 0 => '{{ xsce_hostname }}.{{ xsce_domain }}', - 1 => "{{ xsce_hostname }}", + 0 => '{{ iiab_hostname }}.{{ iiab_domain }}', + 1 => "{{ iiab_hostname }}", 2 => 'localhost', 3 => 'internet-in-a-box.lan', 4 => 'internet-in-a-box', @@ -16,7 +16,7 @@ $AUTOCONFIG = array( 10 => 'box', 11 => '172.18.96.1', ), - 'overwrite.cli.url' => 'http://{{ xsce_hostname }}.{{ xsce_domain }}/owncloud', + 'overwrite.cli.url' => 'http://{{ iiab_hostname }}.{{ iiab_domain }}/owncloud', 'dbtype' => 'mysql', 'dbname' => '{{ owncloud_dbname }}', 'dbhost' => '{{ owncloud_dbhost }}', diff --git a/roles/pathagar/templates/auth.User.json b/roles/pathagar/templates/auth.User.json index f99b3d84d..e764d7c5d 100644 --- a/roles/pathagar/templates/auth.User.json +++ b/roles/pathagar/templates/auth.User.json @@ -13,7 +13,7 @@ "groups": [], "user_permissions": [], "password": "{{ pathagar_password }}", - "email": "{{ pathagar_username }}@{{ xsce_hostname }}.{{ xsce_domain }}", + "email": "{{ pathagar_username }}@{{ iiab_hostname }}.{{ iiab_domain }}", "date_joined": "2013-11-12T05:06:17.207" } } diff --git a/roles/phpmyadmin/tasks/main.yml b/roles/phpmyadmin/tasks/main.yml index 60fe922d0..891d25f24 100644 --- a/roles/phpmyadmin/tasks/main.yml +++ b/roles/phpmyadmin/tasks/main.yml @@ -1,5 +1,5 @@ - name: Get the phpmyadmin software - get_url: url="{{ xsce_download_url }}/{{ phpMyAdmin }}" dest="{{ downloads_dir}}/phpMyAdmin.zip" + get_url: url="{{ iiab_download_url }}/{{ phpMyAdmin }}" dest="{{ downloads_dir}}/phpMyAdmin.zip" when: not {{ use_cache }} and not {{ no_network }} tags: - download2 @@ -14,7 +14,7 @@ template: src=config.inc.php dest=/opt/phpmyadmin/config.inc.php - name: Change the owner of the php tree to apache - shell: "chown -R apache /opt/phpmyadmin" + shell: "chown -R {{ apache_user }} /opt/phpmyadmin" - name: Put the alias into Apache config when enabled template: src=phpmyadmin.j2 dest=/etc/{{ apache_config_dir }}/phpmyadmin.conf diff --git a/roles/samba/defaults/main.yml b/roles/samba/defaults/main.yml index 9d262871e..7de2c790a 100644 --- a/roles/samba/defaults/main.yml +++ b/roles/samba/defaults/main.yml @@ -1,6 +1,6 @@ --- smbuser : smbuser - smbpassword : $6$51xsce$VXzRJK88k9k8SXd5sjs37bEbVQ9x4ob1ng7A5PSGyoVXTKQrhu.89BRuXZAgn8a2DPqZkKDcCpqCZVOs.cieT/ -# python -c 'import crypt; print crypt.crypt("smbpw", "$6$51xsce")' + smbpassword : $6$51iiab$VXzRJK88k9k8SXd5sjs37bEbVQ9x4ob1ng7A5PSGyoVXTKQrhu.89BRuXZAgn8a2DPqZkKDcCpqCZVOs.cieT/ +# python -c 'import crypt; print crypt.crypt("smbpw", "$6$51iiab")' shared_dir : /library/public samba_enabled : false diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 4ad57cd5e..711e5b4a2 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -1,5 +1,5 @@ - name: Download the latest stable version of sugarizer from location under our control - get_url: url={{ xsce_download_url }}/{{ sugarizer_version }}.tar.gz + get_url: url={{ iiab_download_url }}/{{ sugarizer_version }}.tar.gz dest={{ downloads_dir }}/{{ sugarizer_version }}.tar.gz - name: Untar it to target location diff --git a/roles/teamviewer/defaults/main.yml b/roles/teamviewer/defaults/main.yml index 24d2fe9e8..f66401b80 100644 --- a/roles/teamviewer/defaults/main.yml +++ b/roles/teamviewer/defaults/main.yml @@ -1,4 +1,4 @@ -teamviewer_url: "{{ xsce_download_url }}" +teamviewer_url: "{{ iiab_download_url }}" teamviewer_rpm_file: teamviewer_10.0.41499.i686.rpm teamviewer_install: True teamviewer_enabled: False diff --git a/roles/usb-lib/tasks/main.yml b/roles/usb-lib/tasks/main.yml index eb1fe34ab..f82cb1f2c 100644 --- a/roles/usb-lib/tasks/main.yml +++ b/roles/usb-lib/tasks/main.yml @@ -1,8 +1,8 @@ - name: Add a content directory for links to be located file: dest={{ doc_root }}/local_content state=directory - owner={{ apache_data }} - group={{ xsce_admin_user }} + owner={{ apache_user }} + group={{ iiab_admin_user }} mode=0775 - name: Copy mount file to usbmount when enabled diff --git a/roles/vnstat/tasks/main.yml b/roles/vnstat/tasks/main.yml index 794e00911..7a37a67cc 100644 --- a/roles/vnstat/tasks/main.yml +++ b/roles/vnstat/tasks/main.yml @@ -15,11 +15,11 @@ group=root - name: create database for wan to collect vnstat data - shell: /usr/bin/vnstat -i {{ xsce_wan_iface }} + shell: /usr/bin/vnstat -i {{ iiab_wan_iface }} - name: create database for lan to collect vnstat data if not appliace config - shell: /usr/bin/vnstat -i {{ xsce_lan_iface }} - when: not xsce_lan_iface == "" + shell: /usr/bin/vnstat -i {{ iiab_lan_iface }} + when: not iiab_lan_iface == "" - name: start vnstat daemon via systemd service: name=vnstat enabled=yes state=started diff --git a/roles/vnstat/templates/vnstat.conf.j2 b/roles/vnstat/templates/vnstat.conf.j2 index fadc56ee2..224424db6 100644 --- a/roles/vnstat/templates/vnstat.conf.j2 +++ b/roles/vnstat/templates/vnstat.conf.j2 @@ -2,7 +2,7 @@ ## # default interface -Interface "{{ xsce_wan_iface }}" +Interface "{{ iiab_wan_iface }}" # location of the database directory DatabaseDir "/var/lib/vnstat" diff --git a/roles/wordpress/defaults/main.yml b/roles/wordpress/defaults/main.yml index b8064b1d0..1511e7ac3 100644 --- a/roles/wordpress/defaults/main.yml +++ b/roles/wordpress/defaults/main.yml @@ -1,10 +1,10 @@ wordpress_src: wordpress-4.7.3.tar.gz -wp_db_name: xsce_wp -wp_db_user: xsce_wp +wp_db_name: iiab_wp +wp_db_user: iiab_wp wp_db_user_password: changeme wordpress_install: True wordpress_enabled: True wp_install_path: /library wp_abs_path: /library/wordpress wp_url: /wordpress -wp_full_url: "http://{{ xsce_hostname }}{{ wp_url }}" +wp_full_url: "http://{{ iiab_hostname }}{{ wp_url }}" diff --git a/roles/wordpress/tasks/install.yml b/roles/wordpress/tasks/install.yml index 5c672783f..f6775aada 100644 --- a/roles/wordpress/tasks/install.yml +++ b/roles/wordpress/tasks/install.yml @@ -1,5 +1,5 @@ - name: Get the WordPress software - get_url: url="{{ xsce_download_url }}/{{ wordpress_src }}" dest={{ downloads_dir}}/ + get_url: url="{{ iiab_download_url }}/{{ wordpress_src }}" dest={{ downloads_dir}}/ when: not {{ use_cache }} and not {{ no_network }} tags: - download2 @@ -15,7 +15,7 @@ file: path={{ wp_abs_path }} recurse=yes owner=root - group={{ apache_data }} + group={{ apache_user }} mode=0664 state=directory @@ -26,23 +26,23 @@ copy: src=wp-keys.php.BAK dest={{ wp_abs_path }}/wp-keys.php.BAK owner=root - group={{ apache_data }} + group={{ apache_user }} mode=0640 # Fetch random salts for WordPress config into wp-keys.php file by generating script and running - name: Create wp salt script - template: src=get-xsce-wp-salts.j2 - dest=/tmp/get-xsce-wp-salts + template: src=get-iiab-wp-salts.j2 + dest=/tmp/get-iiab-wp-salts owner=root group=root mode=0700 - name: Run wp salt script to create /library/wordpress/wp-keys.php - command: /tmp/get-xsce-wp-salts + command: /tmp/get-iiab-wp-salts - name: Cleanup - remove wp salt script - file: path=/tmp/get-xsce-wp-salts + file: path=/tmp/get-iiab-wp-salts state=absent - name: mysql database needs to be running if we are trying to create a new db @@ -63,7 +63,7 @@ template: src=wp-config.php.j2 dest={{ wp_abs_path }}/wp-config.php owner=root - group={{ apache_data }} + group={{ apache_user }} mode=0660 - name: Copy WordPress httpd conf file diff --git a/roles/wordpress/templates/get-xsce-wp-salts.j2 b/roles/wordpress/templates/get-iiab-wp-salts.j2 similarity index 92% rename from roles/wordpress/templates/get-xsce-wp-salts.j2 rename to roles/wordpress/templates/get-iiab-wp-salts.j2 index a27172143..75f2a833b 100644 --- a/roles/wordpress/templates/get-xsce-wp-salts.j2 +++ b/roles/wordpress/templates/get-iiab-wp-salts.j2 @@ -14,7 +14,7 @@ if [ $RC -ne 0 ];then cp $BACKUP $DEST else echo '?>' >> $DEST - chown root:{{ apache_data }} $DEST + chown root:{{ apache_user }} $DEST chmod 640 $DEST cp -f $DEST $BACKUP fi diff --git a/roles/xovis/defaults/main.yml b/roles/xovis/defaults/main.yml index 988de12ab..568b5ab6c 100644 --- a/roles/xovis/defaults/main.yml +++ b/roles/xovis/defaults/main.yml @@ -1,6 +1,6 @@ --- # The values here are defaults. -# To override them edit the main var definitions in xsce/vars +# To override them edit the main var definitions in iiab/vars xovis_target_host: "127.0.0.1:5984" xovis_deployment_name: olpc diff --git a/runansible b/runansible index d0f59a69a..2eb33da54 100755 --- a/runansible +++ b/runansible @@ -1,9 +1,9 @@ #!/bin/bash -# copy var files to /etc/xsce for subsequent use -mkdir -p /etc/xsce -if [ ! -f /etc/xsce/config_vars.yml ]; then - echo "{}" > /etc/xsce/config_vars.yml +# copy var files to /etc/iiab for subsequent use +mkdir -p /etc/iiab +if [ ! -f /etc/iiab/config_vars.yml ]; then + echo "{}" > /etc/iiab/config_vars.yml fi # if vars/local_vars.yml is missing, put a default one in place @@ -17,15 +17,15 @@ if [ ! -f ./vars/local_vars.yml ]; then fi fi -if [ -f /etc/xsce/xsce.env ] +if [ -f /etc/iiab/iiab.env ] then - . /etc/xsce/xsce.env + . /etc/iiab/iiab.env cd $XSCE_DIR else - XSCE_DIR=/opt/schoolserver/iiab + XSCE_DIR=/opt/iiab/iiab fi -if [ ! -f xsce.yml ] +if [ ! -f iiab.yml ] then echo "XSCE Playbook not found." echo "Please run this command from the top level of the git repo." @@ -33,7 +33,7 @@ then exit fi -PLAYBOOK="xsce.yml" +PLAYBOOK="iiab.yml" INVENTORY="ansible_hosts" CWD=`pwd` echo "Running local playbooks! " @@ -55,12 +55,12 @@ fi # Pass in git location if [ x"$XSDOMAIN" != x ] then - ARGS="--extra-vars '{\"xsce_domain\":\"$XSDOMAIN\"}'" + ARGS="--extra-vars '{\"iiab_domain\":\"$XSDOMAIN\"}'" else ARGS="" fi -export ANSIBLE_LOG_PATH="$XSCE_DIR/xsce-install.log" +export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-install.log" ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local diff --git a/runtags b/runtags index 1d44ddbec..2c85103d2 100755 --- a/runtags +++ b/runtags @@ -1,18 +1,18 @@ #!/bin/bash -# copy var files to /etc/xsce for subsequent use +# copy var files to /etc/iiab for subsequent use #./install-init # if not the first run, repo location is here -if [ -f /etc/xsce/xsce.env ] +if [ -f /etc/iiab/iiab.env ] then - . /etc/xsce/xsce.env + . /etc/iiab/iiab.env cd $XSCE_DIR fi -if [ ! -f xsce.yml ] +if [ ! -f iiab.yml ] then echo "XSCE Playbook not found." echo "Please run this command from the top level of the git repo." @@ -49,5 +49,5 @@ if [ $# -ne 1 ]; then echo " If you would like a list of possible values, enter $0 XXX" exit 1 fi -export ANSIBLE_LOG_PATH="$XSCE_DIR/xsce-debug.log" -ansible-playbook -i ansible_hosts xsce.yml --connection=local --tags="""$taglist""" +export ANSIBLE_LOG_PATH="$XSCE_DIR/iiab-debug.log" +ansible-playbook -i ansible_hosts iiab.yml --connection=local --tags="""$taglist""" diff --git a/scripts/debian-startup b/scripts/debian-startup index ed809d0ec..1b9d9b57f 100755 --- a/scripts/debian-startup +++ b/scripts/debian-startup @@ -9,8 +9,8 @@ apt-get install -y mlocate vim emacs cd /opt mkdir schoolserver cd schoolserver -git clone https://github.com/xsce/xsce --depth 1 -cd xsce +git clone https://github.com/iiab/iiab --depth 1 +cd iiab # install ansible using script ./scripts/ansible diff --git a/scripts/refresh-wiki-docs.sh b/scripts/refresh-wiki-docs.sh index 2ea67d4ad..d9922cb3f 100755 --- a/scripts/refresh-wiki-docs.sh +++ b/scripts/refresh-wiki-docs.sh @@ -1,10 +1,10 @@ #!/bin/bash -x # pull down repo wiki, and imbed in docs subdirectory -source /etc/xsce/xsce.env -REPONAME=xsce +source /etc/iiab/iiab.env +REPONAME=iiab REPO=https://github.com/XSCE -WIKI=xsce-wiki +WIKI=iiab-wiki TARGET_URL=/info WWWROOT=/library/www/html INPUT=/tmp/${WIKI} @@ -32,7 +32,7 @@ if [ $? -ne 0 ]; then fi mkdir -p $WWWROOT$TARGET_URL/html -# To Do find more links to rewrite, especially after moving from xsce to iiab +# To Do find more links to rewrite, especially after moving from iiab to iiab for f in `ls /tmp/${WIKI}`; do FTRIMMED=${f%.md} if [ $FTRIMMED = "Home" ]; then FTRIMMED=index;fi @@ -51,9 +51,9 @@ lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/Security > lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/local_vars.yml > $WWWROOT$TARGET_URL/html/local_vars.yml # fetch the embedded help pages from the admin console -#for f in `ls ../roles/xsce-admin/files/console/help`; do +#for f in `ls ../roles/iiab-admin/files/console/help`; do # FTRIMMED=${f%.rst} -# pandoc -s ../roles/xsce-admin/files/console/help/$f -o ../docs/html/offline-help/$FTRIMMED.html +# pandoc -s ../roles/iiab-admin/files/console/help/$f -o ../docs/html/offline-help/$FTRIMMED.html # # make links refer to local directory # sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">)|" ../docs/html/$FTRIMMED.html #done diff --git a/vars/CentOS.yml b/vars/CentOS.yml index da61b8a60..ef534d0df 100644 --- a/vars/CentOS.yml +++ b/vars/CentOS.yml @@ -7,7 +7,7 @@ proxy_user: squid apache_service: httpd apache_user: apache apache_config_dir: httpd/conf.d -apache_data: apache +apache_user: apache apache_log_dir: /var/log/httpd smb_service: smb nmb_service: nmb diff --git a/vars/Debian.yml b/vars/Debian.yml index feb47f8b3..983d63db6 100644 --- a/vars/Debian.yml +++ b/vars/Debian.yml @@ -6,7 +6,7 @@ proxy: squid3 proxy_user: proxy apache_service: apache2 apache_config_dir: apache2/sites-available -apache_data: www-data +apache_user: www-data apache_log_dir: /var/log/apache2 smb_service: smbd nmb_service: nmbd diff --git a/vars/Fedora.yml b/vars/Fedora.yml index 20c66d001..de562bf22 100644 --- a/vars/Fedora.yml +++ b/vars/Fedora.yml @@ -6,7 +6,7 @@ proxy_user: squid apache_service: httpd apache_user: apache apache_config_dir: httpd/conf.d -apache_data: apache +apache_user: apache apache_log_dir: /var/log/httpd smb_service: smb nmb_service: nmb diff --git a/vars/OLPC.yml b/vars/OLPC.yml index b3f08c384..07965f8dc 100644 --- a/vars/OLPC.yml +++ b/vars/OLPC.yml @@ -6,7 +6,7 @@ proxy_user: squid apache_service: httpd apache_user: apache apache_config_dir: httpd/conf.d -apache_data: apache +apache_user: apache apache_log_dir: /var/log/httpd smb_service: smb nmb_service: nmb diff --git a/vars/Raspbian.yml b/vars/Raspbian.yml index 2a39fe494..0cd6ed138 100644 --- a/vars/Raspbian.yml +++ b/vars/Raspbian.yml @@ -10,7 +10,7 @@ proxy_user: proxy apache_service: apache2 apache_user: apache apache_config_dir: apache2/sites-available -apache_data: www-data +apache_user: www-data apache_log_dir: /var/log/apache2 smb_service: smbd nmb_service: nmbd diff --git a/vars/Ubuntu.yml b/vars/Ubuntu.yml index 7bf71acf1..6d9c851a7 100644 --- a/vars/Ubuntu.yml +++ b/vars/Ubuntu.yml @@ -7,7 +7,7 @@ proxy_user: proxy apache_service: apache2 apache_user: apache apache_config_dir: apache2/sites-available -apache_data: www-data +apache_user: www-data apache_log_dir: /var/log/apache2 smb_service: smbd nmb_service: nmbd diff --git a/vars/centos.localvars b/vars/centos.localvars index b808c6d3c..3ac1907c2 100644 --- a/vars/centos.localvars +++ b/vars/centos.localvars @@ -1,10 +1,10 @@ # Put variables for your installation that override defaults here -# Better still, put this file in a branch of https://github.com/XSCE/xsce-local for your deployment +# Better still, put this file in a branch of https://github.com/XSCE/iiab-local for your deployment -#xsce_admin_user: xsce-admin +#iiab_admin_user: iiab-admin # obtain a password hash with - python -c 'import crypt; print crypt.crypt("<plaintext>", "$6$<salt>")' -#xsce_admin_passw_hash: +#iiab_admin_passw_hash: varible: value # 4-server-options authserver_install: False diff --git a/vars/debian.localvars b/vars/debian.localvars index d046f7e6c..d432c4f5b 100644 --- a/vars/debian.localvars +++ b/vars/debian.localvars @@ -1,10 +1,10 @@ # Put variables for your installation that override defaults here -# Better still, put this file in a branch of https://github.com/XSCE/xsce-local for your deployment +# Better still, put this file in a branch of https://github.com/XSCE/iiab-local for your deployment -#xsce_admin_user: xsce-admin +#iiab_admin_user: iiab-admin # obtain a password hash with - python -c 'import crypt; print crypt.crypt("<plaintext>", "$6$<salt>")' -#xsce_admin_passw_hash: +#iiab_admin_passw_hash: varible: value # 4-server-options authserver_install: False diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 2bafb116a..b96647d20 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -10,16 +10,16 @@ content_base: "/library" doc_base: "{{ content_base }}/www" doc_root: "{{ doc_base }}/html" -xsce_base: /opt/schoolserver -xsce_dir: "{{ xsce_base }}/iiab" -pip_packages_dir: "{{ xsce_base }}/pip-packages" -yum_packages_dir: "{{ xsce_base }}/yum-packages" -downloads_dir: "{{ xsce_base }}/downloads" -xsce_download_url: http://download.unleashkids.org/xsce/downloads +iiab_base: /opt/iiab +iiab_dir: "{{ iiab_base }}/iiab" +pip_packages_dir: "{{ iiab_base }}/pip-packages" +yum_packages_dir: "{{ iiab_base }}/yum-packages" +downloads_dir: "{{ iiab_base }}/downloads" +iiab_download_url: http://download.iiab.io/packages #Configuration File(s) -xsce_config_file: /etc/xsce/xsce.ini -service_filelist: "{{ xsce_config_file }}" +iiab_config_file: /etc/iiab/iiab.ini +service_filelist: "{{ iiab_config_file }}" # The following two variables control OFFLINE installs use_cache: False # force cache use even when online @@ -28,11 +28,8 @@ no_network: False # use cache or error out if cache does not exist # Users and Passwords # obtain a password hash with - python -c 'import crypt; print crypt.crypt("<plaintext>", "$6$<salt>")' -xsce_admin_user: xsce-admin -xsce_admin_passw_hash: $6$xsce51$D.IrrEeLBYIuJkGDmi27pZUGOwPFp98qpl3hxMwWV4hXigFGmdSvy3s/j7tn6OnyTTLmlV7SsN0lCUAFzxSop. - -# password is 12admin -dummy: $6$xsce51$JhKBX/nwYLG0DDMTPN6radpgd//P881O/JX0GKFn32XUrR/D0VqnVFdvMdI.XW.eGaQY2VBCraLq6qiH0fbkD0 +iiab_admin_user: iiab-admin +iiab_admin_passw_hash: $6$xsce51$D.IrrEeLBYIuJkGDmi27pZUGOwPFp98qpl3hxMwWV4hXigFGmdSvy3s/j7tn6OnyTTLmlV7SsN0lCUAFzxSop. # Languages default_language: en @@ -43,15 +40,15 @@ local_tz: "{{lookup ('env','TZ') }}" # Network Parameters -xsce_hostname: box -xsce_domain: lan +iiab_hostname: box +iiab_domain: lan lan_ip: 172.18.96.1 lan_netmask: 255.255.224.0 #Read docs/NETWORKING.rst # Gateway mode -xsce_lan_enabled: True -xsce_wan_enabled: True +iiab_lan_enabled: True +iiab_wan_enabled: True ssh_port: 22 gui_wan: True adm_cons_force_ssl: False @@ -65,7 +62,7 @@ host_ssid: "Internet in a Box" host_wifi_mode: g host_channel: 6 hostapd_secure: False -hostapd_password: "xsce2017" +hostapd_password: "iiab2017" #intended for developers exFAT_enabled: False @@ -115,19 +112,19 @@ wondershaper_enabled: False # Gateway and Filters gw_squid_whitelist: False gw_block_https: False -xsce_gateway_enabled: True +iiab_gateway_enabled: True # Home page # Default to the gui where the selection is made or override in localvars -xsce_home_url: /home +iiab_home_url: /home -# you can change xsce_home_url in local_vars in order to get a different home page +# you can change iiab_home_url in local_vars in order to get a different home page # these could be one of the following (assuming they are enabled): -#xsce_home_url: /home -#xsce_home_url: /xs-portal - the alternate home page -#xsce_home_url: /wordpress -#xsce_home_url: /wiki - either dokuwiki or mediawiki +#iiab_home_url: /home +#iiab_home_url: /xs-portal - the alternate home page +#iiab_home_url: /wordpress +#iiab_home_url: /wiki - either dokuwiki or mediawiki # 4-SERVER-OPTIONS # sshd @@ -183,13 +180,13 @@ mysql_enabled: False phpmyadmin_install: True phpmyadmin_enabled: False # password is fixmysql -# mysql_root_password: $6$xsce51$3ICIW0CLWxxMW2a3yrHZ38ukZItD5tcadL4rWcE9D.qIGStxhh8rRsaSxoj3b.MYxI/VRDNjpzSYK/V6zkWFI0 +# mysql_root_password: $6$iiab51$3ICIW0CLWxxMW2a3yrHZ38ukZItD5tcadL4rWcE9D.qIGStxhh8rRsaSxoj3b.MYxI/VRDNjpzSYK/V6zkWFI0 mysql_root_password: fixmysql # ELGG elgg_install: True elgg_enabled: False -# elgg_mysql_password: $6$xsce51$jeTwnATcbaa92xo0QBTgjLBU.5aVDDrbKeNyyC99R/TAWz6pvfzj.L7lfnOVVjD78nxqT.gkNn6XZmuRV0W3o1 +# elgg_mysql_password: $6$iiab51$jeTwnATcbaa92xo0QBTgjLBU.5aVDDrbKeNyyC99R/TAWz6pvfzj.L7lfnOVVjD78nxqT.gkNn6XZmuRV0W3o1 elgg_mysql_password: elgg4kids # OwnCloud @@ -234,7 +231,7 @@ rachel_doc_root: "{{ doc_root}}/modules" kiwix_install: True kiwix_port: 3000 kiwix_serve_enabled: False -xsce_zim_path: /library/zims +iiab_zim_path: /library/zims # KA Lite kalite_install: True diff --git a/vars/local_vars.yml b/vars/local_vars.yml new file mode 100644 index 000000000..d432c4f5b --- /dev/null +++ b/vars/local_vars.yml @@ -0,0 +1,29 @@ +# Put variables for your installation that override defaults here +# Better still, put this file in a branch of https://github.com/XSCE/iiab-local for your deployment + +#iiab_admin_user: iiab-admin + +# obtain a password hash with - python -c 'import crypt; print crypt.crypt("<plaintext>", "$6$<salt>")' +#iiab_admin_passw_hash: +varible: value +# 4-server-options +authserver_install: False +authserver_enabled: False +# 5-xoservices +xo_services_install: True +ejabberd_install: False +ejabberd_enabled: False +idmgr_install: False +debian_schooltool_install: False +# 6-generic-aps +# 7-edu-aps +pathagar_install: False +# 8-mgmat-tools +sugar_stats_install: False +ajenti_install: False +monit_install: True +xovis_install: False +teamviewer_install: False +activity_server_enabled: True + + diff --git a/vars/olpc.localvars b/vars/olpc.localvars index fe003ef83..a88eafd4f 100644 --- a/vars/olpc.localvars +++ b/vars/olpc.localvars @@ -1,10 +1,10 @@ # Put variables for your installation that override defaults here -# Better still, put this file in a branch of https://github.com/XSCE/xsce-local for your deployment +# Better still, put this file in a branch of https://github.com/XSCE/iiab-local for your deployment -#xsce_admin_user: xsce-admin +#iiab_admin_user: iiab-admin # obtain a password hash with - python -c 'import crypt; print crypt.crypt("<plaintext>", "$6$<salt>")' -#xsce_admin_passw_hash: +#iiab_admin_passw_hash: varible: value # 4-server-options authserver_install: False diff --git a/xsce-network b/xsce-network deleted file mode 100755 index 618bd982b..000000000 --- a/xsce-network +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -if [ -f /etc/xsce/xsce.env ] -then - . /etc/xsce/xsce.env - cd $XSCE_DIR -else - echo /etc/xsce/xsce.env is missing. Playbook has not been run. - exit 1 -fi - -if [ ! -f xsce-network.yml ] -then - echo "XSCE Playbook not found." - echo "Please run this command from the top level of the git repo." - echo "Exiting." - exit -fi - -if [ ! -f /etc/xsce/config_vars.yml ] -then - touch /etc/xsce/config_vars.yml -fi - -export ANSIBLE_LOG_PATH="$XSCE_DIR/xsce-network.log" -ansible-playbook -i ansible_hosts xsce-network.yml --connection=local -echo "" >> xsce-network.log -ls -la /etc/sys*/net*/ifcfg* >> xsce-network.log -if [ ! "OS" == "debian" ]; then - nmcli d >> xsce-network.log - nmcli c >> xsce-network.log -fi -brctl show >> xsce-network.log -echo "run on:" >> xsce-network.log -date >> xsce-network.log -echo "" >> xsce-network.log -echo "" >> xsce-network.log