1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Merge pull request #424 from iiab/master

Sync from iiab:master
This commit is contained in:
A Holt 2020-09-21 09:45:18 -04:00 committed by GitHub
commit 0715af5d18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 43 additions and 23 deletions

View file

@ -27,7 +27,7 @@
state: present
when: is_debuntu | bool
- name: "Install 24 common packages: acpid, bridge-utils, bzip2, curl, gawk, hostapd, htop, i2c-tools, logrotate, make, mlocate, netmask, net-tools, ntfs-3g, pandoc, pastebinit, rsync, sqlite3, sudo, tar, unzip, usbmount, usbutils, wget"
- name: "Install 23 common packages: acpid, bridge-utils, bzip2, curl, gawk, hostapd, htop, i2c-tools, logrotate, make, mlocate, netmask, net-tools, ntfs-3g, pandoc, pastebinit, rsync, sqlite3, sudo, tar, unzip, usbutils, wget"
package:
name:
- acpid
@ -40,7 +40,7 @@
- htop
- i2c-tools
- logrotate
#- lynx # already installed by 1-prep's roles/iiab-admin/tasks/access.yml
#- lynx # Already installed by 1-prep's roles/iiab-admin/tasks/access.yml
- make
- mlocate
- netmask
@ -54,6 +54,7 @@
- sudo
- tar
- unzip
#- usbmount # Moved to roles/usb_lib/tasks/install.yml
- usbutils
- wget
state: present

View file

@ -2,19 +2,20 @@
Network README
==============
This is run by Ansible after it has installed the core (`Stages 0-to-9 <https://github.com/iiab/iiab/wiki/IIAB-Contributors-Guide#ansible>`_) of Internet-in-a-Box (IIAB) and its apps/services.
This is run by `Ansible <http://wiki.laptop.org/go/IIAB/FAQ#What_is_Ansible_and_what_version_should_I_use.3F>`_ after it has installed the core (`Stages 0-to-9 <https://github.com/iiab/iiab/wiki/IIAB-Contributors-Guide#ansible>`_) of `Internet-in-a-Box (IIAB) <http://internet-in-a-box.org>`_ and its apps/services.
Specifically, this 'network' role is run:
Specifically, this 'network' role is run...
- automatically during IIAB installation, after /opt/iiab/iiab/iiab-install has run `Stages 0-to-9 <..>`_ (thanks to `iiab-stages.yml <../../iiab-stages.yml>`_)
- automatically by IIAB's Admin Console (http://box/admin) if you click ``Configure`` menu -> ``Install Configured Options`` — this is similar to the above, but only runs Stage 0, then Stage 4-to-9, and then finally this 'network' role/stage (thanks to `iiab-from-console.yml <../../iiab-from-console.yml>`_)
- or manually, if you run ``cd /opt/iiab/iiab`` then `./iiab-network <../../iiab-network>`_ (which is much the same as running ``./runrole network``)
- ...automatically during IIAB installation, after `/opt/iiab/iiab/iiab-install <../../iiab-install>`_ has run `Stages 0-to-9 <..>`_ (thanks to `iiab-stages.yml <../../iiab-stages.yml>`_).
- ...automatically by IIAB's Admin Console (http://box/admin) if you click ``Configure`` menu -> ``Install Configured Options`` — this is similar to the above, but only runs Stage 0, then Stage 4-to-9, and then finally this 'network' role/stage (thanks to `iiab-from-console.yml <../../iiab-from-console.yml>`_).
- ...or manually, if you run ``cd /opt/iiab/iiab`` then `./iiab-network <../../iiab-network>`_ (which is much the same as running ``./runrole network``).
Many IIAB networking questions can be answered in these 2 documents:
- `IIAB Networking <https://github.com/iiab/iiab/wiki/IIAB-Networking>`_ is a high-level summary, that reviews IIAB's 3 modes of operation distinguishing WAN from LAN, `common ports <https://github.com/iiab/iiab/wiki/IIAB-Networking#list-of-open-ports--services>`_, DNS name resolution and some common customizations.
- http://FAQ.IIAB.IO includes answers to common questions like:
- What is local_vars.yml and how do I customize it?
- How do I provide Wi-Fi (wireless) to all my kids?
- Can I create a Wi-Fi hotspot using an old laptop?
- How do I change the wireless network name?

View file

@ -1,6 +1,8 @@
# Basic configuration
interface={{ iiab_wireless_lan_iface }}
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid={{ host_ssid }}
channel={{ host_channel }}

View file

@ -1,6 +1,7 @@
#!/bin/bash -e
# PLZ SEE http://FAQ.IIAB.IO > "What is Ansible and what version should I use?"
# https://github.com/iiab/iiab/tree/master/scripts/ansible.md
APT_PATH=/usr/bin # Avoids problematic /usr/local/bin/apt on Linux Mint
CURR_VER="undefined" # Ansible version you currently have installed
@ -11,6 +12,18 @@ GOOD_VER="2.10.1" # Orig for 'yum install [rpm]' & XO laptops (pip install)
# http://ppa.launchpad.net/ansible/ansible/ubuntu/pool/main/a/ansible-base/
# https://github.com/ansible/ansible/commits/stable-2.10/changelogs/CHANGELOG-v2.10.rst
# IIAB implementers might instead consider these 2 GENERAL TECHNIQUES below
# ("in an emergency!") e.g. if you must install an older version of Ansible:
# TEMPORARILY USE ANSIBLE 2.9.13 (REMOVE IT WITH "pip uninstall ansible")
#pip install ansible==2.9.13
# TEMPORARILY USE ANSIBLE 2.4.2 DUE TO 2.4.3 MEMORY BUG. Details: iiab/iiab#669
#echo "Install http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb"
#cd /tmp
#wget http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb
#apt -y --allow-downgrades install ./ansible_2.4.2.0-1ppa~xenial_all.deb
export DEBIAN_FRONTEND=noninteractive
# Why 'noninteractive' appears needed:
# https://github.com/iiab/iiab/issues/564#issuecomment-347264985
@ -37,6 +50,8 @@ else
fi
echo -e "(Internet-in-a-Box requests ansible-base $GOOD_VER or higher)\n"
# Code above designed to work on all Linux distributions, to preserve options,
# in support of any volunteer(s) wanting to port IIAB to a new Linux/distro.
if [ ! -f /etc/debian_version ]; then # e.g. Raspbian, Ubuntu, Mint & Debian
echo -e "\nEXITING: /etc/debian_version FILE NOT FOUND. Linux OS support info here:"
echo -e " https://github.com/iiab/iiab/wiki/IIAB-Platforms\n"
@ -48,8 +63,16 @@ $APT_PATH/apt update
$APT_PATH/apt -y install dirmngr
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" \
> /etc/apt/sources.list.d/iiab-ansible.list
# In future we might instead consider 'add-apt-repository ppa:ansible/ansible'
# or 'apt-add-repository ppa:ansible/bionic/ansible' etc, e.g. for streamlined
# removal using 'apt-add-repository -r' -- however that currently requires
# 'apt install software-properties-common' which drags in a dozen packages we
# might not want, e.g. unattended-upgrades, packagekit etc.
# 2020-08-20: TEMP WORKAROUND (REVERT TO ANSIBLE 2.9.6) MITIGATING #2481 (Ansible 2.9.12 and 2.10.0's 666-TO-600 file permissions problem). This installs 2.9.6-1ppa~disco onto RaspiOS, from https://launchpad.net/~ansible/+archive/ubuntu/ansible
# 2020-08-20: TEMP WORKAROUND (REVERT TO ANSIBLE 2.9.6) MITIGATING
# iiab/iiab#2481 (Ansible 2.9.12 and 2.10.0's 666-TO-600 file permissions
# problem). This workaround installs 2.9.6-1ppa~disco onto RaspiOS, from
# https://launchpad.net/~ansible/+archive/ubuntu/ansible
#echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu disco main" \
# > /etc/apt/sources.list.d/iiab-ansible.list
@ -65,24 +88,15 @@ echo -e "\napt update; apt install ansible-base and python3 dependencies explain
echo -e "https://github.com/iiab/iiab/tree/master/scripts/ansible.md\n"
$APT_PATH/apt update
$APT_PATH/apt -y --allow-downgrades install ansible-base \
python3-pymysql python3-psycopg2 python3-passlib python3-pip \
python3-setuptools python3-venv virtualenv
python3-pymysql python3-psycopg2 python3-passlib python3-pip \
python3-setuptools python3-venv virtualenv
# IIAB requires these 2 Ansible Collections: (with ansible-base 2.10.0 or higher)
echo -e "\n\nIIAB requires these 2 Ansible Collections: (w/ ansible-base 2.10.0 or higher)\n"
ansible-galaxy collection install community.general # Re-running these
ansible-galaxy collection install community.mysql # appears to be safe!?
echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible-base'\n\n"
# TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible")
#pip install ansible==2.4.4
# TEMPORARILY USE ANSIBLE 2.4.2 DUE TO 2.4.3 MEMORY BUG. DETAILS @ https://github.com/iiab/iiab/issues/669
#echo "Install http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb"
#cd /tmp
#wget http://download.iiab.io/packages/ansible_2.4.2.0-1ppa~xenial_all.deb
#apt -y --allow-downgrades install ./ansible_2.4.2.0-1ppa~xenial_all.deb
# Needed?
echo -e "\n\nCreating/verifying directory /etc/ansible & installing /etc/ansible/hosts\n"
mkdir -p /etc/ansible
echo -e '[local]\nlocalhost\n' > /etc/ansible/hosts
echo -e "SUCCESS: VERIFY ANSIBLE WITH 'ansible --version' & 'apt -a list ansible-base'\n\n"

View file

@ -29,6 +29,7 @@
#- { role: ejabberd }
#- { role: ejabberd_xs }
- { role: elgg }
- { role: firmware }
- { role: gitea }
#- { role: homepage }
- { role: httpd }
@ -62,6 +63,7 @@
- { role: pbx }
- { role: phpmyadmin }
- { role: postgresql }
- { role: pylibs }
#- { role: rachel }
- { role: samba }
#- { role: schooltool }