From a8a117cdf2dbf479208c34d45454668f98975981 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 5 Aug 2020 13:57:58 -0400 Subject: [PATCH 1/5] Update runrole --- runrole | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/runrole b/runrole index cb8189a60..4edc63f6a 100755 --- a/runrole +++ b/runrole @@ -34,10 +34,21 @@ fi # exit 1 #fi +# 2020-08-05: yes /etc/iiab/iiab_state.yml is necessary, but we DON'T +# want to encourage sloppy operators to delete/touch this file. +# +# (The iiab_state.yml file should always be created by ./iiab-install, +# for IIAB's Ansible roles that then auto-populate this file.) +# +# FYI iiab-network and iiab-configure likewise warn operators (IN RED!) +# if they try to run without the existence of /etc/iiab/iiab_state.yml : +# +# ERROR! vars file /etc/iiab/iiab_state.yml was not found +# # Needed for Stages 1-3 if not installed yet -if [ ! -f $IIAB_STATE_FILE ]; then - touch $IIAB_STATE_FILE -fi +#if [ ! -f $IIAB_STATE_FILE ]; then +# touch $IIAB_STATE_FILE +#fi #if ! grep -q $1_install $LOCAL_VARS_FILE; then # echo " $1_install: not found in $VARS" From 0280d02a0b42fff102095eb00ed185357ead3e72 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 5 Aug 2020 13:59:34 -0400 Subject: [PATCH 2/5] Update iiab-install --- iiab-install | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index 8a4a18560..665f3edd5 100755 --- a/iiab-install +++ b/iiab-install @@ -178,7 +178,12 @@ fi # Allow iiab-install to read IIAB_STATE_FILE to not repeat installs of previous # roles that already completed within the stage. if [ ! -f $IIAB_STATE_FILE ]; then - touch $IIAB_STATE_FILE + #touch $IIAB_STATE_FILE + cat > $IIAB_STATE_FILE << EOF +# DO *NOT* MANUALLY EDIT THIS, THANKS! +# IIAB does NOT currently support uninstalling apps. + +EOF fi echo -e "\nTRY TO RERUN './iiab-install' IF IT FAILS DUE TO CONNECTIVITY ISSUES ETC!\n" From 97f91177c86f5d15fe95059d43daacaaeb404660 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 5 Aug 2020 14:06:25 -0400 Subject: [PATCH 3/5] Update iiab-install --- iiab-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-install b/iiab-install index 665f3edd5..6eeac2db6 100755 --- a/iiab-install +++ b/iiab-install @@ -181,7 +181,7 @@ if [ ! -f $IIAB_STATE_FILE ]; then #touch $IIAB_STATE_FILE cat > $IIAB_STATE_FILE << EOF # DO *NOT* MANUALLY EDIT THIS, THANKS! -# IIAB does NOT currently support uninstalling apps. +# IIAB does NOT currently support uninstalling apps/services. EOF fi From 853ddf1a1ace3afe865443bc4a4a3d180cbbf629 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 5 Aug 2020 14:17:58 -0400 Subject: [PATCH 4/5] Remove legacy code from iiab-install --- iiab-install | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/iiab-install b/iiab-install index 6eeac2db6..261893cf3 100755 --- a/iiab-install +++ b/iiab-install @@ -145,36 +145,7 @@ if [ "$STAGE" -lt 2 ] && [ "$1" == "--debug" ]; then echo -e "\n'--debug' *ignored* as STAGE (counter) < 2." fi -# TEMPORARY: Catch images up to current code to benefit from pre-installed apps -# Workaround for (web-published) images; will go away later -# Assumes /etc/iiab/iiab_state.yml is not created until (prior run of) Stage 4 but -# config_vars2.yml is present with the stage counter altered by pi-gen to be 2. -if [ -f /etc/iiab/config_vars2.yml ]; then - mv /etc/iiab/config_vars2.yml $IIAB_STATE_FILE - -# Fix up prior values in state file -# mongo role improved post image creation - if grep -q sugar $IIAB_STATE_FILE && ! grep -q mongodb $IIAB_STATE_FILE; then - echo "mongodb_installed: True" >> $IIAB_STATE_FILE - fi - -# TEMPORARY: another change to account for -# sed -i -e 's/pan_bluetooth/bluetooth/' $IIAB_STATE_FILE - - if [ "$STAGE" -eq 2 ]; then - echo -e "\nCompleting Stage 3 from IIAB image (starts systemd service iiab-setup-db to run the 'mysql' role)." - systemctl start iiab-setup-db - fi - - PLAYBOOK="iiab-from-console.yml" # Stage 4-9 then Network Role - ARGS="" # Removes '--extra-vars reinstall=True' if --reinstall, BUT WHY? -# The same as --reinstall except Stage 3 is not run as there are no other functional -# changes in Stage 3 to account for post image creation, once the above is run. -# reinstall=True would force kiwix to re-download and re-install in commit -# ce2ec3b0cad76449caf3299003b5d297a3164181 -## End image catch up -fi - +# /etc/iiab/iiab_state.yml is mandatory and must be created here. Background: # Allow iiab-install to read IIAB_STATE_FILE to not repeat installs of previous # roles that already completed within the stage. if [ ! -f $IIAB_STATE_FILE ]; then From 2357a9eed1362e4d69d4e9bf20210a0652d2f81d Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 5 Aug 2020 14:20:02 -0400 Subject: [PATCH 5/5] Update runrole --- runrole | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runrole b/runrole index 4edc63f6a..b1615bf43 100755 --- a/runrole +++ b/runrole @@ -40,7 +40,7 @@ fi # (The iiab_state.yml file should always be created by ./iiab-install, # for IIAB's Ansible roles that then auto-populate this file.) # -# FYI iiab-network and iiab-configure likewise warn operators (IN RED!) +# FYI ./iiab-network and ./iiab-configure likewise warn operators (IN RED!) # if they try to run without the existence of /etc/iiab/iiab_state.yml : # # ERROR! vars file /etc/iiab/iiab_state.yml was not found