From 73d2215a6e3e4be579d274533f9bedb1f953f520 Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 15 Sep 2020 15:27:41 -0400 Subject: [PATCH 01/10] scripts/ansible: refine output & code comments --- scripts/ansible | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 563f70db2..03702a861 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -1,6 +1,7 @@ #!/bin/bash -e # PLZ SEE http://FAQ.IIAB.IO > "What is Ansible and what version should I use?" +# https://github.com/iiab/iiab/tree/master/scripts/ansible.md APT_PATH=/usr/bin # Avoids problematic /usr/local/bin/apt on Linux Mint CURR_VER="undefined" # Ansible version you currently have installed @@ -11,6 +12,18 @@ GOOD_VER="2.10.1" # Orig for 'yum install [rpm]' & XO laptops (pip install) # http://ppa.launchpad.net/ansible/ansible/ubuntu/pool/main/a/ansible-base/ # https://github.com/ansible/ansible/commits/stable-2.10/changelogs/CHANGELOG-v2.10.rst +# IIAB implementers might instead consider these 2 GENERAL TECHNIQUES below +# ("in an emergency!") e.g. if you must install an older version of Ansible: + +# TEMPORARILY USE ANSIBLE 2.9.13 (REMOVE IT WITH "pip uninstall ansible") +#pip install ansible==2.9.13 + +# TEMPORARILY USE ANSIBLE 2.4.2 DUE TO 2.4.3 MEMORY BUG. Details: iiab/iiab#669 +#echo "Install http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb" +#cd /tmp +#wget http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb +#apt -y --allow-downgrades install ./ansible_2.4.2.0-1ppa~xenial_all.deb + export DEBIAN_FRONTEND=noninteractive # Why 'noninteractive' appears needed: # https://github.com/iiab/iiab/issues/564#issuecomment-347264985 @@ -37,6 +50,8 @@ else fi echo -e "(Internet-in-a-Box requests ansible-base $GOOD_VER or higher)\n" +# Code above designed to work on all Linux distributions, to preserve options, +# in support of any volunteer(s) wanting to port IIAB to a new Linux/distro. if [ ! -f /etc/debian_version ]; then # e.g. Raspbian, Ubuntu, Mint & Debian echo -e "\nEXITING: /etc/debian_version FILE NOT FOUND. Linux OS support info here:" echo -e " https://github.com/iiab/iiab/wiki/IIAB-Platforms\n" @@ -46,10 +61,18 @@ fi echo -e "\napt update; install dirmngr; PPA to /etc/apt/sources.list.d/iiab-ansible.list\n" $APT_PATH/apt update $APT_PATH/apt -y install dirmngr +# In future we might instead consider 'add-apt-repository ppa:ansible/ansible' +# or 'apt-add-repository ppa:ansible/bionic/ansible' etc, e.g. for streamlined +# removal using 'apt-add-repository -r' -- however that currently requires +# 'apt install software-properties-common' which drags in a dozen packages we +# might not want, e.g. unattended-upgrades, packagekit etc. echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" \ > /etc/apt/sources.list.d/iiab-ansible.list -# 2020-08-20: TEMP WORKAROUND (REVERT TO ANSIBLE 2.9.6) MITIGATING #2481 (Ansible 2.9.12 and 2.10.0's 666-TO-600 file permissions problem). This installs 2.9.6-1ppa~disco onto RaspiOS, from https://launchpad.net/~ansible/+archive/ubuntu/ansible +# 2020-08-20: TEMP WORKAROUND (REVERT TO ANSIBLE 2.9.6) MITIGATING +# iiab/iiab#2481 (Ansible 2.9.12 and 2.10.0's 666-TO-600 file permissions +# problem). This workaround installs 2.9.6-1ppa~disco onto RaspiOS, from +# https://launchpad.net/~ansible/+archive/ubuntu/ansible #echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu disco main" \ # > /etc/apt/sources.list.d/iiab-ansible.list @@ -65,24 +88,15 @@ echo -e "\napt update; apt install ansible-base and python3 dependencies explain echo -e "https://github.com/iiab/iiab/tree/master/scripts/ansible.md\n" $APT_PATH/apt update $APT_PATH/apt -y --allow-downgrades install ansible-base \ - python3-pymysql python3-psycopg2 python3-passlib python3-pip \ - python3-setuptools python3-venv virtualenv + python3-pymysql python3-psycopg2 python3-passlib python3-pip \ + python3-setuptools python3-venv virtualenv -# IIAB requires these 2 Ansible Collections: (with ansible-base 2.10.0 or higher) +echo -e "\n\nIIAB requires these 2 Ansible Collections: (w/ ansible-base 2.10.0 or higher)\n" ansible-galaxy collection install community.general # Re-running these ansible-galaxy collection install community.mysql # appears to be safe!? -echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible-base'\n\n" - -# TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") -#pip install ansible==2.4.4 - -# TEMPORARILY USE ANSIBLE 2.4.2 DUE TO 2.4.3 MEMORY BUG. DETAILS @ https://github.com/iiab/iiab/issues/669 -#echo "Install http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb" -#cd /tmp -#wget http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb -#apt -y --allow-downgrades install ./ansible_2.4.2.0-1ppa~xenial_all.deb - -# Needed? +echo -e "\n\nCreating/verifying directory /etc/ansible & installing /etc/ansible/hosts\n" mkdir -p /etc/ansible echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts + +echo -e "SUCCESS: VERIFY ANSIBLE WITH 'ansible --version' & 'apt -a list ansible-base'\n\n" From f9ddfd28e6bbda4dab25628db7ed22421eafcbbb Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 15 Sep 2020 15:32:25 -0400 Subject: [PATCH 02/10] Explain /etc/apt/sources.list.d/iiab-ansible.list vs. automated approach (add-apt-repository) --- scripts/ansible | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 03702a861..57fe03698 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -61,13 +61,13 @@ fi echo -e "\napt update; install dirmngr; PPA to /etc/apt/sources.list.d/iiab-ansible.list\n" $APT_PATH/apt update $APT_PATH/apt -y install dirmngr +echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" \ + > /etc/apt/sources.list.d/iiab-ansible.list # In future we might instead consider 'add-apt-repository ppa:ansible/ansible' # or 'apt-add-repository ppa:ansible/bionic/ansible' etc, e.g. for streamlined # removal using 'apt-add-repository -r' -- however that currently requires # 'apt install software-properties-common' which drags in a dozen packages we # might not want, e.g. unattended-upgrades, packagekit etc. -echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" \ - > /etc/apt/sources.list.d/iiab-ansible.list # 2020-08-20: TEMP WORKAROUND (REVERT TO ANSIBLE 2.9.6) MITIGATING # iiab/iiab#2481 (Ansible 2.9.12 and 2.10.0's 666-TO-600 file permissions From 8a6cde9aa401a75c81debd984c7a28c6b3f32c35 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 2 Sep 2020 13:07:41 -0500 Subject: [PATCH 03/10] update test.yml --- tests/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test.yml b/tests/test.yml index 12674ec24..76e7ce540 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -29,6 +29,7 @@ #- { role: ejabberd } #- { role: ejabberd_xs } - { role: elgg } + - { role: firmware } - { role: gitea } #- { role: homepage } - { role: httpd } @@ -62,6 +63,7 @@ - { role: pbx } - { role: phpmyadmin } - { role: postgresql } + - { role: pylibs } #- { role: rachel } - { role: samba } #- { role: schooltool } From bf2ad15fe0a311685204d1923520178a3b999102 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 16 Sep 2020 09:44:07 -0400 Subject: [PATCH 04/10] Refine roles/network/README.rst --- roles/network/README.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/roles/network/README.rst b/roles/network/README.rst index 38d259d71..d47a03822 100644 --- a/roles/network/README.rst +++ b/roles/network/README.rst @@ -2,19 +2,20 @@ Network README ============== -This is run by Ansible after it has installed the core (`Stages 0-to-9 `_) of Internet-in-a-Box (IIAB) and its apps/services. +This is run by `Ansible `_ after it has installed the core (`Stages 0-to-9 `_) of `Internet-in-a-Box (IIAB) `_ and its apps/services. -Specifically, this 'network' role is run: +Specifically, this 'network' role is run... -- automatically during IIAB installation, after /opt/iiab/iiab/iiab-install has run `Stages 0-to-9 <..>`_ (thanks to `iiab-stages.yml <../../iiab-stages.yml>`_) -- automatically by IIAB's Admin Console (http://box/admin) if you click ``Configure`` menu -> ``Install Configured Options`` — this is similar to the above, but only runs Stage 0, then Stage 4-to-9, and then finally this 'network' role/stage (thanks to `iiab-from-console.yml <../../iiab-from-console.yml>`_) -- or manually, if you run ``cd /opt/iiab/iiab`` then `./iiab-network <../../iiab-network>`_ (which is much the same as running ``./runrole network``) +- ...automatically during IIAB installation, after `/opt/iiab/iiab/iiab-install <../../iiab-install>`_ has run `Stages 0-to-9 <..>`_ (thanks to `iiab-stages.yml <../../iiab-stages.yml>`_) +- ...automatically by IIAB's Admin Console (http://box/admin) if you click ``Configure`` menu -> ``Install Configured Options`` — this is similar to the above, but only runs Stage 0, then Stage 4-to-9, and then finally this 'network' role/stage (thanks to `iiab-from-console.yml <../../iiab-from-console.yml>`_) +- ...or manually, if you run ``cd /opt/iiab/iiab`` then `./iiab-network <../../iiab-network>`_ (which is much the same as running ``./runrole network``) Many IIAB networking questions can be answered in these 2 documents: - `IIAB Networking `_ is a high-level summary, that reviews IIAB's 3 modes of operation distinguishing WAN from LAN, `common ports `_, DNS name resolution and some common customizations. - http://FAQ.IIAB.IO includes answers to common questions like: + - What is local_vars.yml and how do I customize it? - How do I provide Wi-Fi (wireless) to all my kids? - Can I create a Wi-Fi hotspot using an old laptop? - How do I change the wireless network name? From ce30aee953581cbf1ba64595cef180ff0d5a6d52 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 16 Sep 2020 10:08:03 -0400 Subject: [PATCH 05/10] roles/network/README.rst punctiliousness --- roles/network/README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/network/README.rst b/roles/network/README.rst index d47a03822..7c8225078 100644 --- a/roles/network/README.rst +++ b/roles/network/README.rst @@ -6,9 +6,9 @@ This is run by `Ansible `_ has run `Stages 0-to-9 <..>`_ (thanks to `iiab-stages.yml <../../iiab-stages.yml>`_) -- ...automatically by IIAB's Admin Console (http://box/admin) if you click ``Configure`` menu -> ``Install Configured Options`` — this is similar to the above, but only runs Stage 0, then Stage 4-to-9, and then finally this 'network' role/stage (thanks to `iiab-from-console.yml <../../iiab-from-console.yml>`_) -- ...or manually, if you run ``cd /opt/iiab/iiab`` then `./iiab-network <../../iiab-network>`_ (which is much the same as running ``./runrole network``) +- ...automatically during IIAB installation, after `/opt/iiab/iiab/iiab-install <../../iiab-install>`_ has run `Stages 0-to-9 <..>`_ (thanks to `iiab-stages.yml <../../iiab-stages.yml>`_). +- ...automatically by IIAB's Admin Console (http://box/admin) if you click ``Configure`` menu -> ``Install Configured Options`` — this is similar to the above, but only runs Stage 0, then Stage 4-to-9, and then finally this 'network' role/stage (thanks to `iiab-from-console.yml <../../iiab-from-console.yml>`_). +- ...or manually, if you run ``cd /opt/iiab/iiab`` then `./iiab-network <../../iiab-network>`_ (which is much the same as running ``./runrole network``). Many IIAB networking questions can be answered in these 2 documents: From 4746a142af787d68b0ebcce064b9a98fb8c5de7f Mon Sep 17 00:00:00 2001 From: George Hunt Date: Sat, 29 Aug 2020 13:13:25 -0700 Subject: [PATCH 06/10] add ctrl-interface to hostapd --- roles/network/templates/hostapd/hostapd.conf.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/network/templates/hostapd/hostapd.conf.j2 b/roles/network/templates/hostapd/hostapd.conf.j2 index 28c558e14..cc4adc408 100644 --- a/roles/network/templates/hostapd/hostapd.conf.j2 +++ b/roles/network/templates/hostapd/hostapd.conf.j2 @@ -30,3 +30,5 @@ wpa_passphrase={{ hostapd_password }} # Use AES, instead of TKIP rsn_pairwise=CCMP {% endif %} +ctrl_interface=/var/run/hostapd +ctrl_interface_group=0 From f121ae1e527bf8884f00ef3a4c72e31d32345701 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 16 Sep 2020 11:52:17 -0500 Subject: [PATCH 07/10] move to top --- roles/network/templates/hostapd/hostapd.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/network/templates/hostapd/hostapd.conf.j2 b/roles/network/templates/hostapd/hostapd.conf.j2 index cc4adc408..171f18505 100644 --- a/roles/network/templates/hostapd/hostapd.conf.j2 +++ b/roles/network/templates/hostapd/hostapd.conf.j2 @@ -1,6 +1,8 @@ # Basic configuration interface={{ iiab_wireless_lan_iface }} +ctrl_interface=/var/run/hostapd +ctrl_interface_group=0 ssid={{ host_ssid }} channel={{ host_channel }} @@ -30,5 +32,3 @@ wpa_passphrase={{ hostapd_password }} # Use AES, instead of TKIP rsn_pairwise=CCMP {% endif %} -ctrl_interface=/var/run/hostapd -ctrl_interface_group=0 From 429aa04ce5ea3341a84a55372472557035e42e42 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 17 Sep 2020 09:15:55 -0500 Subject: [PATCH 08/10] Infastructure for proper versioning. (#2500) * each major role change can be recorded in upgrade_roles with a bump in iiab_revision to denote the addition * test source for https://github.com/iiab/iiab-factory/pull/134 * keep iiab_revision with role name * gitea * introduce $INSTALLED_RELEASE $INSTALLED_REVISION into ansible * set informational 'do_facts' * 7.1.5-premap tag as starting point for iiab_revision 0 * no notes at all - use underscore for role name to match what is in iiab_state.yml * use installed_revision trigger do_upgrade do_reinstall will denote a major upgrade path in the future --- roles/0-init/defaults/main.yml | 2 ++ roles/0-init/tasks/main.yml | 47 ++++++++++++++++++++--------- roles/9-local-addons/tasks/main.yml | 6 ++++ scripts/local_facts.fact | 6 ++++ upgrade_roles | 3 ++ upgrade_roles.txt | 11 +++++++ vars/default_vars.yml | 2 +- 7 files changed, 62 insertions(+), 15 deletions(-) create mode 100644 upgrade_roles create mode 100644 upgrade_roles.txt diff --git a/roles/0-init/defaults/main.yml b/roles/0-init/defaults/main.yml index 4a9b1e4c1..fe0bb4dcf 100644 --- a/roles/0-init/defaults/main.yml +++ b/roles/0-init/defaults/main.yml @@ -8,6 +8,8 @@ first_run: False rpi_model: none xo_model: none +do_upgrade: False +do_reinstall: False gw_active: False internet_available: False discovered_wan_iface: none diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index 7b4fa58c4..5915b936a 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -1,20 +1,21 @@ # Initialize - name: ...IS BEGINNING ============================================ - stat: - path: "{{ iiab_env_file }}" - register: NewInstall - -- name: Set first_run flag - set_fact: - first_run: True - when: not NewInstall.stat.exists - -- name: Set top-level variables from local_facts for convenience +#- name: Re-read local_facts.facts from /etc/ansible/facts.d +# setup: +# filter: ansible_local +#- name: Set top-level variables from local_facts for convenience set_fact: rpi_model: "{{ ansible_local.local_facts.rpi_model }}" xo_model: "{{ ansible_local.local_facts.xo_model }}" phplib_dir: "{{ ansible_local.local_facts.phplib_dir }}" iiab_stage: "{{ ansible_local.local_facts.stage }}" + installed_release: "{{ ansible_local.local_facts.installed_release }}" + installed_revision: "{{ ansible_local.local_facts.installed_revision }}" + +- name: Set first_run flag + set_fact: + first_run: True + when: iiab_stage | int == 0 # We need to inialize the ini file and only write the location and version # sections once and only once to preserve the install date and git hash. @@ -36,13 +37,31 @@ path: /etc/iiab/diag mode: '0777' -- name: Re-read local_facts.facts from /etc/ansible/facts.d - setup: - filter: ansible_local - - name: Pre-check that IIAB's "XYZ_install" + "XYZ_enabled" vars (1) are defined, (2) are boolean-not-string variables, and (3) contain plausible values. Also checks that "XYZ_install" is True when "XYZ_installed" is defined. include_tasks: validate_vars.yml +# the below 2 stanza don't do anything functional at the moment, more +# informational you will see 'changed'. The real work would be done by +# iiab-upgrade via auto deleting the *_installed flag in iiab_state.yml +# based on entries in upgrade_roles. It is just plain easier to delete the +# marker before ansible loads iiab_state.yml like runrole --reinstall does. +# https://github.com/jvonau/iiab-factory/blob/iiab-upgrade/iiab-upgrade +# Might work on loading iiab_state.yml on demand via conditionals in the future. + +# this one is informational you will see 'changed'. +- name: Upgrade situation detected + set_fact: + do_upgrade: True + when: installed_revision|int < iiab_revision|int + +# leave at 7.2 when branching to 7.3, bump to 7.3 when 7.4 or 8.0 comes along. +# does nothing at the moment for future use, just denotes a major change in the +# starting point of the install. +- name: Reinstall situation detected + set_fact: + do_reinstall: True + when: not installed_release == "0" and installed_release == "7.2" + # Discover: do we have a gateway? # If Ansible detects gateway, becomes WAN candidate. - name: "Do we have a gateway? If so set discovered_wan_iface: {{ ansible_default_ipv4.alias }}" diff --git a/roles/9-local-addons/tasks/main.yml b/roles/9-local-addons/tasks/main.yml index a3d75b443..7427cc37b 100644 --- a/roles/9-local-addons/tasks/main.yml +++ b/roles/9-local-addons/tasks/main.yml @@ -30,6 +30,12 @@ name: calibre-web when: calibreweb_install | bool +- name: Record IIAB_REVISION + lineinfile: + path: "{{ iiab_env_file }}" + regexp: '^IIAB_REVISION=*' + line: 'IIAB_REVISION={{ iiab_revision }}' + - name: Recording STAGE 9 HAS COMPLETED ==================== lineinfile: path: "{{ iiab_env_file }}" diff --git a/scripts/local_facts.fact b/scripts/local_facts.fact index 35b409493..68f59f5c8 100755 --- a/scripts/local_facts.fact +++ b/scripts/local_facts.fact @@ -5,8 +5,12 @@ if [ -f /etc/iiab/iiab.env ]; then source /etc/iiab/iiab.env STAGE=$STAGE + INSTALLED_RELEASE=$IIAB_RELEASE + INSTALLED_REVISION=$IIAB_REVISION else STAGE=0 + INSTALLED_RELEASE=0 + INSTALLED_REVISION=0 fi OS=`grep ^ID= /etc/*elease|cut -d= -f2` @@ -84,6 +88,8 @@ SYSD_NETD=`systemctl is-enabled systemd-networkd` cat < Date: Thu, 17 Sep 2020 11:15:33 -0400 Subject: [PATCH 09/10] Revert "Infastructure for proper versioning. (#2500)" This reverts commit 429aa04ce5ea3341a84a55372472557035e42e42. --- roles/0-init/defaults/main.yml | 2 -- roles/0-init/tasks/main.yml | 47 +++++++++-------------------- roles/9-local-addons/tasks/main.yml | 6 ---- scripts/local_facts.fact | 6 ---- upgrade_roles | 3 -- upgrade_roles.txt | 11 ------- vars/default_vars.yml | 2 +- 7 files changed, 15 insertions(+), 62 deletions(-) delete mode 100644 upgrade_roles delete mode 100644 upgrade_roles.txt diff --git a/roles/0-init/defaults/main.yml b/roles/0-init/defaults/main.yml index fe0bb4dcf..4a9b1e4c1 100644 --- a/roles/0-init/defaults/main.yml +++ b/roles/0-init/defaults/main.yml @@ -8,8 +8,6 @@ first_run: False rpi_model: none xo_model: none -do_upgrade: False -do_reinstall: False gw_active: False internet_available: False discovered_wan_iface: none diff --git a/roles/0-init/tasks/main.yml b/roles/0-init/tasks/main.yml index 5915b936a..7b4fa58c4 100644 --- a/roles/0-init/tasks/main.yml +++ b/roles/0-init/tasks/main.yml @@ -1,21 +1,20 @@ # Initialize - name: ...IS BEGINNING ============================================ -#- name: Re-read local_facts.facts from /etc/ansible/facts.d -# setup: -# filter: ansible_local -#- name: Set top-level variables from local_facts for convenience + stat: + path: "{{ iiab_env_file }}" + register: NewInstall + +- name: Set first_run flag + set_fact: + first_run: True + when: not NewInstall.stat.exists + +- name: Set top-level variables from local_facts for convenience set_fact: rpi_model: "{{ ansible_local.local_facts.rpi_model }}" xo_model: "{{ ansible_local.local_facts.xo_model }}" phplib_dir: "{{ ansible_local.local_facts.phplib_dir }}" iiab_stage: "{{ ansible_local.local_facts.stage }}" - installed_release: "{{ ansible_local.local_facts.installed_release }}" - installed_revision: "{{ ansible_local.local_facts.installed_revision }}" - -- name: Set first_run flag - set_fact: - first_run: True - when: iiab_stage | int == 0 # We need to inialize the ini file and only write the location and version # sections once and only once to preserve the install date and git hash. @@ -37,31 +36,13 @@ path: /etc/iiab/diag mode: '0777' +- name: Re-read local_facts.facts from /etc/ansible/facts.d + setup: + filter: ansible_local + - name: Pre-check that IIAB's "XYZ_install" + "XYZ_enabled" vars (1) are defined, (2) are boolean-not-string variables, and (3) contain plausible values. Also checks that "XYZ_install" is True when "XYZ_installed" is defined. include_tasks: validate_vars.yml -# the below 2 stanza don't do anything functional at the moment, more -# informational you will see 'changed'. The real work would be done by -# iiab-upgrade via auto deleting the *_installed flag in iiab_state.yml -# based on entries in upgrade_roles. It is just plain easier to delete the -# marker before ansible loads iiab_state.yml like runrole --reinstall does. -# https://github.com/jvonau/iiab-factory/blob/iiab-upgrade/iiab-upgrade -# Might work on loading iiab_state.yml on demand via conditionals in the future. - -# this one is informational you will see 'changed'. -- name: Upgrade situation detected - set_fact: - do_upgrade: True - when: installed_revision|int < iiab_revision|int - -# leave at 7.2 when branching to 7.3, bump to 7.3 when 7.4 or 8.0 comes along. -# does nothing at the moment for future use, just denotes a major change in the -# starting point of the install. -- name: Reinstall situation detected - set_fact: - do_reinstall: True - when: not installed_release == "0" and installed_release == "7.2" - # Discover: do we have a gateway? # If Ansible detects gateway, becomes WAN candidate. - name: "Do we have a gateway? If so set discovered_wan_iface: {{ ansible_default_ipv4.alias }}" diff --git a/roles/9-local-addons/tasks/main.yml b/roles/9-local-addons/tasks/main.yml index 7427cc37b..a3d75b443 100644 --- a/roles/9-local-addons/tasks/main.yml +++ b/roles/9-local-addons/tasks/main.yml @@ -30,12 +30,6 @@ name: calibre-web when: calibreweb_install | bool -- name: Record IIAB_REVISION - lineinfile: - path: "{{ iiab_env_file }}" - regexp: '^IIAB_REVISION=*' - line: 'IIAB_REVISION={{ iiab_revision }}' - - name: Recording STAGE 9 HAS COMPLETED ==================== lineinfile: path: "{{ iiab_env_file }}" diff --git a/scripts/local_facts.fact b/scripts/local_facts.fact index 68f59f5c8..35b409493 100755 --- a/scripts/local_facts.fact +++ b/scripts/local_facts.fact @@ -5,12 +5,8 @@ if [ -f /etc/iiab/iiab.env ]; then source /etc/iiab/iiab.env STAGE=$STAGE - INSTALLED_RELEASE=$IIAB_RELEASE - INSTALLED_REVISION=$IIAB_REVISION else STAGE=0 - INSTALLED_RELEASE=0 - INSTALLED_REVISION=0 fi OS=`grep ^ID= /etc/*elease|cut -d= -f2` @@ -88,8 +84,6 @@ SYSD_NETD=`systemctl is-enabled systemd-networkd` cat < Date: Sat, 19 Sep 2020 22:38:27 -0400 Subject: [PATCH 10/10] Stale comment in 2-common/tasks/packages.yml --- roles/2-common/tasks/packages.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index c22ba2944..342a0ab7e 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -27,7 +27,7 @@ state: present when: is_debuntu | bool -- name: "Install 24 common packages: acpid, bridge-utils, bzip2, curl, gawk, hostapd, htop, i2c-tools, logrotate, make, mlocate, netmask, net-tools, ntfs-3g, pandoc, pastebinit, rsync, sqlite3, sudo, tar, unzip, usbmount, usbutils, wget" +- name: "Install 23 common packages: acpid, bridge-utils, bzip2, curl, gawk, hostapd, htop, i2c-tools, logrotate, make, mlocate, netmask, net-tools, ntfs-3g, pandoc, pastebinit, rsync, sqlite3, sudo, tar, unzip, usbutils, wget" package: name: - acpid @@ -40,7 +40,7 @@ - htop - i2c-tools - logrotate - #- lynx # already installed by 1-prep's roles/iiab-admin/tasks/access.yml + #- lynx # Already installed by 1-prep's roles/iiab-admin/tasks/access.yml - make - mlocate - netmask @@ -54,6 +54,7 @@ - sudo - tar - unzip + #- usbmount # Moved to roles/usb_lib/tasks/install.yml - usbutils - wget state: present