mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 11:12:06 +00:00
2008 var names, output, comments, small bugs
This commit is contained in:
parent
6be97bba6c
commit
38fd86ac90
42 changed files with 144 additions and 137 deletions
|
@ -1,48 +1,51 @@
|
|||
#!/bin/bash
|
||||
|
||||
INVENTORY="ansible_hosts"
|
||||
PLAYBOOK="iiab-from-cmdline.yml"
|
||||
INVENTORY=ansible_hosts
|
||||
PLAYBOOK=iiab-from-cmdline.yml
|
||||
CWD=`pwd`
|
||||
APPS=/etc/iiab/iiab_state.yml
|
||||
ENV=/etc/iiab/iiab.env
|
||||
IIAB_STATE_FILE=/etc/iiab/iiab_state.yml
|
||||
IIAB_ENV_FILE=/etc/iiab/iiab.env
|
||||
|
||||
if [ ! -f $PLAYBOOK ]; then
|
||||
echo -e "\nExiting: IIAB Playbook not found."
|
||||
echo -e "\nExiting: IIAB Playbook $PLAYBOOK not found."
|
||||
echo -e "\nPlease run this in /opt/iiab/iiab (top level of the git repo)."
|
||||
exit 1
|
||||
fi
|
||||
if [ -f $ENV ]; then
|
||||
|
||||
if [ -f $IIAB_ENV_FILE ]; then
|
||||
STAGE=0
|
||||
if grep -q STAGE= /etc/iiab/iiab.env ; then
|
||||
source /etc/iiab/iiab.env
|
||||
echo -e "\nExtracted STAGE="$STAGE" (counter) from /etc/iiab/iiab.env"
|
||||
echo -e "\nExtracted STAGE=$STAGE (counter) from /etc/iiab/iiab.env"
|
||||
if ! [ "$STAGE" -eq "$STAGE" ] 2> /dev/null; then
|
||||
echo -e "\nEXITING: STAGE (counter) value == "$STAGE" is non-integer"
|
||||
echo -e "\nEXITING: STAGE (counter) value == $STAGE is non-integer"
|
||||
exit 1
|
||||
elif [ "$STAGE" -lt 0 ] || [ "$STAGE" -gt 9 ]; then
|
||||
echo -e "\nEXITING: STAGE (counter) value == "$STAGE" is out-of-range"
|
||||
echo -e "\nEXITING: STAGE (counter) value == $STAGE is out-of-range"
|
||||
exit 1
|
||||
elif [ "$STAGE" -lt 3 ]; then
|
||||
echo -e "\nEXITING: STAGE (counter) value == "$STAGE""
|
||||
echo -e "\nIIAB stage 3 not complete"
|
||||
echo -e "\nPlease run iiab-install"
|
||||
echo -e "\nEXITING: STAGE (counter) value == $STAGE"
|
||||
echo -e "\nIIAB Stage 3 not complete."
|
||||
echo -e "\nPlease run: ./iiab-install"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo -e "\nEXITING: STAGE (counter) not found"
|
||||
echo -e "\nIIAB not installed"
|
||||
echo -e "\nPlease run iiab-install"
|
||||
echo -e "\nIIAB not installed."
|
||||
echo -e "\nPlease run: ./iiab-install"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo -e "\nEXITING: /etc/iiab/iiab.env not found"
|
||||
echo -e "\nIIAB not installed"
|
||||
echo -e "\nPlease run iiab-install"
|
||||
echo -e "\nIIAB not installed."
|
||||
echo -e "\nPlease run: ./iiab-install"
|
||||
exit 1
|
||||
fi
|
||||
# workaround for image go away later
|
||||
if grep -q sugar $APPS; then
|
||||
if ! grep -q mongodb $APPS; then
|
||||
echo "mongodb_installed: True" >> $APPS
|
||||
|
||||
# Workaround for (web-published) images; will go away later
|
||||
if grep -q sugar $IIAB_STATE_FILE; then
|
||||
if ! grep -q mongodb $IIAB_STATE_FILE; then
|
||||
echo "mongodb_installed: True" >> $IIAB_STATE_FILE
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
59
iiab-install
59
iiab-install
|
@ -3,9 +3,9 @@
|
|||
# Add cmdline options for passing to ansible
|
||||
# Todo add proper shift to gobble up --debug --reinstall
|
||||
|
||||
PLAYBOOK="iiab-stages.yml"
|
||||
INVENTORY="ansible_hosts"
|
||||
APPS=/etc/iiab/iiab_state.yml
|
||||
PLAYBOOK=iiab-stages.yml
|
||||
INVENTORY=ansible_hosts
|
||||
IIAB_STATE_FILE=/etc/iiab/iiab_state.yml
|
||||
ARGS=""
|
||||
CWD=`pwd`
|
||||
OS=`grep ^ID= /etc/*release|cut -d= -f2`
|
||||
|
@ -31,7 +31,7 @@ if [ ! -f /etc/iiab/local_vars.yml ]; then
|
|||
echo -e "(2) MIN/MEDIUM/BIG samples are included in /opt/iiab/iiab/vars" >&2
|
||||
echo -e "(3) NO TIME FOR DETAILS? RUN INTERNET-IN-A-BOX'S FRIENDLY 1-LINE INSTALLER:\n" >&2
|
||||
|
||||
echo -e ' http://download.iiab.io (click on "6.7" or a more recent version!)\n' >&2
|
||||
echo -e ' http://download.iiab.io (click on "7.0" or a more recent version!)\n' >&2
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
@ -54,10 +54,11 @@ fi
|
|||
|
||||
if [ "$1" != "--debug" ] && [ "$1" != "--reinstall" ] && [ "$1" != "" ]; then
|
||||
echo "Use './iiab-install' for regular installs, or to continue an install."
|
||||
echo "Use './iiab-install --reinstall' to force running all Stages 0-9."
|
||||
echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9."
|
||||
echo "Use './runrole' to run a single Stage or Role."
|
||||
echo "Use './iiab-network' to run Network sections."
|
||||
echo "Use './iiab-install --reinstall' to force running all Stages 0-9, followed by the Network Role."
|
||||
echo "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9, followed by the Network Role."
|
||||
echo "Use './iiab-configure' to run Stage 0, followed by Stages 4-9."
|
||||
echo "Use './runrole' to run Stage 0, followed by a single Stage or Role."
|
||||
echo "Use './iiab-network' to run Stage 0, followed by the Network Role."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -119,12 +120,8 @@ if [ -f /etc/iiab/iiab.env ]; then
|
|||
exit 1
|
||||
fi
|
||||
fi
|
||||
# if XSCE is present resolveconf will not be
|
||||
if grep -q XSCE /etc/iiab/iiab.env ; then
|
||||
STAGE=0
|
||||
rm /etc/iiab/iiab.env
|
||||
echo "Removed /etc/iiab/iiab.env effectively resetting STAGE (counter)."
|
||||
elif [ "$1" == "--reinstall" ]; then
|
||||
|
||||
if [ "$1" == "--reinstall" ]; then
|
||||
STAGE=0
|
||||
ARGS="$ARGS"" --extra-vars reinstall=True"
|
||||
sed -i 's/^STAGE=.*/STAGE=0/' /etc/iiab/iiab.env
|
||||
|
@ -135,40 +132,42 @@ if [ -f /etc/iiab/iiab.env ]; then
|
|||
echo "Wrote STAGE=2 (counter) to /etc/iiab/iiab.env"
|
||||
elif [ "$STAGE" -eq 9 ]; then
|
||||
echo -e "\nEXITING: STAGE (counter) in /etc/iiab/iiab.env shows Stage 9 Is Already Done."
|
||||
echo -e "Use './iiab-install --reinstall' to force running all Stages 0-9."
|
||||
echo -e "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9."
|
||||
echo -e "Use './runrole' to run a single Stage or Role."
|
||||
echo -e "Use './iiab-network' to run Network sections.\n\n"
|
||||
echo -e "Use './iiab-configure' to turn installed service on|off via local_vars.yml.\n\n"
|
||||
exit 0 # allows rerunning http://download.iiab.io/6.7/install.txt
|
||||
echo -e "Use './iiab-install --reinstall' to force running all Stages 0-9, followed by the Network Role."
|
||||
echo -e "Use './iiab-install --debug' to run Stage 0, followed by Stages 3-9, followed by the Network Role."
|
||||
echo -e "Use './iiab-configure' to run Stage 0, followed by Stages 4-9."
|
||||
echo -e "Use './runrole' to run Stage 0, followed by a single Stage or Role."
|
||||
echo -e "Use './iiab-network' to run Stage 0, followed by the Network Role.\n\n"
|
||||
|
||||
exit 0 # Allows rerunning http://download.iiab.io/install.txt
|
||||
fi
|
||||
fi
|
||||
if [ "$STAGE" -lt 2 ] && [ "$1" == "--debug" ]; then
|
||||
echo -e "\n'--debug' *ignored* as STAGE (counter) < 2."
|
||||
fi
|
||||
|
||||
# to catch up images to current code to benefit from pre-installed apps
|
||||
# TEMPORARY: Catch images up to current code to benefit from pre-installed apps
|
||||
if [ -f /etc/iiab/config_vars2.yml ]; then
|
||||
mv /etc/iiab/config_vars2.yml $APPS
|
||||
mv /etc/iiab/config_vars2.yml $IIAB_STATE_FILE
|
||||
fi
|
||||
|
||||
if [ -f $APPS ]; then
|
||||
if grep -q sugar $APPS; then
|
||||
if ! grep -q mongodb $APPS; then
|
||||
echo "mongodb_installed: True" >> $APPS
|
||||
# Assumes /etc/iiab/iiab_state.yml is not created until (prior run of) Stage 4.
|
||||
if [ -f $IIAB_STATE_FILE ]; then
|
||||
if grep -q sugar $IIAB_STATE_FILE; && ! grep -q mongodb $IIAB_STATE_FILE; then
|
||||
echo "mongodb_installed: True" >> $IIAB_STATE_FILE
|
||||
fi
|
||||
|
||||
if [ "$STAGE" -eq 2 ]; then
|
||||
echo -e "\n completing stage 3 from iiab image"
|
||||
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"
|
||||
ARGS=""
|
||||
|
||||
PLAYBOOK="iiab-from-console.yml" # Stage 4-9 then Network Role
|
||||
ARGS="" # Removes '--extra-vars reinstall=True' if --reinstall, BUT WHY?
|
||||
fi
|
||||
|
||||
echo -e "\nTRY TO RERUN './iiab-install' IF IT FAILS DUE TO CONNECTIVITY ISSUES ETC!\n"
|
||||
|
||||
echo -e "Running local playbooks....Stage 0 will now run....followed by Stages $(($STAGE + 1))-9"
|
||||
echo -e "Running local Ansible playbooks...\n...Stage 0 will now run\n...followed by Stages $(($STAGE + 1))-9\n...and then the Network Role.\n"
|
||||
|
||||
export ANSIBLE_LOG_PATH="$CWD""/iiab-install.log"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
- name: ...IS BEGINNING ==================================
|
||||
file:
|
||||
path: "{{ iiab_installed }}"
|
||||
path: "{{ iiab_state_file }}"
|
||||
state: touch
|
||||
|
||||
- name: NGINX
|
||||
|
@ -34,7 +34,7 @@
|
|||
- name: Install Bluetooth - only on Raspberry Pi
|
||||
include_role:
|
||||
name: bluetooth
|
||||
when: (is_rpi and bluetooth_install) or pan_bluetooth_installed is defined
|
||||
when: (is_rpi and bluetooth_install) or bluetooth_installed is defined
|
||||
tags: bluetooth
|
||||
|
||||
- name: USB-LIB
|
||||
|
|
|
@ -94,9 +94,9 @@
|
|||
shell: /usr/bin/perl /usr/lib/cgi-bin/awstats.pl -config=schoolserver -update
|
||||
when: awstats_enabled and is_debuntu
|
||||
|
||||
- name: Add 'awstats_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'awstats_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^awstats_installed'
|
||||
line: 'awstats_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -64,9 +64,9 @@
|
|||
args:
|
||||
chdir: "{{ azuracast_host_dir }}"
|
||||
|
||||
- name: Add 'azuracast_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'azuracast_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^azuracast_installed'
|
||||
line: 'azuracast_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -55,9 +55,9 @@
|
|||
regexp: '^#DiscoverableTimeout'
|
||||
line: 'DiscoverableTimeout = 0'
|
||||
|
||||
- name: Add 'pan_bluetooth_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'bluetooth_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
regexp: '^pan_bluetooth_installed'
|
||||
line: 'pan_bluetooth_installed: True'
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^bluetooth_installed'
|
||||
line: 'bluetooth_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
- include_tasks: install.yml
|
||||
when: bluetooth_install and not pan_bluetooth_installed is defined
|
||||
when: bluetooth_install and not bluetooth_installed is defined
|
||||
|
||||
- include_tasks: enable.yml
|
||||
when: bluetooth_install or pan_bluetooth_installed is defined
|
||||
when: bluetooth_install or bluetooth_installed is defined
|
||||
|
||||
|
|
|
@ -102,9 +102,9 @@
|
|||
when: not metadatadb.stat.exists
|
||||
#when: calibreweb_provision | bool
|
||||
|
||||
- name: Add 'calibreweb_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'calibreweb_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^calibreweb_installed'
|
||||
line: 'calibreweb_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -79,9 +79,9 @@
|
|||
include_tasks: create-db.yml
|
||||
when: not calibre_db.stat.exists
|
||||
|
||||
- name: Add 'calibre_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'calibre_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^calibreweb_installed'
|
||||
line: 'calibre_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -119,9 +119,9 @@
|
|||
state: absent
|
||||
when: not captive_portal_enabled
|
||||
|
||||
- name: Add 'captiveportal_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'captiveportal_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^captiveportal_installed'
|
||||
line: 'captiveportal_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
tags:
|
||||
- download
|
||||
|
||||
- name: Add 'cups_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'cups_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^cups_installed'
|
||||
line: 'cups_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -48,9 +48,9 @@
|
|||
state: directory
|
||||
recurse: yes
|
||||
|
||||
- name: Add 'dokuwiki_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'dokuwiki_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^dokuwiki_installed'
|
||||
line: 'dokuwiki_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -87,9 +87,9 @@
|
|||
src: elgg.conf
|
||||
dest: "/etc/{{ apache_config_dir }}/elgg.conf"
|
||||
|
||||
- name: Add 'elgg_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'elgg_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^elgg_installed'
|
||||
line: 'elgg_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
when: elgg_install and not elgg_installed is defined
|
||||
|
||||
- name: Provision DB
|
||||
include_tasks: prov-db.yml
|
||||
include_tasks: setup.yml
|
||||
when: elgg_install and not installing
|
||||
|
||||
- name: Enable Elgg
|
||||
|
|
|
@ -125,9 +125,9 @@
|
|||
tags:
|
||||
- systemd
|
||||
|
||||
- name: Add 'gitea_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'gitea_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^gitea_installed'
|
||||
line: 'gitea_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -45,9 +45,9 @@
|
|||
- { src: 'internetarchive.service.j2', dest: '/etc/systemd/system/internetarchive.service' }
|
||||
- { src: 'internetarchive.conf', dest: '/etc/apache2/sites-available/internetarchive.conf' }
|
||||
|
||||
- name: Add 'internetarchive_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'internetarchive_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^internetarchive_installed'
|
||||
line: 'internetarchive_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
async: 1800
|
||||
poll: 10
|
||||
|
||||
- name: Add 'kalite_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'kalite_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^kalite_installed'
|
||||
line: 'kalite_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -100,9 +100,9 @@
|
|||
- { src: 'iiab-make-kiwix-lib.py', dest: '/usr/bin/iiab-make-kiwix-lib.py', mode: '0755'}
|
||||
- { src: 'kiwix.conf.j2', dest: '/etc/{{ apache_config_dir }}/kiwix.conf', mode: '0644'}
|
||||
|
||||
- name: Add 'kiwix_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'kiwix_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^kiwix_installed'
|
||||
line: 'kiwix_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -112,9 +112,9 @@
|
|||
# apache2_module:
|
||||
# name: proxy_http
|
||||
|
||||
- name: Add 'kolibri_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'kolibri_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^kolibri_installed'
|
||||
line: 'kolibri_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -98,9 +98,9 @@
|
|||
state: restarted
|
||||
when: lokole_enabled | bool
|
||||
|
||||
- name: Add 'lokole_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'lokole_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^lokole_installed'
|
||||
line: 'lokole_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -65,9 +65,9 @@
|
|||
src: mediawiki.conf.j2
|
||||
dest: "/etc/{{ apache_config_dir }}/mediawiki.conf"
|
||||
|
||||
- name: Add 'mediawiki_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'mediawiki_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^mediawiki_installed'
|
||||
line: 'mediawiki_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -71,9 +71,9 @@
|
|||
path: "{{ minetest_game_dir }}/mods/name_restrictions"
|
||||
when: minetest_default_game == "carbone-ng"
|
||||
|
||||
- name: Add 'minetest_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'minetest_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^minetest_installed'
|
||||
line: 'minetest_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -128,9 +128,9 @@
|
|||
- { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service', mode: '0644' }
|
||||
- { src: 'iiab-mongodb-repair-if-no-lock.j2', dest: '/usr/bin/iiab-mongodb-repair-if-no-lock', mode: '0755' }
|
||||
|
||||
- name: Add 'mongodb_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'mongodb_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^mongodb_installed'
|
||||
line: 'mongodb_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -138,9 +138,9 @@
|
|||
path: "{{ moodle_base }}/config.php"
|
||||
mode: 0644
|
||||
|
||||
- name: Add 'moodle_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'moodle_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^moodle_installed'
|
||||
line: 'moodle_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
group: root
|
||||
mode: 0755
|
||||
|
||||
- name: Add 'mosquitto_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'mosquitto_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^mosquitto_installed'
|
||||
line: 'mosquitto_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -40,9 +40,9 @@
|
|||
create: yes
|
||||
state: present
|
||||
|
||||
- name: Add 'munin_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'munin_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^munin_installed'
|
||||
line: 'munin_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -50,9 +50,9 @@
|
|||
state: directory
|
||||
when: ansible_distribution == "CentOS"
|
||||
|
||||
- name: Add 'dansguardian_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'dansguardian_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^dansguardian_installed'
|
||||
line: 'dansguardian_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -60,9 +60,9 @@
|
|||
state: file
|
||||
when: is_redhat | bool
|
||||
|
||||
- name: Add 'dhcpd_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'dhcpd_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^dhcpd_installed'
|
||||
line: 'dhcpd_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -100,9 +100,9 @@
|
|||
state: absent
|
||||
when: not is_debuntu and not dns_jail_enabled
|
||||
|
||||
- name: Add 'named_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'named_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^named_installed'
|
||||
line: 'named_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -82,9 +82,9 @@
|
|||
- include_tasks: roles/network/tasks/dansguardian.yml
|
||||
when: dansguardian_install | bool
|
||||
|
||||
- name: Add 'squid_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'squid_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^squid_installed'
|
||||
line: 'squid_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
group: root
|
||||
state: link
|
||||
|
||||
- name: Add 'wondershaper_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'wondershaper_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^wondershaper_installed'
|
||||
line: 'wondershaper_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -182,9 +182,9 @@
|
|||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Add 'nextcloud_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'nextcloud_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^nextcloud_installed'
|
||||
line: 'nextcloud_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
when: nextcloud_install and (not nextcloud_installed is defined or not nextcloud_page.stat.exists)
|
||||
|
||||
- name: Provision NextCloud's Mysql DB
|
||||
include_tasks: prov-db.yml
|
||||
include_tasks: setup.yml
|
||||
when: nextcloud_install and not installing
|
||||
|
||||
- name: Enables or disable Nextcloud!
|
||||
|
|
|
@ -97,9 +97,9 @@
|
|||
state: present
|
||||
name: proxy_wstunnel
|
||||
|
||||
- name: Add 'nodered_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'nodered_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^nodered_installed'
|
||||
line: 'nodered_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
src: smb.conf.j2
|
||||
dest: /etc/samba/smb.conf
|
||||
|
||||
- name: Add 'samba_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'samba_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^samba_installed'
|
||||
line: 'samba_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -221,9 +221,9 @@
|
|||
# # Use this instead, if tabs are truly nec:
|
||||
# # block: "\tvar pathPrefix = '/sugarizer';\n\tapp.use(pathPrefix, require('path-prefix-proxy')(pathPrefix));"
|
||||
|
||||
- name: Add 'sugarizer_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'sugarizer_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^sugarizer_installed'
|
||||
line: 'sugarizer_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -101,9 +101,9 @@
|
|||
dest: "/etc/{{ apache_config_dir }}/wordpress.conf"
|
||||
when: apache_enabled
|
||||
|
||||
- name: Add 'wordpress_installed' variable values to {{ iiab_installed }}
|
||||
- name: Add 'wordpress_installed' variable values to {{ iiab_state_file }}
|
||||
lineinfile:
|
||||
dest: "{{ iiab_installed }}"
|
||||
dest: "{{ iiab_state_file }}"
|
||||
regexp: '^wordpress_installed'
|
||||
line: 'wordpress_installed: True'
|
||||
state: present
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# SEE "emergency" REINSTALL INSTRUCTIONS IN roles/wordpress/tasks/install.yml
|
||||
|
||||
- name: Provision MySql DB for WordPress
|
||||
include_tasks: prov-db.yml
|
||||
include_tasks: setup.yml
|
||||
when: wordpress_install | bool and not installing | bool
|
||||
|
||||
- name: Install WordPress if wordpress_installed is absent
|
||||
|
|
37
runrole
37
runrole
|
@ -1,12 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
INVENTORY="ansible_hosts"
|
||||
PLAYBOOK="run-one-role.yml"
|
||||
INVENTORY=ansible_hosts
|
||||
PLAYBOOK=run-one-role.yml
|
||||
ARGS=""
|
||||
REINSTALL=0
|
||||
CWD=`pwd`
|
||||
APPS=/etc/iiab/iiab_state.yml
|
||||
VARS=/etc/iiab/local_vars.yml
|
||||
IIAB_STATE_FILE=/etc/iiab/iiab_state.yml
|
||||
LOCAL_VARS_FILE=/etc/iiab/local_vars.yml
|
||||
|
||||
if [ ! -f $PLAYBOOK ]; then
|
||||
echo "Exiting: IIAB Playbook not found."
|
||||
|
@ -15,25 +15,30 @@ if [ ! -f $PLAYBOOK ]; then
|
|||
fi
|
||||
|
||||
if [[ $# -eq 0 ]] ; then
|
||||
echo " usage: ./runrole <name of role>"
|
||||
echo " usage: ./runrole --reinstall <name of role>"
|
||||
echo " Last variable would be full path to log file."
|
||||
echo " If ommited current directory is used."
|
||||
echo "Usage: ./runrole <name of role>"
|
||||
echo "Usage: ./runrole --reinstall <name of role>"
|
||||
echo
|
||||
echo "Optional 2nd parameter is full PATH/FILENAME for logging."
|
||||
echo "If omitted, <current directory>/iiab-debug.log is used."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! grep -q "^""$1""_install: True" $LOCAL_VARS_FILE; then
|
||||
echo "ERROR: $LOCAL_VARS_FILE must contain '""$1""_install: True'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
clear_marker(){
|
||||
if [ ! $1 == "internetarchive" ]; then # special handling
|
||||
if [ $1 == "calibre-web" ]; then # role directory & installed marker differ
|
||||
sed -i -e '/^calibreweb/d' $APPS
|
||||
|
||||
sed -i -e '/^calibreweb/d' $IIAB_STATE_FILE
|
||||
elif [ $1 == "captive-portal" ]; then # role directory & installed marker differ
|
||||
sed -i -e '/^captiveportal/d' $APPS
|
||||
|
||||
elif [ $1 == "bluetooth" ]; then # role directory & installed marker differ
|
||||
sed -i -e '/^pan_bluetooth/d' $APPS
|
||||
fi
|
||||
sed -i -e "/^$1/d" $APPS
|
||||
sed -i -e '/^captiveportal/d' $IIAB_STATE_FILE
|
||||
#elif [ $1 == "bluetooth" ]; then # role directory & installed marker differ
|
||||
# sed -i -e '/^pan_bluetooth/d' $IIAB_STATE_FILE
|
||||
else
|
||||
sed -i -e "/^$1/d" $IIAB_STATE_FILE
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue