mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
commit
b4e7e042b9
13 changed files with 52 additions and 46 deletions
41
iiab-install
41
iiab-install
|
@ -12,7 +12,25 @@ OS=${OS//\"/}
|
||||||
MIN_RPI_KERN=4.9.59-v7+
|
MIN_RPI_KERN=4.9.59-v7+
|
||||||
MIN_ANSIBLE_VER=2.5.6
|
MIN_ANSIBLE_VER=2.5.6
|
||||||
|
|
||||||
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
|
if [ ! -f /etc/iiab/local_vars.yml ]; then
|
||||||
|
echo -e "\nEXITING: /opt/iiab/iiab/iiab-install REQUIRES /etc/iiab/local_vars.yml\n" >&2
|
||||||
|
echo -e "(1) Please read http://wiki.iiab.io/local_vars.yml to learn more" >&2
|
||||||
|
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.6" or a more recent version!)\n' >&2
|
||||||
|
#case $OS in
|
||||||
|
# OLPC | fedora)
|
||||||
|
# echo -e "Please examine /opt/iiab/iiab/vars/local_vars_olpc.yml for XO laptops.\n" >&2
|
||||||
|
# ;;
|
||||||
|
# centos | debian | ubuntu | raspbian)
|
||||||
|
# echo -e "Please consider /opt/iiab/iiab/vars/local_vars_medium.yml or similar.\n" >&2
|
||||||
|
# ;;
|
||||||
|
# *)
|
||||||
|
# echo -e "EXITING: IIAB requires Raspbian, Debian, Ubuntu, CentOS or OLPC/Fedora.\n" >&2
|
||||||
|
# ;;
|
||||||
|
#esac
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\n\n./iiab-install $* BEGUN IN $CWD\n"
|
echo -e "\n\n./iiab-install $* BEGUN IN $CWD\n"
|
||||||
|
|
||||||
|
@ -120,28 +138,11 @@ if [ "$STAGE" -lt 2 ] && [ "$1" == "--debug" ]; then
|
||||||
echo -e "\n'--debug' *ignored* as STAGE (counter) < 2."
|
echo -e "\n'--debug' *ignored* as STAGE (counter) < 2."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If /etc/iiab/local_vars.yml is missing, put a default file in place.
|
|
||||||
if [ ! -f /etc/iiab/local_vars.yml ]; then
|
|
||||||
case $OS in
|
|
||||||
OLPC | fedora)
|
|
||||||
cp ./vars/local_vars_olpc.yml /etc/iiab/local_vars.yml
|
|
||||||
echo -e "\n/etc/iiab/local_vars.yml created from /opt/iiab/iiab/vars/local_vars_olpc.yml defaults."
|
|
||||||
;;
|
|
||||||
centos | debian | ubuntu | raspbian)
|
|
||||||
cp ./vars/local_vars_medium.yml /etc/iiab/local_vars.yml
|
|
||||||
echo -e "\n/etc/iiab/local_vars.yml created from /opt/iiab/iiab/vars/local_vars_medium.yml defaults."
|
|
||||||
echo "See MIN/MEDIUM/BIG options @ http://wiki.iiab.io/local_vars.yml"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo -e "\nEXITING: IIAB requires Raspbian, Debian, Ubuntu, CentOS or OLPC/Fedora."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\nTRY TO RERUN './iiab-install' IF IT FAILS DUE TO CONNECTIVITY ISSUES ETC!"
|
echo -e "\nTRY TO RERUN './iiab-install' IF IT FAILS DUE TO CONNECTIVITY ISSUES ETC!"
|
||||||
echo -e "\nRunning local playbooks....Stage 0 will now run....followed by Stages $(($STAGE + 1))-9"
|
echo -e "\nRunning local playbooks....Stage 0 will now run....followed by Stages $(($STAGE + 1))-9"
|
||||||
|
|
||||||
|
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
|
||||||
|
|
||||||
ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null
|
ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null
|
||||||
ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local
|
ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
mongodb_install: False
|
mongodb_install: False
|
||||||
mongodb_enabled: False
|
mongodb_enabled: False
|
||||||
|
|
||||||
mongodb_db_path: "{{ content_base }}/dbdata/mongodb" # == /library/dbdata/mongodb/
|
|
||||||
mongodb_conf: /etc/mongod.conf
|
mongodb_conf: /etc/mongod.conf
|
||||||
|
mongodb_db_path: "{{ content_base }}/dbdata/mongodb" # == /library/dbdata/mongodb/
|
||||||
|
mongodb_db_lock_file: "{{ mongodb_db_path }}/mongod.lock"
|
||||||
|
|
|
@ -25,10 +25,11 @@
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: "{{ item.mode }}"
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}" }
|
- { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}", mode: '0644' }
|
||||||
- { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service' }
|
- { 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: Enable+restart systemd service if mongodb_enabled, with "systemctl daemon-reload" (in case mongodb.service changed?)
|
- name: Enable+restart systemd service if mongodb_enabled, with "systemctl daemon-reload" (in case mongodb.service changed?)
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -f {{ mongodb_db_lock_file }} ]; then
|
||||||
|
echo '"mongod --repair" cannot run when {{ mongodb_db_lock_file }} present.' >&2 # Output to STDERR but keep going, so /etc/systems/system/mongodb.service continues
|
||||||
|
else
|
||||||
|
/usr/bin/mongod --repair --dbpath {{ mongodb_db_path }}
|
||||||
|
fi
|
|
@ -1,14 +1,20 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=High-performance, schema-free document-oriented database
|
Description=High-performance, schema-free document-oriented database
|
||||||
After=syslog.target network.target
|
After=syslog.target network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=mongodb
|
User=mongodb
|
||||||
Group=mongodb
|
Group=mongodb
|
||||||
ExecStartPre=/usr/bin/mongod --repair --dbpath {{ mongodb_db_path }}
|
# FAILS (after power failures, etc) as --repair cannot run when lock file exists: (https://github.com/iiab/iiab/issues/942)
|
||||||
|
#ExecStartPre=/usr/bin/mongod --repair --dbpath /library/dbdata/mongodb
|
||||||
|
# FAILS as systemd cannot run bash here:
|
||||||
|
#ExecStartPre=if [ ! -f /library/dbdata/mongodb/mongod.lock ]; then /usr/bin/mongod --repair --dbpath {{ mongodb_db_path }}; fi
|
||||||
|
ExecStartPre=/usr/bin/iiab-mongodb-repair-if-no-lock
|
||||||
ExecStart=/usr/bin/mongod -f {{ mongodb_conf }}
|
ExecStart=/usr/bin/mongod -f {{ mongodb_conf }}
|
||||||
ExecStop=/usr/bin/killall mongod
|
ExecStop=/usr/bin/killall mongod
|
||||||
|
# killall's SIGTERM (15) seems fine, to induce a graceful stop. This would work too:
|
||||||
|
#ExecStop=mongod --dbpath {{ mongodb_db_path }} --shutdown
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
url: "{{ nextcloud_dl_url }}/{{ nextcloud_orig_src_file }}"
|
url: "{{ nextcloud_dl_url }}/{{ nextcloud_orig_src_file }}"
|
||||||
dest: "{{ downloads_dir }}/{{ nextcloud_src_file }}"
|
dest: "{{ downloads_dir }}/{{ nextcloud_src_file }}"
|
||||||
force: yes
|
force: yes
|
||||||
validate_certs: False # TEMPORARY ON/AFTER 2018-07-22 AS download.nextcloud.com CERT EXPIRED: https://github.com/iiab/iiab/issues/954
|
#validate_certs: False # TEMPORARY ON/AFTER 2018-07-22 AS download.nextcloud.com CERT EXPIRED: https://github.com/iiab/iiab/issues/954
|
||||||
timeout: "{{ download_timeout }}"
|
timeout: "{{ download_timeout }}"
|
||||||
when: internet_available and nextcloud_force_install
|
when: internet_available and nextcloud_force_install
|
||||||
async: 900
|
async: 900
|
||||||
|
|
|
@ -342,6 +342,8 @@ pathagar_install: False
|
||||||
pathagar_enabled: False
|
pathagar_enabled: False
|
||||||
|
|
||||||
# Sugarizer
|
# Sugarizer
|
||||||
|
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
||||||
|
# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957
|
||||||
sugarizer_install: True
|
sugarizer_install: True
|
||||||
sugarizer_enabled: False
|
sugarizer_enabled: False
|
||||||
sugarizer_port: 8089
|
sugarizer_port: 8089
|
||||||
|
|
|
@ -190,11 +190,9 @@ pathagar_install: False
|
||||||
pathagar_enabled: False
|
pathagar_enabled: False
|
||||||
|
|
||||||
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
||||||
|
# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957
|
||||||
sugarizer_install: True
|
sugarizer_install: True
|
||||||
sugarizer_enabled: True
|
sugarizer_enabled: True
|
||||||
# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal!
|
|
||||||
# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail
|
|
||||||
# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues
|
|
||||||
|
|
||||||
# 8-MGMT-TOOLS
|
# 8-MGMT-TOOLS
|
||||||
|
|
||||||
|
|
|
@ -190,11 +190,9 @@ pathagar_install: False
|
||||||
pathagar_enabled: False
|
pathagar_enabled: False
|
||||||
|
|
||||||
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
||||||
|
# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957
|
||||||
sugarizer_install: True
|
sugarizer_install: True
|
||||||
sugarizer_enabled: True
|
sugarizer_enabled: True
|
||||||
# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal!
|
|
||||||
# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail
|
|
||||||
# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues
|
|
||||||
|
|
||||||
# 8-MGMT-TOOLS
|
# 8-MGMT-TOOLS
|
||||||
|
|
||||||
|
|
|
@ -190,11 +190,9 @@ pathagar_install: False
|
||||||
pathagar_enabled: False
|
pathagar_enabled: False
|
||||||
|
|
||||||
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
||||||
|
# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957
|
||||||
sugarizer_install: True
|
sugarizer_install: True
|
||||||
sugarizer_enabled: True
|
sugarizer_enabled: True
|
||||||
# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal!
|
|
||||||
# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail
|
|
||||||
# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues
|
|
||||||
|
|
||||||
# 8-MGMT-TOOLS
|
# 8-MGMT-TOOLS
|
||||||
|
|
||||||
|
|
|
@ -190,11 +190,9 @@ pathagar_install: False
|
||||||
pathagar_enabled: False
|
pathagar_enabled: False
|
||||||
|
|
||||||
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
||||||
|
# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957
|
||||||
sugarizer_install: True
|
sugarizer_install: True
|
||||||
sugarizer_enabled: True
|
sugarizer_enabled: True
|
||||||
# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal!
|
|
||||||
# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail
|
|
||||||
# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues
|
|
||||||
|
|
||||||
# 8-MGMT-TOOLS
|
# 8-MGMT-TOOLS
|
||||||
|
|
||||||
|
|
|
@ -190,11 +190,9 @@ pathagar_install: False
|
||||||
pathagar_enabled: False
|
pathagar_enabled: False
|
||||||
|
|
||||||
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
||||||
|
# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957
|
||||||
sugarizer_install: False
|
sugarizer_install: False
|
||||||
sugarizer_enabled: False
|
sugarizer_enabled: False
|
||||||
# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal!
|
|
||||||
# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail
|
|
||||||
# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues
|
|
||||||
|
|
||||||
# 8-MGMT-TOOLS
|
# 8-MGMT-TOOLS
|
||||||
|
|
||||||
|
|
|
@ -190,11 +190,9 @@ pathagar_install: False
|
||||||
pathagar_enabled: False
|
pathagar_enabled: False
|
||||||
|
|
||||||
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
# Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879
|
||||||
|
# Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957
|
||||||
sugarizer_install: False
|
sugarizer_install: False
|
||||||
sugarizer_enabled: False
|
sugarizer_enabled: False
|
||||||
# sugarizer_enabled is currently IGNORED as basic Sugarizer works w/o Journal!
|
|
||||||
# https://github.com/iiab/iiab/issues/193 Subsequent "./runrole sugarizer" fail
|
|
||||||
# https://github.com/iiab/iiab/issues/240 Sugarizer 0.8 to 0.9 ongoing issues
|
|
||||||
|
|
||||||
# 8-MGMT-TOOLS
|
# 8-MGMT-TOOLS
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue