[THIS DOC’S CURRENTLY BEING REWRITTEN JULY/AUGUST 2022! SUGGESTIONS APPRECIATED!]

Configuration Variables

Internet-in-a-Box (IIAB) uses Ansible playbooks to install IIAB software and any IIAB apps you choose. A sequence of operations and a set of conventions define variables of differing scope[*] to organize your IIAB installation(s).

[*] Though most IIAB/Ansible variables are global variables, as a practical matter.

Facts

When Ansible starts it gathers a long list of ‘facts’ about the host on which installation will take place. It also permits a local_facts script to gather any additional facts, helpful to installing IIAB and IIAB apps.

Variable Files

Two var files are most important:

Several suggested / baseline local_vars.yml files are available to choose from, to help you get oriented. IIAB’s 1-line installer will even help you copy one of these to /etc/iiab/local_vars.yml whereupon you’re invited to customize and edit .

Changes should NOT be made to default_vars.yml (changes will be overwritten during any subsequent pull from the Git repository).

local_facts.fact

After Ansible has gathered its facts and loaded the variables files, it starts running roles in the order given in the top-level playbook.

For IIAB the first role is 0-init. It runs /etc/ansible/facts.d/local_facts.fact [*] to establish about a dozen variables that will be broadly useful, when installing or configuring IIAB and any needed IIAB apps.

[*] Copied from /opt/iiab/iiab/scripts/local_facts.fact by iiab-install.

Role Variables

Each Ansible role can declare variables within its defaults/main.yml. These variables have the lowest level of precedence — essentially only taking effect when no value was set anywhere else.

Our convention is to define variables in this file to softcode parameters and to make sure the variable will not be undefined if used elsewhere. These may be thought of as role-specific constants (and are particular useful during software development and QA!)

Install and Enable

Almost every role has 2 global variables <role name>_install and <role name>_enabled, that specify whether the role should be installed / enabled (or disabled!)

NOTE: IIAB does NOT currently support uninstalling of roles a.k.a. apps or services.

NOTE: If an IIAB app has been successfully installed, that will be recorded within /etc/iiab/iiab_state.yml — do NOT manually edit that file!

Hostname and Domain

Hostname and Domain variables default to:

Hostname defaults to box but in the past was schoolserver because that’s what OLPC XO laptops expected.

You can change these variables in /etc/iiab/local_vars.yml (preferably prior to installing IIAB) and also after IIAB is installed, e.g. using IIAB’s Admin Console.

Use of Variables in Ansible Playbooks

Here are the main IIAB playbooks in /opt/iiab/iiab:

Settings Files in /etc/iiab

Customize this file so that iiab-install (and others) correctly install IIAB and install/enable/disable your chosen IIAB apps:

Please do NOT touch other files in /etc/iiab but feel free to take a look — here are a few examples:

Order of Execution and Precedence

In order of execution:

If you want to understand the “22 levels” of variable precedence at a deeper level, please see Ansible’s official doc.

Related Docs