mirror of
https://github.com/iiab/iiab.git
synced 2025-02-12 19:22:24 +00:00
Merge pull request #931 from holta/etc-iiab-local_vars
/etc/iiab/local_vars.yml puts /opt/iiab/iiab/vars/local_vars.yml out of its misery
This commit is contained in:
commit
7dbf9047d4
19 changed files with 48 additions and 41 deletions
|
@ -2,7 +2,9 @@ Contributing to Internet-in-a-Box (IIAB)
|
|||
=======================================
|
||||
Internet-in-a-Box runs on various GNU/Linux operating systems such as Fedora, Ubuntu, Debian, CentOS and Raspbian.
|
||||
|
||||
You can install Internet-in-a-Box on most late model desktop and laptop computers. It also supports Intel NUC, Intel Gigabyte BRIX, OLPC XO-1.5, XO-1.75, XO-4, Raspberry Pi 2 and Raspberry Pi 3. A VirtualBox VM can also used for testing purposes. Using Docker containers however is not recommended as our Ansible provisioning system requires low-level access to the operating system.
|
||||
You can install Internet-in-a-Box on x86_64 PCs/laptops and Raspberry Pi 3 (or 3 B+). Example PC's include Intel NUC and Gigabyte BRIX. Partial support is also available on OLPC laptops like the XO-1.5, XO-1.75 and XO-4. A VirtualBox VM can also be used for testing purposes. Using Docker containers however is not recommended as our Ansible provisioning system requires low-level access to the operating system.
|
||||
|
||||
Finally, running Internet-in-a-Box on the Raspberry Pi Zero W is also possible, if you transfer a working IIAB (microSD card) that was built up inside a Raspberry Pi 3 (or 3 B+).
|
||||
|
||||
Please refer to [IIAB Platforms](https://github.com/iiab/iiab/wiki/IIAB-Platforms) for more information.
|
||||
|
||||
|
@ -11,12 +13,12 @@ Internet-in-a-Box uses [Ansible](https://www.ansible.com/) infrastructure automa
|
|||
├── roles
|
||||
│ ├── 1-prep
|
||||
│ │ ├─ defaults
|
||||
| | | ├──main.yml (lowest precedence variable definitions, overridden by <repo_root>/vars/default_vars.yml, overridden by ./vars/local_vars.yml.
|
||||
| | | ├──main.yml (lowest precedence variable definitions, overridden by <repo_root>/vars/default_vars.yml, overridden by /etc/iiab/local_vars.yml)
|
||||
│ │ ├── README.rst
|
||||
│ │ ├── tasks
|
||||
| | | ├──main.yml (specifies the actions to install this role
|
||||
│ │ └── templates
|
||||
| | | ├<(text files where ansible variables are substituted, specified via {% <variable> %} containers-(jinja2 language).
|
||||
| | | ├──<text files where ansible variables are substituted, specified via {% <variable> %} containers-(jinja2 language)>
|
||||
│ ├── 2-common
|
||||
│ │ ├── README.rst
|
||||
│ │ ├── tasks
|
||||
|
@ -24,11 +26,11 @@ Internet-in-a-Box uses [Ansible](https://www.ansible.com/) infrastructure automa
|
|||
```
|
||||
At runtime, Ansible gathers system information and makes it available (called 'facts') and combines this with playbook defined 'variables' to guide the installation process. The execution follows a sequence of cascading steps:
|
||||
|
||||
1. Bash script `./runansible` follows instructions in `iiab.yml` in the root directory.
|
||||
1. Bash script `./iiab-install` follows instructions in `iiab-stages.yml` in the root directory.
|
||||
|
||||
2. `iiab.yml` calls 9 aggregate roles (the numbered directories under `./roles/`).
|
||||
2. `iiab-stages.yml` calls 9 aggregate roles (AKA stages, these are the numbered directories under `./roles/`) and then the network role. (Aside: the network role can also later be run using `./iiab-network`)
|
||||
|
||||
3. Each aggregate role has a `<role>/meta/main.yml` which calls the individual named roles.
|
||||
3. Each aggregate role AKA stage has a `<role>/meta/main.yml` which calls its needed roles.
|
||||
|
||||
Please refer to the [IIAB Architecture](https://github.com/iiab/iiab/wiki/IIAB-Architecture) and [IIAB Variables]( https://github.com/iiab/iiab/wiki/IIAB-Variables) pages for more information.
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
vars_files:
|
||||
- vars/default_vars.yml
|
||||
- vars/{{ ansible_local.local_facts.os_ver }}.yml
|
||||
- vars/local_vars.yml
|
||||
- /etc/iiab/local_vars.yml
|
||||
|
||||
roles:
|
||||
- { role: 0-init, tags: ['0-init'] }
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
vars_files:
|
||||
- vars/default_vars.yml
|
||||
- vars/{{ ansible_local.local_facts.os_ver }}.yml
|
||||
- vars/local_vars.yml
|
||||
- /etc/iiab/local_vars.yml
|
||||
- /etc/iiab/config_vars.yml
|
||||
|
||||
roles:
|
||||
|
|
24
iiab-install
24
iiab-install
|
@ -14,6 +14,8 @@ MIN_ANSIBLE_VER=2.5.6
|
|||
|
||||
export ANSIBLE_LOG_PATH="$CWD/iiab-install.log"
|
||||
|
||||
echo -e "\n\n./iiab-install BEGUN IN /opt/iiab/iiab\n"
|
||||
|
||||
if [ ! -f /etc/ansible/facts.d/local_facts.fact ]; then
|
||||
mkdir -p /etc/ansible/facts.d
|
||||
fi
|
||||
|
@ -30,7 +32,7 @@ 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 './runtags' to run a single Stage or Tag or Role."
|
||||
echo "Use './runrole' to run a single Stage or Role."
|
||||
echo "Use './iiab-network' to run Network sections."
|
||||
exit 1
|
||||
fi
|
||||
|
@ -109,25 +111,25 @@ if [ -f /etc/iiab/iiab.env ]; then
|
|||
echo -e "\nEXITING: STAGE (counter) in /etc/iiab/iiab.env shows Stage 9 Is Already Done."
|
||||
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 './runtags' to run a single Stage or Tag or Role."
|
||||
echo "Use './iiab-network' to run Network sections."
|
||||
exit 1
|
||||
echo "Use './runrole' to run a single Stage or Role."
|
||||
echo -e "Use './iiab-network' to run Network sections.\n\n"
|
||||
exit 0 # allows rerunning http://download.iiab.io/6.6/install.txt
|
||||
fi
|
||||
fi
|
||||
if [ "$STAGE" -lt 2 ] && [ "$1" == "--debug" ]; then
|
||||
echo -e "\n'--debug' *ignored* as STAGE (counter) < 2."
|
||||
fi
|
||||
|
||||
# If vars/local_vars.yml is missing, put a default file in place.
|
||||
if [ ! -f ./vars/local_vars.yml ]; then
|
||||
# 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 ./vars/local_vars.yml
|
||||
echo -e "\nvars/local_vars.yml created from local_vars_olpc.yml defaults."
|
||||
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 ./vars/local_vars.yml
|
||||
echo -e "\nvars/local_vars.yml created from local_vars_medium.yml defaults."
|
||||
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"
|
||||
;;
|
||||
*)
|
||||
|
@ -142,3 +144,5 @@ echo -e "\nRunning local playbooks....Stage 0 will now run....followed by Stages
|
|||
|
||||
ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null
|
||||
ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local
|
||||
|
||||
echo -e "\n./iiab-install COMPLETED IN /opt/iiab/iiab\n\n"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
vars_files:
|
||||
- vars/default_vars.yml
|
||||
- vars/{{ ansible_local.local_facts.os_ver }}.yml
|
||||
- vars/local_vars.yml
|
||||
- /etc/iiab/local_vars.yml
|
||||
- /etc/iiab/config_vars.yml
|
||||
|
||||
roles:
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
- roles/0-init/defaults/main.yml
|
||||
- vars/default_vars.yml
|
||||
- vars/{{ ansible_local.local_facts.os_ver }}.yml
|
||||
- vars/local_vars.yml
|
||||
- /etc/iiab/local_vars.yml
|
||||
|
||||
tasks:
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
vars_files:
|
||||
- vars/default_vars.yml
|
||||
- vars/{{ ansible_local.local_facts.os_ver }}.yml
|
||||
- vars/local_vars.yml
|
||||
- /etc/iiab/local_vars.yml
|
||||
- /etc/iiab/config_vars.yml
|
||||
|
||||
roles:
|
|
@ -14,7 +14,7 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
sed -i -e "s/openvpn_install: False/openvpn_install: True/" vars/local_vars.yml
|
||||
sed -i -e "s/openvpn_enabled: False/openvpn_enabled: True/" vars/local_vars.yml
|
||||
sed -i -e "s/openvpn_install: False/openvpn_install: True/" /etc/iiab/local_vars.yml
|
||||
sed -i -e "s/openvpn_enabled: False/openvpn_enabled: True/" /etc/iiab/local_vars.yml
|
||||
|
||||
ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
4-server-options README
|
||||
=======================
|
||||
|
||||
Whereas 3-base-server installs critical packages needed by all, this 4th stage installs a broad array of *options* -- depending on which server apps will be installed in later stages -- as specified in /opt/iiab/iiab/vars/local_vars.yml
|
||||
Whereas 3-base-server installs critical packages needed by all, this 4th stage installs a broad array of *options* -- depending on which server apps will be installed in later stages -- as specified in /etc/iiab/local_vars.yml
|
||||
|
||||
This includes some networking fundamentals, before they're configured later on.
|
||||
|
||||
|
|
|
@ -21,5 +21,5 @@ calibre_src_url: "https://raw.githubusercontent.com/kovidgoyal/calibre/master/se
|
|||
|
||||
# USE TO TEST debs.yml (RASPBIAN APPROACH!) ON DEBIAN 9.X: (now handled by calibre_via_debs in /opt/iiab/iiab/vars/*)
|
||||
#calibre_debs_on_debian: True
|
||||
# Enable unstable .deb's, not just testing .deb's: (moved to vars/local_vars.yml & vars/default_vars.yml)
|
||||
# Enable unstable .deb's, not just testing .deb's: (moved to /etc/iiab/local_vars.yml & /opt/iiab/iiab/vars/default_vars.yml)
|
||||
#calibre_unstable_debs: False
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# http://box/XYZ mnemonic if properly set within /opt/iiab/iiab/vars/local_vars.yml
|
||||
# http://box/XYZ mnemonic if properly set within /etc/iiab/local_vars.yml
|
||||
ProxyPass /{{ calibre_web_path }} http://localhost:{{ calibre_port }}
|
||||
ProxyPassReverse /{{ calibre_web_path }} http://localhost:{{ calibre_port }}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# The values here are defaults.
|
||||
# To override them edit the main var definitions in /opt/iiab/iiab/vars/local_vars.yml
|
||||
# To override them edit /etc/iiab/local_vars.yml
|
||||
|
||||
kalite_install: True
|
||||
kalite_enabled: False
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# The values here are defaults.
|
||||
# To override them edit /opt/iiab/iiab/vars/local_vars.yml
|
||||
# To override them edit /etc/iiab/local_vars.yml
|
||||
|
||||
# Installation Variables
|
||||
kolibri_install: False
|
||||
|
|
|
@ -44,7 +44,7 @@ hostapd_wait: 1
|
|||
host_wifi_mode: g
|
||||
host_channel: 6
|
||||
host_wireless_n: False
|
||||
# Below moved to /opt/iiab/iiab/vars/local_vars.yml: (so implementer sets this)
|
||||
# Below moved to /etc/iiab/local_vars.yml: (so implementer sets this)
|
||||
#host_country_code: US
|
||||
hostapd_secure: True
|
||||
hostapd_password: "iiab2017"
|
||||
|
|
|
@ -13,7 +13,7 @@ Do the following:
|
|||
* cd /library/rachel
|
||||
* mv /library/rachelusb_32EN_3.1.4/RACHEL/bin .
|
||||
* you should see /library/rachel/bin/www/index.php
|
||||
* re-run ansible (making sure that rachel_enabled: True has been set in vars/local_vars.yml
|
||||
* re-run ansible (making sure that rachel_enabled: True has been set in /etc/iiab/local_vars.yml
|
||||
|
||||
Locations
|
||||
---------
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
vars_files:
|
||||
- vars/default_vars.yml
|
||||
- vars/{{ ansible_local.local_facts.os_ver }}.yml
|
||||
- vars/local_vars.yml
|
||||
- /etc/iiab/local_vars.yml
|
||||
- /etc/iiab/config_vars.yml
|
||||
|
||||
roles:
|
||||
|
|
|
@ -74,7 +74,7 @@ else
|
|||
#if [[ `grep -qi ansible /etc/apt/sources.list` ]] || [ -f /etc/apt/sources.list.d/ansible*.list ]; then
|
||||
elif (grep -qi ansible /etc/apt/sources.list) || (ls /etc/apt/sources.list.d/*ansible*.list >/dev/null 2>&1) ; then
|
||||
#echo "Ansible repo(s) found within /etc/apt/sources.list*"
|
||||
echo -e 'MANUAL INTERVENTION URGED:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- MUST CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n'
|
||||
echo -e 'CONSIDER MANUAL INTERVENTION:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- MUST CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n'
|
||||
else
|
||||
echo -e 'Upstream ansible source repo not found:\nPLEASE UNINSTALL ANSIBLE (run "apt purge ansible" or "pip uninstall ansible", depending how Ansible was originally installed) THEN RE-RUN THIS SCRIPT.'
|
||||
exit 1
|
||||
|
|
|
@ -74,7 +74,7 @@ else
|
|||
#if [[ `grep -qi ansible /etc/apt/sources.list` ]] || [ -f /etc/apt/sources.list.d/ansible*.list ]; then
|
||||
elif (grep -qi ansible /etc/apt/sources.list) || (ls /etc/apt/sources.list.d/*ansible*.list >/dev/null 2>&1) ; then
|
||||
#echo "Ansible repo(s) found within /etc/apt/sources.list*"
|
||||
echo -e 'MANUAL INTERVENTION URGED:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- MUST CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE 2.6.x -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n'
|
||||
echo -e 'CONSIDER MANUAL INTERVENTION:\nANSIBLE REPO(S) FOUND WITHIN /etc/apt/sources.list AND/OR /etc/apt/sources.list.d/*ansible*.list -- MUST CONTAIN LINE "deb http://ppa.launchpad.net/ansible/ansible-2.6/ubuntu xenial main" IF YOU WANT THE LATEST ANSIBLE 2.6.x -- AND REMOVE ALL SIMILAR LINES TO ENSURE ANSIBLE UPDATES CLEANLY -- then re-run this script.\n'
|
||||
else
|
||||
echo -e 'Upstream ansible source repo not found:\nPLEASE UNINSTALL ANSIBLE (run "apt purge ansible" or "pip uninstall ansible", depending how Ansible was originally installed) THEN RE-RUN THIS SCRIPT.'
|
||||
exit 1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# WARNING: DO NOT MODIFY THIS FILE.
|
||||
# CHANGES WILL BE LOST IF YOU DO A GIT PULL OR FETCH.
|
||||
# Instead put changes in local_vars.yml which is not tracked by git:
|
||||
# http://wiki.iiab.io/local_vars.yml
|
||||
# Instead put changes in your own /etc/iiab/local_vars.yml
|
||||
# See http://wiki.iiab.io/local_vars.yml to learn more!
|
||||
|
||||
# By convention we use True/False to indicate boolean constants.
|
||||
|
||||
|
@ -64,7 +64,7 @@ lan_netmask: 255.255.224.0
|
|||
# Internal Wi-Fi Access Point
|
||||
# Values are used if there is an internal Wi-Fi adapter and hostapd is enabled
|
||||
# The platform variable adapts install to specific hardware (raspberry pi=rpi2)
|
||||
# Raspbian req WiFi country since March 2018. CHANGE IT IN vars/local_vars.yml
|
||||
# Raspbian req WiFi country since March 2018. CHANGE IT IN /etc/iiab/local_vars.yml
|
||||
host_country_code: US
|
||||
host_ssid: "Internet in a Box"
|
||||
host_wifi_mode: g
|
||||
|
@ -194,15 +194,15 @@ openvpn_enabled: False
|
|||
# roles/network runs here (MANY SETTINGS ABOVE)
|
||||
|
||||
# Homepage
|
||||
# Default to the GUI where the selection is made or override in local_vars.yml
|
||||
iiab_home_url: /home
|
||||
|
||||
# You can change iiab_home_url in local_vars.yml in order to get a different
|
||||
# homepage. For example one of the following: (assuming they are enabled)
|
||||
# You can change iiab_home_url in /etc/iiab/local_vars.yml to get a different
|
||||
# homepage. For example one of the following: (if its service is enabled!)
|
||||
|
||||
# iiab_home_url: /home
|
||||
# iiab_home_url: /wordpress
|
||||
# iiab_home_url: /wiki - either dokuwiki or mediawiki
|
||||
# iiab_home_url: /wiki # for dokuwiki
|
||||
# iiab_home_url: /mediawiki
|
||||
|
||||
# PostgreSQL auto-installed by Moodle &/or Pathagar as nec, no need to touch!
|
||||
# roles/1-prep/tasks/computed_vars.yml, roles/4-server-options/tasks/main.yml
|
||||
|
@ -414,9 +414,10 @@ xovis_chart_heading: "My School: Usage Data Visualization"
|
|||
# wide to narrow
|
||||
is_debuntu: False
|
||||
is_ubuntu: False
|
||||
is_ubuntu_16: False
|
||||
is_ubuntu_18: False
|
||||
is_ubuntu_16: False
|
||||
is_debian: False
|
||||
is_debian_10: False
|
||||
is_debian_9: False
|
||||
is_debian_8: False
|
||||
is_rpi: False
|
||||
|
|
Loading…
Reference in a new issue