From 273f5f51a05d10612377d54627d42e0c936a3b5d Mon Sep 17 00:00:00 2001
From: Matt Birkholz abbey- prefix on their names. These roles are applied after
the generic institutional roles (again, documented here).
A Small Institute makes security and privacy top priorities but @@ -64,7 +64,7 @@ map is very similar, with differences mainly in terminology, philosophy, attitude.
-
+
|
=
_|||_
@@ -103,8 +103,8 @@ philosophy, attitude.
The abbey's public particulars are included below. They are the
@@ -134,8 +134,8 @@ into private_ex/vars-abbey.yml
.
Birchwood Abbey's front door is a Digital Ocean Droplet configured as @@ -144,8 +144,8 @@ with Apache2, spooling email with Postfix and serving it with Dovecot-IMAPd, and hosting a VPN with WireGuardâ¢.
The monks of the abbey are masters of the staff (bo) and Emacs. @@ -160,8 +160,8 @@ The monks of the abbey are masters of the staff (bo) and Emacs.
The abbey uses several additional email aliases. These are the public
@@ -201,8 +201,8 @@ from there, forwarding sysadm to a real person.
The abbey publishes member Git repositories with git-daemon. If
@@ -277,7 +277,7 @@ like git-tasks and git-handlers.
git-tasks- name: Install git daemon.
+git-tasks- name: Install git daemon.
become: yes
apt: pkg=git-daemon-sysvinit
@@ -315,7 +315,7 @@ like git-tasks and git-handlers.
git-handlers
+git-handlers
- name: Restart git daemon.
become: yes
command: systemctl restart git-daemon
@@ -324,8 +324,8 @@ like git-tasks and git-handlers.
The abbey provides an HTML interface to members' public Git
@@ -352,7 +352,7 @@ lists the repositories found in /var/www/git/
.
apache-gitweb
+apache-gitweb
Alias /gitweb-static/ /usr/share/gitweb/static/
<Directory "/usr/share/gitweb/static/">
Options MultiViews
@@ -410,7 +410,7 @@ web site /favicon.ico
.
-apache-gitweb-tasks- name: Enable Apache2 rewrite module for Gitweb.
+apache-gitweb-tasks- name: Enable Apache2 rewrite module for Gitweb.
become: yes
apache2_module: name=rewrite
notify: Restart Apache2.
@@ -447,7 +447,7 @@ web site /favicon.ico
.
-apache-gitweb-handlers- name: Restart Apache2.
+apache-gitweb-handlers- name: Restart Apache2.
become: yes
systemd:
service: apache2
@@ -457,8 +457,8 @@ web site /favicon.ico
.
Some of the directives added to the -vhost.conf
file are needed by
@@ -476,7 +476,7 @@ filename suffixes.
apache-abbey<Directory {{ docroot }}/Abbey/>
+apache-abbey<Directory {{ docroot }}/Abbey/>
AllowOverride Indexes FileInfo
Options +Indexes +FollowSymLinks
</Directory>
@@ -499,8 +499,8 @@ AddType text/plain private pub public_vpn req rev sample txt yml
Some of the directives added to the -vhost.conf
file map the abbey's
@@ -512,7 +512,7 @@ matching configurations for accurate previews and tests.
apache-photos
+apache-photos
RedirectMatch /Photos$ /Photos/
RedirectMatch /Photos/(20[0-9][0-9])_([0-9][0-9])_([0-9][0-9])$ \
/Photos/$1_$2_$3/
@@ -525,8 +525,8 @@ AliasMatch /Photos/$ {{ docroot }}/Photos/index.html
The abbey needs to add some Apache2 configuration directives to the
@@ -537,11 +537,11 @@ The abbey simply creates a birchwood-abbey.net-vhost.conf
file in
-The following task adds the apache-abbey, apache-photos, and
-apache-gitweb directives described above to the -vhost.conf
file,
+The following task adds the apache-abbey, apache-photos, and
+apache-gitweb directives described above to the -vhost.conf
file,
and includes options-ssl-apache.conf
from /etc/letsencrypt/
. The
rest of the Let's Encrypt configuration is discussed in the following
-Install Let's Encrypt section.
+Install Let's Encrypt section.
These tasks hack Apache's logrotate(8) configuration to rotate
@@ -705,8 +705,8 @@ encrypting and sending to sendmail.
The abbey uses a Let's Encrypt certificate to authenticate its public @@ -715,7 +715,7 @@ certificate is a terminal session affair (with prompts and lines entered as shown below).
-+$ sudo apt install python3-certbot-apache $ sudo certbot --apache -d birchwood-abbey.net ... @@ -825,8 +825,8 @@ restarted manually.
The following task arranges to rotate Certbot's logs files. @@ -854,8 +854,8 @@ The following task arranges to rotate Certbot's logs files.
A backup copy of Let's Encrypt's data (/etc/letsencrypt/
) is sent to
@@ -934,8 +934,8 @@ imported into root@front's GnuPG key file.
Birchwood Abbey's core is a mini-PC (System76 Meerkat) configured as A @@ -945,8 +945,8 @@ with Postfix and Dovecot, and providing essential localnet services: NTP, DNS and DHCP.
In this abbey specific document, most abbey particulars are not
@@ -965,8 +965,8 @@ directory, playbooks/
.
The scripts that maintain the abbey's web site use a number of @@ -986,8 +986,8 @@ The house task list uses JQuery.
The abbey uses several additional email aliases. These are the campus
@@ -1028,13 +1028,13 @@ e.g. mythtv@mythtv.birchwood.private, locally.)
These tasks are identical to those executed on Front, for similar Git -services on Front and Core. See 3.3 and -Configure Gitweb on Front for more information. +services on Front and Core. See 3.3 and +Configure Gitweb on Front for more information.
The Apache2 configuration on Core specifies three web sites (live,
test, and campus). The live and test sites must operate just like the
-site on Front. Their configurations include the same apache-abbey,
-apache-photos, and apache-gitweb used on Front.
+site on Front. Their configurations include the same apache-abbey,
+apache-photos, and apache-gitweb used on Front.
The institute serves its /usr/share/doc/
on the house (campus) web
site. This is a debugging convenience, making some HTML documentation
more accessible, especially the documentation of software installed on
Core and not on typical desktop clients. Also included: the Apache2
-directives that enable user Git publishing with Gitweb (defined here).
+directives that enable user Git publishing with Gitweb (defined here).
The abbey uses the Apt-Cacher:TNG package cache on Core. The @@ -1145,8 +1145,8 @@ The abbey uses the Apt-Cacher:TNG package cache on Core. The
Core itself will benefit from using the package cache, but should @@ -1170,8 +1170,8 @@ so caching their packages is not a priority.)
A small institute uses nagios4 to monitor the health of its network,
@@ -1179,18 +1179,20 @@ with an initial smattering of monitors adopted from the Debian
monitoring-plugins package. Thus a NAGIOS4 server on the abbey's
Core monitors core network services, and uses nagios-nrpe-server to
monitor Gate. The abbey adds several more monitors, installing
-additional configuration files in /etc/nagios4/conf.d/
, and another
-customized check_sensors plugin (abbey_pisensors) in
-/usr/local/sbin/
on the Raspberry Pis.
+additional configuration files in /etc/nagios4/conf.d/
, a
+check_mdstat plugin from https://exchange.nagios.org/ on Core, and
+another customized check_sensors plugin (abbey_pisensors) on the
+Raspberry Pis.
The abbey adds monitoring of the space remaining on the volume at
/home/
on Core. (The small institute only monitors the space
-remaining on roots.)
+remaining on roots.) The abbey also monitors of the state of the
+RAID-5 array under /home/
.
abbey_pisensorsabbey_pisensors
The check_sensors plugin is included in the package
@@ -1318,10 +1337,98 @@ recognizable temperature in the sensors output.
check_mdstat
+This check_mdstat plugin was copied from the NAGIOS Exchange (here).
+It detects a failing disk in a multi-disk array.
+
roles_t/abbey-core/files/check_mdstat
#!/usr/bin/env bash
+
+# nagios script checks for failed raid device
+# linux software raid /proc/mdstat
+# karl@webmedianow.com 2013-10-01
+
+STATE_OK=0
+STATE_WARNING=1
+STATE_CRITICAL=2
+STATE_UNKNOWN=3
+STATE_DEPENDENT=4
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+export PATH
+
+usage() {
+cat <<-EOE
+Usage: $0 mdadm_device total_drives
+
+ mdadm_device is md0, md1, etc...
+ total_drives is 2 for mirror, or 3, 4 etc...
+
+Nagios script to check if failed drive in /proc/mdstat
+
+Example: raid 2 (2 disk mirror)
+ /opt/nagios/libexec/check_mdstat.sh md0 2
+
+Example: raid 5 with 8 disks
+ /opt/nagios/libexec/check_mdstat.sh md0 8
+
+EOE
+exit $STATE_UNKNOWN
+}
+
+if [ $# -lt 2 ]; then
+ usage
+fi
+
+cmd_device="$1"
+drive_num="$2"
+
+U=""
+for i in $(seq 1 $drive_num);
+do
+ U="${U}U"
+done
+
+uu="[${U}]"
+nn="[${drive_num}/${drive_num}]"
+
+#cat /proc/mdstat | grep -A 1 ^md1 | tail -1 | awk '{print ($(NF))}'
+# [UUUUUUUU] is OK raid
+# [_U] is Failed Drive
+
+# check if we have correct device...
+if cat /proc/mdstat | grep ^${cmd_device} | awk '{print $1}' | grep ^${cmd_device}$ >/dev/null 2>&1
+then
+ device=$cmd_device
+else
+ echo "Couldn't match $cmd_device"
+ exit $STATE_UNKNOWN
+fi
+
+u_status=$(cat /proc/mdstat | grep -A 1 ^${device} | tail -1 | awk '{print ($(NF))}')
+n_status=$(cat /proc/mdstat | grep -A 1 ^${device} | tail -1 | awk '{print ($(NF-1))}')
+
+if [ $uu = $u_status ] && [ $nn = $n_status ]; then
+ echo "OK: $device $n_status $u_status"
+ exit $STATE_OK
+else
+ echo "FAIL: $device $n_status $u_status"
+ exit $STATE_CRITICAL
+fi
+
+
+
+
The abbey adds monitoring for more servers: Dantooine and Kessel.
They are abbey-cloister servers, so they are configured as small
institute campus servers, like Gate, with an NRPE (a NAGIOS Remote
@@ -1333,9 +1440,9 @@ The configurations for these servers are very similar to Gate's, but
are idiosyncratically in flux.
The IP addresses of all three hosts are nice to use in the NAGIOS configuration (to avoid depending on name service) and so are @@ -1350,9 +1457,9 @@ kessel_addr: 10.84.138.10
The following task installs each host's NAGIOS configuration.
@@ -1370,9 +1477,9 @@ The following task installs each host's NAGIOS configuration.roles_t/abbey-core/templates/nagios-dantooine.cfg
define host {
use linux-server
@@ -1432,9 +1539,9 @@ The following task installs each host's NAGIOS configuration.
roles_t/abbey-core/templates/nagios-kessel.cfg
define host {
use linux-server
@@ -1489,8 +1596,8 @@ The following task installs each host's NAGIOS configuration.
The abbey is experimenting with Munin. NAGIOS is all about notifying
@@ -1523,9 +1630,11 @@ trends in resource usage.
- name: Punt default Munin node.
become: yes
ini_file:
- section: "[localhost.localdomain]"
+ section: "localhost.localdomain"
state: absent
+ backup: true
path: /etc/munin/munin.conf
+ notify: Restart Munin.
- name: Configure actual Munin nodes.
become: yes
@@ -1579,14 +1688,24 @@ next task configures libsensors to ignore them.
The abbey's public web site's access and error logs are emailed
regularly to webmaster, who saves them in /Logs/apache2-public/
-and runs analog to generate /WWW/campus/analog.html
, available to
-the campus as http://www/analog.html.
+and runs analog as monkey to generate /WWW/campus/analog.html
,
+available to the campus as http://www/analog.html.
+
+sudo -u monkey analog ++ +
+The analog package includes a manual, how-to's and examples in
+/usr/share/doc/analog/
. The HTML portions can be viewed on campus
+at http://www/doc/analog/.
http://www/analog.html.
become: yes
apt: pkg=analog
-- name: Configure Analog (removing old /var/log/apache/ LOGFILEs).
- become: yes
- lineinfile:
- path: /etc/analog.cfg
- regexp: '^LOGFILE /var/log/apache/'
- state: absent
-
-- name: Configure Analog (adding new configuration lines).
+- name: Configure Analog.
become: yes
+ vars:
+ dir: /Logs/apache2-public
lineinfile:
path: /etc/analog.cfg
- line: "{{ item }}"
+ regexp: "{{ item.regx }}"
+ line: "{{ item.line }}"
insertafter: EOF
loop:
- - "LOGFILE /Logs/apache2-public/*-access.log.gz"
- - "ALLCHART OFF"
- - "DNS WRITE"
- - "HOSTNAME \"{{ full_name }}\""
- - "OUTFILE /WWW/campus/analog.html"
+ - { regx: "^LOGFILE ", line: "LOGFILE {{ dir }}/202?????.log.gz" }
+ - { regx: "^OUTFILE ", line: "OUTFILE /WWW/campus/analog.html" }
+ - { regx: "HOSTNAME ", line: "HOSTNAME \"{{ full_name }}\"" }
+ - { regx: "^ALLCHART ", line: "ALLCHART OFF" }
+ - { regx: "^DNS ", line: "DNS WRITE" }
+ - { regx: "^DNSFILE ", line: "DNSFILE /Logs/dnscache" }
- name: Create /Logs/.
become: yes
@@ -1622,6 +1738,14 @@ the campus as http://www/analog.html.
state: directory
mode: u=rwx,g=rx,o=rx
+- name: Create /Logs/dnscache.
+ become: yes
+ file:
+ path: /Logs/dnscache
+ owner: monkey
+ group: monkey
+ mode: u=rw,g=r,o=r
+
- name: Create /Logs/apache2-public/.
become: yes
file:
@@ -1630,12 +1754,19 @@ the campus as http://www/analog.html.
owner: monkey
group: staff
mode: u=rwx,g=srwx,o=rx
+
+- name: Create /WWW/campus/analog/.
+ become: yes
+ file:
+ state: link
+ path: /WWW/campus/analog
+ src: /usr/share/analog/images
Monkey needs to be in www-data so that it can run
@@ -1657,8 +1788,8 @@ user cloud accounts, found in files owned by www-data, files like
Monkey's photo processing scripts use netpbm commands like
@@ -1675,8 +1806,8 @@ Monkey's photo processing scripts use netpbm commands like
Birchwood Abbey's gate is a $110 µPC configured as A Small Institute @@ -1688,8 +1819,8 @@ allows access to the Abbey's IoT appliances: a HomeAssistant and an Ecowitt hub.
The abbey gate's lan interface is the PC's built-in Ethernet
@@ -1710,27 +1841,27 @@ The MAC address of each interface is set in private/vars.yml
(see
To allow masquerading between the private subnets and wild, the
following iptables(8) rules are added. They are very similar to the
nat and filter table rules used by a small institute to masquerade
-its lan to its isp (see the UFW Rules of a Small Institute).
+its lan to its isp (see the UFW Rules of a Small Institute).
The campus WireGuard⢠subnet is not included because the campus Wi-Fi
hosts should be routing to the wild subnet directly and are assumed to
be masquerading as their access point(s).
iot-nat-A POSTROUTING -s {{ private_net_cidr }} -o wild -j MASQUERADE
+iot-nat-A POSTROUTING -s {{ private_net_cidr }} -o wild -j MASQUERADE
-A POSTROUTING -s {{ public_wg_net_cidr }} -o wild -j MASQUERADE
iot-forward-A ufw-user-forward -i lan -o wild -j ACCEPT
+iot-forward-A ufw-user-forward -i lan -o wild -j ACCEPT
-A ufw-user-forward -i wg0 -o wild -j ACCEPT
The following tasks install the additional rules in before.rules
-and user.rules
(as in Configure UFW).
+and user.rules
(as in Configure UFW).
user.rules(as in Configur
The abbey connects to Starlink via Ethernet, and disables Starlink's @@ -1827,8 +1958,8 @@ at least our local network traffic out of view of our ISPs.
The abbey used to use a cell phone on a USB tether to get Internet
@@ -1873,8 +2004,8 @@ service, using a 60-isp.yaml
file similar to the lines below.
Birchwood Abbey's cloister is a small institute campus. The campus
@@ -1889,17 +2020,18 @@ tasks, namely configuration required on Raspberry Pi OS machines.
Wireless clients are issued keys for the cloister VPN by the ./abbey
client command which is currently identical to the ./inst client
-command (described in The Client Command). The wireless, cloistered
+command (described in The Client Command). The wireless, cloistered
hosts never roam, are not associated with a member, and so are
"campus" clients, issued keys with commands like this:
-./abbey client campus new-host-name +./abbey client campus new-host-name \ + S+6HaTnOwwhWgUGXjSBcPAvifKw+j8BDTRfq534gNW4=
The Apt-Cacher:TNG program does not work well on the frontier, so is @@ -1933,13 +2065,13 @@ local host.
Each cloistered host is a small institute campus host and thus is
already running an NRPE server (a NAGIOS Remote Plugin Executor
-server) with a custom inst_sensors monitor (described in Configure
+server) with a custom inst_sensors monitor (described in Configure
NRPE of A Small Institute). The abbey adds one complication: yet
another check_sensors variant, abbey_pisensors, installed on
Raspberry Pis (architecture aarch64) only.
@@ -1978,8 +2110,8 @@ Raspberry Pis (architecture aarch64) only.
Each cloistered host is a Munin node. @@ -2030,8 +2162,8 @@ them.
The monks of the abbey are masters of the staff and Emacs. @@ -2047,8 +2179,8 @@ The monks of the abbey are masters of the staff and Emacs.
Birchwood Abbey now uses Home Assistant to record and display weather @@ -2075,8 +2207,8 @@ entities. These were labeled and organized on an "Abbey" dashboard.
The abbey uses AgentDVR to record video from PoE IP HD security
@@ -2084,8 +2216,8 @@ cameras. It runs as user agentdvr and keeps all of its
configuration and recordings in /home/agentdvr/
.
AgentDVR is installed according to the iSpy web site's latest
@@ -2109,8 +2241,8 @@ executes several sudo commands. These commands can be run by the
agentdvr account if it has (temporary) authorization.
The following commands are manually executed to create the agentdvr
@@ -2138,8 +2270,8 @@ sudo mv ~/01agentdvr /etc/sudoers.d/
With the above preparations, the system administrator can get a shell @@ -2160,8 +2292,8 @@ Ansible is run again.
When Ansible is run a second time, after the installation script, it @@ -2184,8 +2316,8 @@ sudo rm /etc/sudoers.d/01agentdvr
agentdvragentdvr
AgentDVR runs as the system user agentdvr, which is configured here.
@@ -2224,8 +2356,8 @@ restoration of AgentDVR.)
AgentDVR/
AgentDVR/
The following task probes for the /home/agentdvr/AgentDVR/
@@ -2248,8 +2380,8 @@ remaining installation steps are skipped unless
This service definition came from the template downloaded (from here)
@@ -2305,8 +2437,8 @@ by install.sh
.
The abbey uses a separate volume to store surveillance recordings, @@ -2340,8 +2472,8 @@ location do not fail.
abbey_dvrabbey_dvr
DVR hosts install a custom NRPE plugin named abbey_dvr to monitor
@@ -2374,11 +2506,11 @@ the storage available on /DVR/
.
-A new security camera is setup as described in Cloistering, after
+A new security camera is setup as described in Cloistering, after
which the camera should be accessible by name on the abbey networks.
Assuming ping -c1 new works, the camera's web interface will be
accessible at http://new/.
@@ -2401,8 +2533,8 @@ protocol) is nice but optional.
After Ansible has configured and started the AgentDVR service, its web @@ -2441,8 +2573,8 @@ AgentDVR's Live View.
AgentDVR's web interface is also used to configure a default storage @@ -2454,8 +2586,8 @@ pressed before the task is complete.
After a default storage location has been configured, AgentDVR's @@ -2486,8 +2618,8 @@ parameters are set (in the Recording and Storage tabs).
When restoring /home/
from a backup copy, the user accounts are
@@ -2503,8 +2635,8 @@ installs the system service configuration file and starts the service.
The abbey has a few TV tuners and a subscription to Schedules Direct
@@ -2519,14 +2651,14 @@ configured to serve MythTV pages at e.g. http://new/mythweb/.
-A new TVR machine needs only Cloistering to prepare it for
+A new TVR machine needs only Cloistering to prepare it for
Ansible. As part of that process, it should be added to the tvrs
group in the hosts
file. An existing server can become a TVR
machine by adding it to the tvrs group.
Private variables in private/vars-abbey.yml
are needed, as in the
@@ -2542,8 +2674,8 @@ directory, playbooks/
.
Neither Debian nor the MythTV project provide binary packages of @@ -2572,8 +2704,8 @@ sudo apt install mythtv-backend
Restoring MythTV from a backup copy to a fresh TVR host:
@@ -2601,8 +2733,8 @@ The .mythtv/config.xml
file should provide the DB particulars
Starting with MythTV version 0.26, the time zone tables must be loaded
@@ -2626,8 +2758,8 @@ e.g. 2022-09-13 20:15:41.
The backend does not have a default storage area for its recordings. @@ -2651,13 +2783,13 @@ creates that directory and ensures it has appropriate permissions.
With MythTV built and installed, the post-installation tasks
addressed, and mythtv-backend.service started, go to the web page
-at http://new:6544 and make the following selections.
+at http://new:6544 and make the following selections.
The abbey has a Silicon Dust Homerun HDTV Duo (with two tuners). It
-is setup as described in Cloistering, after which the tuner is
+is setup as described in Cloistering, after which the tuner is
accessible by name (e.g. new) on the cloister network. Assuming
ping -c1 new works, the tuner should be accessible via the
hdhomerun_config_gui command, a graphical interface contributed to
@@ -2684,8 +2816,8 @@ tuner's domain name or IP address can also be entered.
In MythTV Setup:
@@ -2728,30 +2860,30 @@ any case, do not run mythfilldatabase.
-In MythTV Setup:
+In MythTV Backend, the website on Core's port 6544, e.g.
+http://malastare.birchwood.private:6544/:
mythfilldatabase.
The xmltv package, specifically its tv_grab_zz_sdjson program, is
@@ -2786,7 +2918,7 @@ the list of "inputs" available in a postal code typically ends with
the OTA (over the air) broadcasts.
+$ tv_grab_zz_sdjson --configure --config-file .mythtv/Mr.Antenna.xml Cache file for lineups, schedules and programs. Cache file: [/home/mythtv/.xmltv/tv_grab_zz_sdjson.cache] @@ -2836,8 +2968,8 @@ backend is running, so it is not run until then.
If the mythfilldatabase command fails or expected listings do not
@@ -2876,14 +3008,14 @@ Running a similar command (without --quiet) might be more revealing
The abbey changes location almost weekly, so its HDTV broadcast area changes frequently. At the start of a long stay the administrator uses the MythTV Setup program to scan for the new area's channels, as -described in Scan for New Channels. +described in Scan for New Channels.
@@ -2901,31 +3033,28 @@ program as user mythtv.
The program will prompt for the zip code and offer a list of "inputs" -available in that area, as described in Configure XMLTV. +available in that area, as described in Configure XMLTV.
-Then the administrator can re-start the backend.
+Lastly, the administrator runs an immediate update (again as the
+mythtv user).
sudo systemctl start mythtv-backend
+mythfilldatabase
-And the mythtv account can run mythfilldatabase.
+If the command fails, consult Debug XMLTV. Else, the listings appear
+in MythTV Backend's "Program Guide" page.
mythfilldatabase
-
The abbey's Ansible configuration, like that of A Small Institute, is @@ -2952,7 +3081,7 @@ specific versions.
-NOTE: if you have not read at least the Overview of A Small Institute +NOTE: if you have not read at least the Overview of A Small Institute you are lost.
@@ -2982,8 +3111,8 @@ rest are built up piecemeal by (tangled from) this document,README.org, and
Institute/README.org.
ansible.cfg
ansible.cfg
This is much like the example (test) institutional configuration file,
@@ -3000,11 +3129,11 @@ except the roles are found in Institute/roles/
as well as roles/
.
hosts
hosts
hosts
all:
+hosts
all:
vars:
ansible_user: sysadm
ansible_ssh_extra_args: -i Secret/ssh_admin/id_rsa
@@ -3014,16 +3143,21 @@ except the roles are found in Institute/roles/
as well as roles/
.
ansible_host: 159.65.75.60
ansible_become_password: "{{ become_droplet }}"
anoat:
+ ansible_host: anoat.birchwood.private
ansible_become_password: "{{ become_anoat }}"
malastare:
+ ansible_host: malastare.birchwood.private
ansible_become_password: "{{ become_malastare }}"
# Campus
kessel:
+ ansible_host: kessel.birchwood.private
ansible_become_password: "{{ become_kessel }}"
dantooine:
+ ansible_host: dantooine.birchwood.private
ansible_become_password: "{{ become_dantooine }}"
# Notebooks
endor:
+ ansible_host: endor.birchwood.private
ansible_become_password: "{{ become_endor }}"
sullust:
ansible_host: 127.0.0.1
@@ -3073,8 +3207,8 @@ except the roles are found in Institute/roles/
as well as roles/
.
playbooks/site.yml
playbooks/site.yml
This playbook provisions the entire network by applying first the @@ -3115,17 +3249,17 @@ institutional roles, then the liturgical roles.
The ./abbey script encodes the abbey's canonical procedures. It
-includes The Institute Commands and adds a few abbey-specific
+includes The Institute Commands and adds a few abbey-specific
sub-commands.
Institutional sub-commands: @@ -3150,11 +3284,12 @@ hosts.
/run/reboot*on all hosts.
ansible_distribution, _distribution_version,
and _architecture for all hosts.facts.
The script begins with the following prefix and trampolines.
@@ -3177,7 +3312,7 @@ The script begins with the following prefix and trampolines.
The small institute's ./inst command expects to be running in
Institute/
, not ./
, but it only references public/
, private/
,
Secret/
and playbooks/check-inst-vars.yml
, and will find the abbey
-specific versions of these. The roles_path setting in ansible.cfg
+specific versions of these. The roles_path setting in ansible.cfg
effectively merges the institutional roles into the distinctly named
abbey specific roles. The roles likewise reference files with
relative names, and will find the abbey specific private/
@@ -3196,8 +3331,8 @@ code block "duplicates" the action of the institute's
The script implements an upgrade sub-command that runs apt update
@@ -3262,8 +3397,8 @@ a limit pattern. For example:
The script implements a reboots sub-command that looks for
@@ -3294,8 +3429,8 @@ The script implements a reboots sub-command that looks for
The script implements a versions sub-command that reports the
@@ -3322,10 +3457,31 @@ operating system version of all abbey managed machines.
+The script implements a facts sub-command to collect the Ansible
+"facts" from all and output them to the JSON format facts
file.
+
abbey
if ($ARGV[0] eq "facts") {
+ my $line = ("ansible all -m gather_facts -e \@Secret/become.yml"
+ . " >facts");
+ print "$line\n";
+ my $status = system $line;
+ die "status: $status\nCould not run $line: $!\n" if $status != 0;
+ exit;
+}
+
+The abbey changes location almost weekly, so its timezone changes occasionally. Droplet does not move. Gate and other simple servers are kept in UTC. Core, the DVRs, TVRs, Home Assistant and the @@ -3402,19 +3558,20 @@ last host in the previous play.
This is how a new machine is brought into the cloister. The process @@ -3423,8 +3580,8 @@ narrows down to the common preparation of all machines administered by Ansible.
A wireless IoT device (smart TV, Blu-ray deck, etc.) cannot install @@ -3440,8 +3597,8 @@ given a private domain name as described in the following steps.
@@ -3451,12 +3608,12 @@ last step:
The abbey's Raspberry Pi runs the Raspberry Pi OS desktop off an NVMe @@ -3477,8 +3634,8 @@ Ethernet, and power up.
sysadm on the console.sudo raspi-config and use the following menu items.
@@ -3497,14 +3654,14 @@ steps are taken.
Most of the abbey's machines, like Core and Gate, are general-purpose @@ -3519,10 +3676,10 @@ USB drive and connect it to the PC. Ethernet, and power up. Choose to boot from the USB drive.
sysadm on the console.Install OpenSSH, unless it already was when included in the initial Software selection during the Debian installation. Run the @@ -3531,8 +3688,8 @@ following if unsure.
sudo apt install openssh-server
@@ -3541,14 +3698,14 @@ steps are taken.
When a new machine is connected to the cloister Ethernet, its MAC
@@ -3609,12 +3766,12 @@ reporting 1 packets transmitted, 1 received, 0% packet loss....
A wired device is assigned an IP address when it is added to Core's
-DHCP configuration (as in Add to Core DHCP). A private domain name is
+DHCP configuration (as in Add to Core DHCP). A private domain name is
then associated with this address. If the device is intended to
operate wirelessly, the name for its address is modified with a -w
suffix. Thus new-w.small.private would be the name of the new
@@ -3657,8 +3814,8 @@ resolvectl query 192.168.56.4
sysadm on the console.
To remotely administer new-w, Ansible must be authorized to login as
@@ -3716,11 +3873,11 @@ key.
-With remote administration authorized and tested (as in Authorize
+With remote administration authorized and tested (as in Authorize
Remote Administration), and the machine connected to the cloister
Ethernet, the configuration of new-w can be completed by Ansible.
Note that if the machine is staying on the cloister Ethernet, its
@@ -3728,7 +3885,7 @@ domain name will be new (having had no -w suffix added
-First new-w is added to Ansible's inventory in hosts
. A new-w
+First new-w is added to Ansible's inventory in hosts
. A new-w
section is added to the list of all hosts, and an empty section of the
same name is added to the list of campus hosts. If the machine uses
the usual privileged account name, sysadm, the ansible_user key is
@@ -3776,8 +3933,8 @@ configuration files.
On an IoT device, or a Debian or Android "desktop", the cloister Wi-Fi
@@ -3818,8 +3975,8 @@ desktop connected to the Wi-Fi using the following ping command.
Wireless devices (with the cloister Wi-Fi password) can get an IP @@ -3832,14 +3989,14 @@ however, are not accessible except via the cloister VPN.
Connections to the cloister VPN are authorized by the ./abbey
-client... command (aka The Client Command), which registers a new
+client... command (aka The Client Command), which registers a new
client's public key and installs new WireGuard⢠configurations on the
servers. Private keys are kept on the clients (e.g. in
/etc/wireguard/private-key
).
Wireless Debian desktops (with NetworkManager) as well as servers @@ -3925,8 +4082,8 @@ sudo systemctl enable wg-quick@wg0
Member notebooks are private machines not remotely administered by the
@@ -4038,8 +4195,8 @@ password is included in Secret/become.yml
.
Android phones and tablets are authorized to connect to the cloister @@ -4076,8 +4233,8 @@ public VPN.
A wireless machine is assigned a Wi-Fi address when it connects to the
@@ -4132,7 +4289,7 @@ be added to private/db.campus_vpn
.)