"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
-<!-- 2025-06-28 Sat 10:50 -->
+<!-- 2025-09-18 Thu 17:59 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>A Small Institute</title>
secure and private campus that can function with or without the
Internet.
</p>
-<div id="outline-container-orga920549" class="outline-2">
-<h2 id="orga920549"><span class="section-number-2">1.</span> Overview</h2>
+<div id="outline-container-org05da664" class="outline-2">
+<h2 id="org05da664"><span class="section-number-2">1.</span> Overview</h2>
<div class="outline-text-2" id="text-1">
<p>
This small institute has a public server on the Internet, Front, that
members off campus.
</p>
-<pre class="example" id="orgc355f2d">
+<pre class="example" id="org12c31c3">
=
_|||_
=-The-Institute-=
</p>
</div>
</div>
-<div id="outline-container-org4df80f6" class="outline-2">
-<h2 id="org4df80f6"><span class="section-number-2">2.</span> Caveats</h2>
+<div id="outline-container-orge711bbd" class="outline-2">
+<h2 id="orge711bbd"><span class="section-number-2">2.</span> Caveats</h2>
<div class="outline-text-2" id="text-2">
<p>
This small institute prizes its privacy, so there is little or no
</p>
</div>
</div>
-<div id="outline-container-org432674e" class="outline-2">
-<h2 id="org432674e"><span class="section-number-2">3.</span> The Services</h2>
+<div id="outline-container-org5822d39" class="outline-2">
+<h2 id="org5822d39"><span class="section-number-2">3.</span> The Services</h2>
<div class="outline-text-2" id="text-3">
<p>
The small institute's network is designed to provide a number of
reference particulars first introduced in the following chapter.
</p>
</div>
-<div id="outline-container-org9f742c5" class="outline-3">
-<h3 id="org9f742c5"><span class="section-number-3">3.1.</span> The Name Service</h3>
+<div id="outline-container-orgda548cf" class="outline-3">
+<h3 id="orgda548cf"><span class="section-number-3">3.1.</span> The Name Service</h3>
<div class="outline-text-3" id="text-3-1">
<p>
The institute has a public domain, e.g. <code>small.example.org</code>, and a
</p>
</div>
</div>
-<div id="outline-container-org4f09259" class="outline-3">
-<h3 id="org4f09259"><span class="section-number-3">3.2.</span> The Email Service</h3>
+<div id="outline-container-orgff9aad1" class="outline-3">
+<h3 id="orgff9aad1"><span class="section-number-3">3.2.</span> The Email Service</h3>
<div class="outline-text-3" id="text-3-2">
<p>
Front provides the public SMTP (Simple Mail Transfer Protocol) service
configurations wherever <code><<postfix-message-size>></code> appears.
</p>
</div>
-<div id="outline-container-orgb203103" class="outline-4">
-<h4 id="orgb203103"><span class="section-number-4">3.2.1.</span> The Postfix Configurations</h4>
+<div id="outline-container-org178261e" class="outline-4">
+<h4 id="org178261e"><span class="section-number-4">3.2.1.</span> The Postfix Configurations</h4>
<div class="outline-text-4" id="text-3-2-1">
<p>
The institute aims to accommodate encrypted email containing short
</p>
<div class="org-src-container">
-<code>postfix-message-size</code><pre class="src src-conf" id="orgd167b59"><code>- { p: message_size_limit, v: 104857600 }
+<code>postfix-message-size</code><pre class="src src-conf" id="org4c70dd8"><code>- { p: message_size_limit, v: 104857600 }
</code></pre>
</div>
</p>
<div class="org-src-container">
-<code>postfix-queue-times</code><pre class="src src-conf" id="orge4e4b57"><code>- { p: delay_warning_time, v: 1h }
+<code>postfix-queue-times</code><pre class="src src-conf" id="org51033b5"><code>- { p: delay_warning_time, v: 1h }
- { p: maximal_queue_lifetime, v: 4h }
- { p: bounce_queue_lifetime, v: 4h }
</code></pre>
</p>
<div class="org-src-container">
-<code>postfix-relaying</code><pre class="src src-conf" id="org8b12cc4"><code>- p: smtpd_relay_restrictions
+<code>postfix-relaying</code><pre class="src src-conf" id="org1a0b527"><code>- p: smtpd_relay_restrictions
v: permit_mynetworks reject_unauth_destination
</code></pre>
</div>
</p>
<div class="org-src-container">
-<code>postfix-maildir</code><pre class="src src-conf" id="org00b2a78"><code>- { p: home_mailbox, v: Maildir/ }
+<code>postfix-maildir</code><pre class="src src-conf" id="org6695ef5"><code>- { p: home_mailbox, v: Maildir/ }
</code></pre>
</div>
</p>
</div>
</div>
-<div id="outline-container-org2a7fadf" class="outline-4">
-<h4 id="org2a7fadf"><span class="section-number-4">3.2.2.</span> The Dovecot Configurations</h4>
+<div id="outline-container-org0376ca6" class="outline-4">
+<h4 id="org0376ca6"><span class="section-number-4">3.2.2.</span> The Dovecot Configurations</h4>
<div class="outline-text-4" id="text-3-2-2">
<p>
The Dovecot settings on both Front and Core disable POP and require
</p>
<div class="org-src-container">
-<code>dovecot-tls</code><pre class="src src-conf" id="orgb729cac"><code><span class="org-variable-name">protocols</span> = imap
+<code>dovecot-tls</code><pre class="src src-conf" id="org047115a"><code><span class="org-variable-name">protocols</span> = imap
<span class="org-variable-name">ssl</span> = required
</code></pre>
</div>
</p>
<div class="org-src-container">
-<code>dovecot-ports</code><pre class="src src-conf" id="org2abd345"><code><span class="org-type">service imap-login</span> {
+<code>dovecot-ports</code><pre class="src src-conf" id="org594736d"><code><span class="org-type">service imap-login</span> {
<span class="org-type">inet_listener imap</span> {
<span class="org-variable-name">port</span> = 0
}
</p>
<div class="org-src-container">
-<code>dovecot-maildir</code><pre class="src src-conf" id="org962a3f5"><code><span class="org-variable-name">mail_location</span> = maildir:~/Maildir
+<code>dovecot-maildir</code><pre class="src src-conf" id="org533a1b3"><code><span class="org-variable-name">mail_location</span> = maildir:~/Maildir
</code></pre>
</div>
</div>
</div>
</div>
-<div id="outline-container-org194fc48" class="outline-3">
-<h3 id="org194fc48"><span class="section-number-3">3.3.</span> The Web Services</h3>
+<div id="outline-container-org5da08ea" class="outline-3">
+<h3 id="org5da08ea"><span class="section-number-3">3.3.</span> The Web Services</h3>
<div class="outline-text-3" id="text-3-3">
<p>
Front provides the public HTTP service that serves institute web pages
at e.g. <code>https://small.example.org/</code>. The small institute initially
runs with a self-signed, "snake oil" server certificate, causing
browsers to warn of possible fraud, but this certificate is easily
-replaced by one signed by a recognized authority, as discussed in <a href="#org46971ff">The
+replaced by one signed by a recognized authority, as discussed in <a href="#org3fbcb30">The
Front Role</a>.
</p>
</p>
</div>
</div>
-<div id="outline-container-orgc812cfe" class="outline-3">
-<h3 id="orgc812cfe"><span class="section-number-3">3.4.</span> The Cloud Service</h3>
+<div id="outline-container-orgdabefd7" class="outline-3">
+<h3 id="orgdabefd7"><span class="section-number-3">3.4.</span> The Cloud Service</h3>
<div class="outline-text-3" id="text-3-4">
<p>
Core runs Nextcloud to provide a private institute cloud at
<code>https://core.small.private/nextcloud/</code>. It is managed manually per
<a href="https://docs.nextcloud.com/server/latest/admin_manual/">The Nextcloud Server Administration Guide</a>. The code <i>and</i> data,
including especially database dumps, are stored in <q>/Nextcloud/</q> which
-is included in Core's backup procedure as described in <a href="#orgb290c57">Backups</a>. The
+is included in Core's backup procedure as described in <a href="#org2ceac0b">Backups</a>. The
default Apache2 configuration expects to find the web scripts in
<q>/var/www/nextcloud/</q>, so the institute symbolically links this to
<q>/Nextcloud/nextcloud/</q>.
</p>
</div>
</div>
-<div id="outline-container-orge444ccb" class="outline-3">
-<h3 id="orge444ccb"><span class="section-number-3">3.5.</span> Accounts</h3>
+<div id="outline-container-org56d4f14" class="outline-3">
+<h3 id="org56d4f14"><span class="section-number-3">3.5.</span> Accounts</h3>
<div class="outline-text-3" id="text-3-5">
<p>
A small institute has just a handful of members. For simplicity (and
thus security) static configuration files are preferred over complex
account management systems, LDAP, Active Directory, and the like. The
Ansible scripts configure the same set of user accounts on Core and
-Front. <a href="#org935ef4b">The Institute Commands</a> (e.g. <code>./inst new dick</code>) capture the
+Front. <a href="#org79b145a">The Institute Commands</a> (e.g. <code>./inst new dick</code>) capture the
processes of enrolling, modifying and retiring members of the
institute. They update the administrator's membership roll, and run
Ansible to create (and disable) accounts on Core, Front, Nextcloud,
all be private (readable and writable only by the owner) by default.
</p>
</div>
-<div id="outline-container-orgdd9cd27" class="outline-4">
-<h4 id="orgdd9cd27"><span class="section-number-4">3.5.1.</span> The Administration Accounts</h4>
+<div id="outline-container-org323d3a2" class="outline-4">
+<h4 id="org323d3a2"><span class="section-number-4">3.5.1.</span> The Administration Accounts</h4>
<div class="outline-text-4" id="text-3-5-1">
<p>
The institute avoids the use of the <code>root</code> account (<code>uid 0</code>) because
and programs as <code>root</code>. When installation of a Debian OS leaves the
host with no user accounts, just the <code>root</code> account, the next step is
to create a system administrator's account named <code>sysadm</code> and to give
-it permission to use the <code>sudo</code> command (e.g. as described in <a href="#orgcb1ac80">The
+it permission to use the <code>sudo</code> command (e.g. as described in <a href="#orge899b2b">The
Front Machine</a>). When installation prompts for the name of an
initial, privileged user account the same name is given (e.g. as
-described in <a href="#org2342218">The Core Machine</a>). Installation may <i>not</i> prompt and
+described in <a href="#org4d61626">The Core Machine</a>). Installation may <i>not</i> prompt and
still create an initial user account with a distribution specific name
(e.g. <code>pi</code>). Any name can be used as long as it is provided as the
value of <code>ansible_user</code> in <a href="hosts"><q>hosts</q></a>. Its password is specified by a
vault-encrypted variable in the <a href="Secret/become.yml"><q>Secret/become.yml</q></a> file. (The
-<a href="hosts"><q>hosts</q></a> and <a href="Secret/become.yml"><q>Secret/become.yml</q></a> files are described in <a href="#orgafb80a0">The Ansible
+<a href="hosts"><q>hosts</q></a> and <a href="Secret/become.yml"><q>Secret/become.yml</q></a> files are described in <a href="#orgb216592">The Ansible
Configuration</a>.)
</p>
</div>
</div>
-<div id="outline-container-org09187c0" class="outline-4">
-<h4 id="org09187c0"><span class="section-number-4">3.5.2.</span> The Monkey Accounts</h4>
+<div id="outline-container-org3dabc90" class="outline-4">
+<h4 id="org3dabc90"><span class="section-number-4">3.5.2.</span> The Monkey Accounts</h4>
<div class="outline-text-4" id="text-3-5-2">
<p>
The institute's Core uses a special account named <code>monkey</code> to run
</div>
</div>
</div>
-<div id="outline-container-orgbd49b65" class="outline-3">
-<h3 id="orgbd49b65"><span class="section-number-3">3.6.</span> Keys</h3>
+<div id="outline-container-orgaf187bb" class="outline-3">
+<h3 id="orgaf187bb"><span class="section-number-3">3.6.</span> Keys</h3>
<div class="outline-text-3" id="text-3-6">
<p>
The institute keeps its "master secrets" in an encrypted
</p>
</div>
</div>
-<div id="outline-container-orgb290c57" class="outline-3">
-<h3 id="orgb290c57"><span class="section-number-3">3.7.</span> Backups</h3>
+<div id="outline-container-org2ceac0b" class="outline-3">
+<h3 id="org2ceac0b"><span class="section-number-3">3.7.</span> Backups</h3>
<div class="outline-text-3" id="text-3-7">
<p>
The small institute backs up its data, but not so much so that nothing
</p>
<div class="org-src-container">
-<a href="private/backup"><q>private/backup</q></a><pre class="src src-sh" id="org2146981"><code><span class="org-comment-delimiter">#</span><span class="org-comment">!/bin/</span><span class="org-keyword">bash</span><span class="org-comment"> -e</span>
-<span class="org-comment-delimiter">#</span>
-<span class="org-comment-delimiter"># </span><span class="org-comment">DO NOT EDIT. Maintained (will be replaced) by Ansible.</span>
-<span class="org-comment-delimiter">#</span>
-<span class="org-comment-delimiter"># </span><span class="org-comment">sudo backup [-n]</span>
-
+<a href="private/backup"><q>private/backup</q></a><pre class="src src-sh" id="org2d7d21c"><code><span class="org-comment-delimiter">#</span><span class="org-comment">!/bin/</span><span class="org-keyword">bash</span><span class="org-comment"> -e
+</span><span class="org-comment-delimiter">#</span><span class="org-comment">
+</span><span class="org-comment-delimiter"># </span><span class="org-comment">DO NOT EDIT.
+</span><span class="org-comment-delimiter">#</span><span class="org-comment">
+</span><span class="org-comment-delimiter"># </span><span class="org-comment">Maintained (will be replaced) by Ansible.
+</span><span class="org-comment-delimiter">#</span><span class="org-comment">
+</span><span class="org-comment-delimiter"># </span><span class="org-comment">sudo backup [-n]
+</span>
<span class="org-keyword">if</span> [ <span class="org-sh-quoted-exec">`id -u`</span> != <span class="org-string">"0"</span> ]
<span class="org-keyword">then</span>
<span class="org-builtin">echo</span> <span class="org-string">"This script must be run as root."</span>
</div>
</div>
</div>
-<div id="outline-container-org72a1d7b" class="outline-2">
-<h2 id="org72a1d7b"><span class="section-number-2">4.</span> The Particulars</h2>
+<div id="outline-container-orgc0dda53" class="outline-2">
+<h2 id="orgc0dda53"><span class="section-number-2">4.</span> The Particulars</h2>
<div class="outline-text-2" id="text-4">
<p>
This chapter introduces Ansible variables intended to simplify
<p>
The example settings in this document configure VirtualBox VMs as
-described in the <a href="#orgf67ef54">Testing</a> chapter. For more information about how a
+described in the <a href="#org903c8fd">Testing</a> chapter. For more information about how a
small institute turns the example Ansible code into a working Ansible
-configuration, see chapter <a href="#orgafb80a0">The Ansible Configuration</a>.
+configuration, see chapter <a href="#orgb216592">The Ansible Configuration</a>.
</p>
</div>
-<div id="outline-container-orga0d17be" class="outline-3">
-<h3 id="orga0d17be"><span class="section-number-3">4.1.</span> Generic Particulars</h3>
+<div id="outline-container-orgee49a43" class="outline-3">
+<h3 id="orgee49a43"><span class="section-number-3">4.1.</span> Generic Particulars</h3>
<div class="outline-text-3" id="text-4-1">
<p>
The small institute's domain name is used quite frequently in the
The institute's private domain name should end with one of the
top-level domains set aside for this purpose: <code>.intranet</code>,
<code>.internal</code>, <code>.private</code>, <code>.corp</code>, <code>.home</code> or <code>.lan</code>.<sup><a id="fnr.1" class="footref" href="#fn.1" role="doc-backlink">1</a></sup> It is
-hoped that doing so will increase that chances that some abomination
+hoped that doing so will increase the chances that some abomination
like DNS-over-HTTPS will pass us by.
</p>
</div>
</div>
</div>
-<div id="outline-container-org97462d0" class="outline-3">
-<h3 id="org97462d0"><span class="section-number-3">4.2.</span> Subnets</h3>
+<div id="outline-container-orgcda4063" class="outline-3">
+<h3 id="orgcda4063"><span class="section-number-3">4.2.</span> Subnets</h3>
<div class="outline-text-3" id="text-4-2">
<p>
The small institute uses a private Ethernet, two VPNs, and a "wild",
<tbody>
<tr>
<td class="org-left">10.0.0.0/24</td>
-<td class="org-left">10.0.0.1 – 10.0.0.254</td>
+<td class="org-left">10.0.0.1 – 10.0.0.254</td>
</tr>
<tr>
<td class="org-left">10.0.1.0/24</td>
-<td class="org-left">10.0.1.1 – 10.0.1.254</td>
+<td class="org-left">10.0.1.1 – 10.0.1.254</td>
</tr>
<tr>
<td class="org-left">10.0.2.0/24</td>
-<td class="org-left">10.0.2.1 – 10.0.2.254</td>
+<td class="org-left">10.0.2.1 – 10.0.2.254</td>
</tr>
<tr>
-<td class="org-left">…</td>
-<td class="org-left">…</td>
+<td class="org-left">…</td>
+<td class="org-left">…</td>
</tr>
<tr>
<td class="org-left">10.255.255.0/24</td>
-<td class="org-left">10.255.255.1 – 10.255.255.254</td>
+<td class="org-left">10.255.255.1 – 10.255.255.254</td>
</tr>
<tr>
<td class="org-left">172.16.0.0/24</td>
-<td class="org-left">172.16.0.1 – 172.16.0.254</td>
+<td class="org-left">172.16.0.1 – 172.16.0.254</td>
</tr>
<tr>
<td class="org-left">172.16.1.0/24</td>
-<td class="org-left">172.16.1.1 – 172.16.1.254</td>
+<td class="org-left">172.16.1.1 – 172.16.1.254</td>
</tr>
<tr>
<td class="org-left">172.16.2.0/24</td>
-<td class="org-left">172.16.2.1 – 172.16.2.254</td>
+<td class="org-left">172.16.2.1 – 172.16.2.254</td>
</tr>
<tr>
-<td class="org-left">…</td>
-<td class="org-left">…</td>
+<td class="org-left">…</td>
+<td class="org-left">…</td>
</tr>
<tr>
<td class="org-left">172.31.255.0/24</td>
-<td class="org-left">172.31.255.1 – 172.31.255.254</td>
+<td class="org-left">172.31.255.1 – 172.31.255.254</td>
</tr>
</tbody>
</table>
</code></pre>
</div>
-<div class="TEXT" id="org9bf0758">
+<div class="TEXT" id="org8910fe3">
<p>
=> 10.62.17.0/24
</p>
sensitive information so again the code block below "tangles" into
<a href="private/vars.yml"><q>private/vars.yml</q></a> rather than <a href="public/vars.yml"><q>public/vars.yml</q></a>. Two of the
addresses are in <code>192.168</code> subnets because they are part of a test
-configuration using mostly-default VirtualBoxes (described <a href="#orgf67ef54">here</a>).
+configuration using mostly-default VirtualBoxes (described <a href="#org903c8fd">here</a>).
</p>
<div class="org-src-container">
</div>
</div>
</div>
-<div id="outline-container-org962f0d4" class="outline-2">
-<h2 id="org962f0d4"><span class="section-number-2">5.</span> The Hardware</h2>
+<div id="outline-container-org6a2440c" class="outline-2">
+<h2 id="org6a2440c"><span class="section-number-2">5.</span> The Hardware</h2>
<div class="outline-text-2" id="text-5">
<p>
The small institute's network was built by its system administrator
using Ansible on a trusted notebook. The Ansible configuration and
scripts were generated by "tangling" the Ansible code included here.
-(<a href="#orgafb80a0">The Ansible Configuration</a> describes how to do this.) The following
+(<a href="#orgb216592">The Ansible Configuration</a> describes how to do this.) The following
sections describe how Front, Gate and Core were prepared for Ansible.
</p>
</div>
-<div id="outline-container-orgcb1ac80" class="outline-3">
-<h3 id="orgcb1ac80"><span class="section-number-3">5.1.</span> The Front Machine</h3>
+<div id="outline-container-orge899b2b" class="outline-3">
+<h3 id="orge899b2b"><span class="section-number-3">5.1.</span> The Front Machine</h3>
<div class="outline-text-3" id="text-5-1">
<p>
Front is the small institute's public facing server, a virtual machine
Internet café using just the administrator's notebook.
</p>
</div>
-<div id="outline-container-org6a5d84e" class="outline-4">
-<h4 id="org6a5d84e"><span class="section-number-4">5.1.1.</span> A Digital Ocean Droplet</h4>
+<div id="outline-container-org47d5cd9" class="outline-4">
+<h4 id="org47d5cd9"><span class="section-number-4">5.1.1.</span> A Digital Ocean Droplet</h4>
<div class="outline-text-4" id="text-5-1-1">
<p>
The following example prepared a new front on a Digital Ocean droplet.
<p>
The freshly created Digital Ocean droplet came with just one account,
<code>root</code>, but the small institute avoids remote access to the "super
-user" account (per the policy in <a href="#orgdd9cd27">The Administration Accounts</a>), so the
+user" account (per the policy in <a href="#org323d3a2">The Administration Accounts</a>), so the
administrator created a <code>sysadm</code> account with the ability to request
escalated privileges via the <code>sudo</code> command.
</p>
The password was generated by <code>gpw</code>, saved in the administrator's
password keep, and later added to <a href="Secret/become.yml"><q>Secret/become.yml</q></a> as shown below.
(Producing a working Ansible configuration with <a href="Secret/become.yml"><q>Secret/become.yml</q></a>
-file is described in <a href="#orgafb80a0">The Ansible Configuration</a>.)
+file is described in <a href="#orgb216592">The Ansible Configuration</a>.)
</p>
<pre class="example">
<p>
After creating the <code>sysadm</code> account on the droplet, the administrator
concatenated a personal public ssh key and the key found in
-<a href="Secret/ssh_admin/"><q>Secret/ssh_admin/</q></a> (created by <a href="#org2dc18d3">The CA Command</a>) into an <q>admin_keys</q>
+<a href="Secret/ssh_admin/"><q>Secret/ssh_admin/</q></a> (created by <a href="#org274b741">The CA Command</a>) into an <q>admin_keys</q>
file, copied it to the droplet, and installed it as the
<q>authorized_keys</q> for <code>sysadm</code>.
</p>
</div>
</div>
</div>
-<div id="outline-container-org2342218" class="outline-3">
-<h3 id="org2342218"><span class="section-number-3">5.2.</span> The Core Machine</h3>
+<div id="outline-container-org4d61626" class="outline-3">
+<h3 id="org4d61626"><span class="section-number-3">5.2.</span> The Core Machine</h3>
<div class="outline-text-3" id="text-5-2">
<p>
Core is the small institute's private file, email, cloud and whatnot
freshly installed. During installation, the machine was named <code>core</code>,
no desktop or server software was installed, no root password was set,
and a privileged account named <code>sysadm</code> was created (per the policy in
-<a href="#orgdd9cd27">The Administration Accounts</a>).
+<a href="#org323d3a2">The Administration Accounts</a>).
</p>
<pre class="example">
The password was generated by <code>gpw</code>, saved in the administrator's
password keep, and later added to <a href="Secret/become.yml"><q>Secret/become.yml</q></a> as shown below.
(Producing a working Ansible configuration with <a href="Secret/become.yml"><q>Secret/become.yml</q></a>
-file is described in <a href="#orgafb80a0">The Ansible Configuration</a>.)
+file is described in <a href="#orgb216592">The Ansible Configuration</a>.)
</p>
<pre class="example">
<pre class="example">
$ sudo apt install netplan.io systemd-resolved unattended-upgrades \
-_ ntp isc-dhcp-server bind9 apache2 wireguard \
+_ chrony isc-dhcp-server bind9 apache2 wireguard \
_ postfix dovecot-imapd fetchmail expect rsync \
_ gnupg openssh-server
</pre>
<p>
-The Nextcloud configuration requires Apache2, MariaDB and a number of
+Manual installation of Postfix prompted for configuration type and
+mail name. The answers given are listed here.
+</p>
+
+<ul class="org-ul">
+<li>General type of mail configuration: Internet Site</li>
+<li>System mail name: core.small.private</li>
+</ul>
+
+<p>
+The host then needed to be rebooted to get its name service working
+again after <code>systemd-resolved</code> was installed. (Any help with this
+will be welcome!) After rebooting and re-logging in, yet more
+software packages were installed.
+</p>
+
+<p>
+The Nextcloud configuration required Apache2, MariaDB and a number of
PHP modules. Installing them while Core was on a cable modem sped up
final configuration "in position" (on a frontier).
</p>
</pre>
<p>
-Similarly, the NAGIOS configuration requires a handful of packages
+Similarly, the NAGIOS configuration required a handful of packages
that were pre-loaded via cable modem (to test a frontier deployment).
</p>
<p>
Next, the administrator concatenated a personal public ssh key and the
-key found in <a href="Secret/ssh_admin/"><q>Secret/ssh_admin/</q></a> (created by <a href="#org2dc18d3">The CA Command</a>) into an
+key found in <a href="Secret/ssh_admin/"><q>Secret/ssh_admin/</q></a> (created by <a href="#org274b741">The CA Command</a>) into an
<q>admin_keys</q> file, copied it to Core, and installed it as the
<q>authorized_keys</q> for <code>sysadm</code>.
</p>
<p>
Note that the name <code>core.lan</code> should be known to the cable modem's DNS
service. An IP address might be used instead, discovered with an <code>ip
-a</code> on Core.
+-4 a</code> command on Core.
</p>
<p>
<p>
In the example command lines below, the address <code>10.227.248.1</code> was
generated by the random subnet address picking procedure described in
-<a href="#org97462d0">Subnets</a>, and is named <code>core_addr</code> in the Ansible code. The second
+<a href="#orgcda4063">Subnets</a>, and is named <code>core_addr</code> in the Ansible code. The second
address, <code>10.227.248.2</code>, is the corresponding address for Gate's
Ethernet interface, and is named <code>gate_addr</code> in the Ansible
code.
</p>
</div>
</div>
-<div id="outline-container-org2e49760" class="outline-3">
-<h3 id="org2e49760"><span class="section-number-3">5.3.</span> The Gate Machine</h3>
+<div id="outline-container-orgd15e60d" class="outline-3">
+<h3 id="orgd15e60d"><span class="section-number-3">5.3.</span> The Gate Machine</h3>
<div class="outline-text-3" id="text-5-3">
<p>
Gate is the small institute's route to the Internet, and the campus
point(s).</li>
<li><code>isp</code> is its third network interface, connected to the campus
ISP. This could be an Ethernet device connected to a cable
-modem. It could be a USB port tethered to a phone, a
-USB-Ethernet adapter, or a wireless adapter connected to a
-campground Wi-Fi access point, etc.</li>
+modem, a USB port tethered to a phone, a wireless adapter
+connected to a campground Wi-Fi access point, etc.</li>
</ol>
-<pre class="example" id="org330aa5a">
+<pre class="example" id="orga138a6e">
=============== | ==================================================
| Premises
(Campus ISP)
+----Ethernet switch
</pre>
</div>
-<div id="outline-container-org49b2787" class="outline-4">
-<h4 id="org49b2787"><span class="section-number-4">5.3.1.</span> Alternate Gate Topology</h4>
+<div id="outline-container-org3727c43" class="outline-4">
+<h4 id="org3727c43"><span class="section-number-4">5.3.1.</span> Alternate Gate Topology</h4>
<div class="outline-text-4" id="text-5-3-1">
<p>
While Gate and Core really need to be separate machines for security
following topology.
</p>
-<pre class="example" id="orgb4e97c9">
+<pre class="example" id="orgc471b07">
=============== | ==================================================
| Premises
(House ISP)
</p>
</div>
</div>
-<div id="outline-container-org59a2ee8" class="outline-4">
-<h4 id="org59a2ee8"><span class="section-number-4">5.3.2.</span> Original Gate Topology</h4>
+<div id="outline-container-org4338252" class="outline-4">
+<h4 id="org4338252"><span class="section-number-4">5.3.2.</span> Original Gate Topology</h4>
<div class="outline-text-4" id="text-5-3-2">
<p>
The Ansible code in this document is somewhat dependent on the
-physical network shown in the <a href="#orga920549">Overview</a> wherein Gate has three network
+physical network shown in the <a href="#org05da664">Overview</a> wherein Gate has three network
interfaces.
</p>
freshly installed. During installation, the machine was named <code>gate</code>,
no desktop or server software was installed, no root password was set,
and a privileged account named <code>sysadm</code> was created (per the policy in
-<a href="#orgdd9cd27">The Administration Accounts</a>).
+<a href="#org323d3a2">The Administration Accounts</a>).
</p>
<pre class="example">
The password was generated by <code>gpw</code>, saved in the administrator's
password keep, and later added to <a href="Secret/become.yml"><q>Secret/become.yml</q></a> as shown below.
(Producing a working Ansible configuration with <a href="Secret/become.yml"><q>Secret/become.yml</q></a>
-file is described in <a href="#orgafb80a0">The Ansible Configuration</a>.)
+file is described in <a href="#orgb216592">The Ansible Configuration</a>.)
</p>
<pre class="example">
_ openssh-server
</pre>
+<p>
+The host then needed to be rebooted to get its name service working
+again after <code>systemd-resolved</code> was installed. (Any help with this will
+be welcome!) After rebooting and re-logging in, the administrator was
+ready to proceed.
+</p>
+
<p>
Next, the administrator concatenated a personal public ssh key and the
-key found in <a href="Secret/ssh_admin/"><q>Secret/ssh_admin/</q></a> (created by <a href="#org2dc18d3">The CA Command</a>) into an
+key found in <a href="Secret/ssh_admin/"><q>Secret/ssh_admin/</q></a> (created by <a href="#org274b741">The CA Command</a>) into an
<q>admin_keys</q> file, copied it to Gate, and installed it as the
<q>authorized_keys</q> for <code>sysadm</code>.
</p>
<p>
In the example command lines below, the address <code>10.227.248.2</code> was
generated by the random subnet address picking procedure described in
-<a href="#org97462d0">Subnets</a>, and is named <code>gate_addr</code> in the Ansible code.
+<a href="#orgcda4063">Subnets</a>, and is named <code>gate_addr</code> in the Ansible code.
</p>
<pre class="example">
<p>
Gate was also connected to the USB Ethernet dongles cabled to the
-campus Wi-Fi access point and the campus ISP. The three network
-adapters are known by their MAC addresses, the values of the variables
-<code>gate_lan_mac</code>, <code>gate_wild_mac</code>, and <code>gate_isp_mac</code>. (For more
-information, see the Gate role's <a href="#orga9ce231">Configure Netplan</a> task.)
+campus Wi-Fi access point and the campus ISP and the values of three
+variables (<code>gate_lan_mac</code>, <code>gate_wild_mac</code>, and <code>gate_isp_mac</code> in
+<a href="private/vars.yml"><q>private/vars.yml</q></a>) match the actual hardware MAC addresses of the
+dongles. (For more information, see the Gate role's <a href="#orgc350fb4">Configure Netplan</a>
+task.)
</p>
<p>
</div>
</div>
</div>
-<div id="outline-container-orgb7fbc87" class="outline-2">
-<h2 id="orgb7fbc87"><span class="section-number-2">6.</span> The All Role</h2>
+<div id="outline-container-orgad416df" class="outline-2">
+<h2 id="orgad416df"><span class="section-number-2">6.</span> The All Role</h2>
<div class="outline-text-2" id="text-6">
<p>
The <code>all</code> role contains tasks that are executed on all of the
institute's servers. At the moment there is just the one.
</p>
</div>
-<div id="outline-container-org29a209e" class="outline-3">
-<h3 id="org29a209e"><span class="section-number-3">6.1.</span> Include Particulars</h3>
+<div id="outline-container-org67e12b4" class="outline-3">
+<h3 id="org67e12b4"><span class="section-number-3">6.1.</span> Include Particulars</h3>
<div class="outline-text-3" id="text-6-1">
<p>
The <code>all</code> role's task contains a reference to a common institute
particular, the institute's <code>domain_name</code>, a variable found in the
<q>public/vars.yml</q> file. Thus the first task of the <code>all</code> role is to
-include the variables defined in this file (described in <a href="#org72a1d7b">The
+include the variables defined in this file (described in <a href="#orgc0dda53">The
Particulars</a>). The code block below is the first to tangle into
<a href="roles/all/tasks/main.yml"><q>roles/all/tasks/main.yml</q></a>.
</p>
</div>
</div>
</div>
-<div id="outline-container-orgfb79aa0" class="outline-3">
-<h3 id="orgfb79aa0"><span class="section-number-3">6.2.</span> Enable Systemd Resolved</h3>
+<div id="outline-container-org154651f" class="outline-3">
+<h3 id="org154651f"><span class="section-number-3">6.2.</span> Enable Systemd Resolved</h3>
<div class="outline-text-3" id="text-6-2">
<p>
The <code>systemd-networkd</code> and <code>systemd-resolved</code> service units are not
<span class="org-variable-name">- ansible_distribution</span> == <span class="org-string">'Debian'</span>
- 11 < ansible_distribution_major_version|int
-- name: Enable/Start systemd-networkd.
+- name: Start systemd-networkd.
+ become: yes
+ systemd:
+ service: systemd-networkd
+ state: started
+ tags: actualizer
+
+- name: Enable systemd-networkd.
become: yes
systemd:
service: systemd-networkd
enabled: yes
+
+- name: Start systemd-resolved.
+ become: yes
+ systemd:
+ service: systemd-resolved
state: started
+ tags: actualizer
-- name: Enable/Start systemd-resolved.
+- name: Enable systemd-resolved.
become: yes
systemd:
service: systemd-resolved
enabled: yes
- state: started
- name: Link /etc/resolv.conf.
become: yes
</div>
</div>
</div>
-<div id="outline-container-org7fb1e55" class="outline-3">
-<h3 id="org7fb1e55"><span class="section-number-3">6.3.</span> Trust Institute Certificate Authority</h3>
+<div id="outline-container-org5b29186" class="outline-3">
+<h3 id="org5b29186"><span class="section-number-3">6.3.</span> Trust Institute Certificate Authority</h3>
<div class="outline-text-3" id="text-6-3">
<p>
All servers should recognize the institute's Certificate Authority as
trustworthy, so its certificate is added to the set of trusted CAs on
each host. More information about how the small institute manages its
-X.509 certificates is available in <a href="#orgbd49b65">Keys</a>.
+X.509 certificates is available in <a href="#orgaf187bb">Keys</a>.
</p>
<div class="org-src-container">
</div>
<div class="org-src-container">
-<a href="roles_t/all/handlers/main.yml"><q>roles_t/all/handlers/main.yml</q></a><pre class="src src-conf"><code>
+<a href="roles_t/all/handlers/main.yml"><q>roles_t/all/handlers/main.yml</q></a><pre class="src src-conf"><code>---
- name: Update CAs.
become: yes
command: update-ca-certificates
</div>
</div>
</div>
-<div id="outline-container-org46971ff" class="outline-2">
-<h2 id="org46971ff"><span class="section-number-2">7.</span> The Front Role</h2>
+<div id="outline-container-org3fbcb30" class="outline-2">
+<h2 id="org3fbcb30"><span class="section-number-2">7.</span> The Front Role</h2>
<div class="outline-text-2" id="text-7">
<p>
The <code>front</code> role installs and configures the services expected on the
institute's publicly accessible "front door": email, web, VPN. The
virtual machine is prepared with an Ubuntu Server install and remote
access to a privileged, administrator's account. (For details, see
-<a href="#orgcb1ac80">The Front Machine</a>.)
+<a href="#orge899b2b">The Front Machine</a>.)
</p>
<p>
<q>/etc/letsencrypt/live/small.example.org/fullchain.pem</q>.
</p>
</div>
-<div id="outline-container-org3f0c727" class="outline-3">
-<h3 id="org3f0c727"><span class="section-number-3">7.1.</span> Include Particulars</h3>
+<div id="outline-container-orgfc95abc" class="outline-3">
+<h3 id="orgfc95abc"><span class="section-number-3">7.1.</span> Include Particulars</h3>
<div class="outline-text-3" id="text-7-1">
<p>
-The first task, as in <a href="#orgb7fbc87">The All Role</a>, is to include the institute
+The first task, as in <a href="#orgad416df">The All Role</a>, is to include the institute
particulars. The <code>front</code> role refers to private variables and the
membership roll, so these are included was well.
</p>
</div>
</div>
</div>
-<div id="outline-container-orga0da7f4" class="outline-3">
-<h3 id="orga0da7f4"><span class="section-number-3">7.2.</span> Configure Hostname</h3>
+<div id="outline-container-org90e3d3a" class="outline-3">
+<h3 id="org90e3d3a"><span class="section-number-3">7.2.</span> Configure Hostname</h3>
<div class="outline-text-3" id="text-7-2">
<p>
This task ensures that Front's <q>/etc/hostname</q> and <q>/etc/mailname</q> are
loop:
- /etc/hostname
- /etc/mailname
- notify: Update hostname.
-</code></pre>
-</div>
-<div class="org-src-container">
-<a href="roles_t/front/handlers/main.yml"><q>roles_t/front/handlers/main.yml</q></a><pre class="src src-conf"><code>---
- name: Update hostname.
become: yes
command: hostname -F /etc/hostname
+ <span class="org-variable-name">when: domain_name !</span>= ansible_hostname
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org6e591a5" class="outline-3">
-<h3 id="org6e591a5"><span class="section-number-3">7.3.</span> Add Administrator to System Groups</h3>
+<div id="outline-container-orgcfa05f6" class="outline-3">
+<h3 id="orgcfa05f6"><span class="section-number-3">7.3.</span> Add Administrator to System Groups</h3>
<div class="outline-text-3" id="text-7-3">
<p>
The administrator often needs to read (directories of) log files owned
</div>
</div>
</div>
-<div id="outline-container-org5251aab" class="outline-3">
-<h3 id="org5251aab"><span class="section-number-3">7.4.</span> Configure SSH</h3>
+<div id="outline-container-org0f5fd96" class="outline-3">
+<h3 id="org0f5fd96"><span class="section-number-3">7.4.</span> Configure SSH</h3>
<div class="outline-text-3" id="text-7-4">
<p>
The SSH service on Front needs to be known to Monkey. The following
</div>
<div class="org-src-container">
-<a href="roles_t/front/handlers/main.yml"><q>roles_t/front/handlers/main.yml</q></a><pre class="src src-conf"><code>
+<a href="roles_t/front/handlers/main.yml"><q>roles_t/front/handlers/main.yml</q></a><pre class="src src-conf"><code>---
- name: Reload SSH server.
become: yes
systemd:
service: ssh
state: reloaded
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org198f59a" class="outline-3">
-<h3 id="org198f59a"><span class="section-number-3">7.5.</span> Configure Monkey</h3>
+<div id="outline-container-orgac996c6" class="outline-3">
+<h3 id="orgac996c6"><span class="section-number-3">7.5.</span> Configure Monkey</h3>
<div class="outline-text-3" id="text-7-5">
<p>
The small institute runs cron jobs and web scripts that generate
system account named <code>monkey</code>. One of Monkey's more important jobs on
Core is to run <code>rsync</code> to update the public web site on Front. Monkey
on Core will login as <code>monkey</code> on Front to synchronize the files (as
-described in <a href="#org9489aab">*Configure Apache2</a>). To do that without needing a
+described in <a href="#org15438ec">*Configure Apache2</a>). To do that without needing a
password, the <code>monkey</code> account on Front should authorize Monkey's SSH
key on Core.
</p>
become: yes
user:
name: monkey
- system: yes
+ password: <span class="org-string">"!"</span>
- name: Authorize monkey@core.
become: yes
</div>
</div>
</div>
-<div id="outline-container-orgad58dcb" class="outline-3">
-<h3 id="orgad58dcb"><span class="section-number-3">7.6.</span> Install Rsync</h3>
+<div id="outline-container-orgd5828db" class="outline-3">
+<h3 id="orgd5828db"><span class="section-number-3">7.6.</span> Install Rsync</h3>
<div class="outline-text-3" id="text-7-6">
<p>
Monkey uses Rsync to keep the institute's public web site up-to-date.
</div>
</div>
</div>
-<div id="outline-container-org09c9d06" class="outline-3">
-<h3 id="org09c9d06"><span class="section-number-3">7.7.</span> Install Unattended Upgrades</h3>
+<div id="outline-container-org2d6b73b" class="outline-3">
+<h3 id="org2d6b73b"><span class="section-number-3">7.7.</span> Install Unattended Upgrades</h3>
<div class="outline-text-3" id="text-7-7">
<p>
The institute prefers to install security updates as soon as possible.
</div>
</div>
</div>
-<div id="outline-container-org1b26949" class="outline-3">
-<h3 id="org1b26949"><span class="section-number-3">7.8.</span> Configure User Accounts</h3>
+<div id="outline-container-org261fe5f" class="outline-3">
+<h3 id="org261fe5f"><span class="section-number-3">7.8.</span> Configure User Accounts</h3>
<div class="outline-text-3" id="text-7-8">
<p>
User accounts are created immediately so that Postfix and Dovecot can
start delivering email immediately, <i>without</i> returning "no such
-recipient" replies. The <a href="#org8ec1044">Account Management</a> chapter describes the
+recipient" replies. The <a href="#org80f2e68">Account Management</a> chapter describes the
<code>members</code> and <code>usernames</code> variables used below.
</p>
</div>
</div>
</div>
-<div id="outline-container-org6c317d3" class="outline-3">
-<h3 id="org6c317d3"><span class="section-number-3">7.9.</span> Install Server Certificate</h3>
+<div id="outline-container-org78b6acc" class="outline-3">
+<h3 id="org78b6acc"><span class="section-number-3">7.9.</span> Install Server Certificate</h3>
<div class="outline-text-3" id="text-7-9">
<p>
The servers on Front use the same certificate (and key) to
</div>
</div>
</div>
-<div id="outline-container-org927cd17" class="outline-3">
-<h3 id="org927cd17"><span class="section-number-3">7.10.</span> Configure Postfix on Front</h3>
+<div id="outline-container-org806dee8" class="outline-3">
+<h3 id="org806dee8"><span class="section-number-3">7.10.</span> Configure Postfix on Front</h3>
<div class="outline-text-3" id="text-7-10">
<p>
Front uses Postfix to provide the institute's public SMTP service, and
</ul>
<p>
-As discussed in <a href="#org4f09259">The Email Service</a> above, Front's Postfix configuration
+As discussed in <a href="#orgff9aad1">The Email Service</a> above, Front's Postfix configuration
includes site-wide support for larger message sizes, shorter queue
times, the relaying configuration, and the common path to incoming
emails. These and a few Front-specific Postfix configurations
</p>
<div class="org-src-container">
-<code>postfix-front-networks</code><pre class="src src-conf" id="orga7a4c8d"><code>- p: mynetworks
+<code>postfix-front-networks</code><pre class="src src-conf" id="org45d47d8"><code>- p: mynetworks
v: >-
{{ public_wg_net_cidr }}
127.0.0.0/8
</p>
<div class="org-src-container">
-<code>postfix-front-restrictions</code><pre class="src src-conf" id="org11445bc"><code>- p: smtpd_recipient_restrictions
+<code>postfix-front-restrictions</code><pre class="src src-conf" id="org35e980f"><code>- p: smtpd_recipient_restrictions
v: >-
permit_mynetworks
reject_unauth_pipelining
</p>
<div class="org-src-container">
-<code>postfix-header-checks</code><pre class="src src-conf" id="org596a497"><code>- p: smtp_header_checks
+<code>postfix-header-checks</code><pre class="src src-conf" id="orged3c81a"><code>- p: smtp_header_checks
v: regexp:/etc/postfix/header_checks.cf
</code></pre>
</div>
<div class="org-src-container">
-<code>postfix-header-checks-content</code><pre class="src src-conf" id="org53f7b65"><code>/^Received:/ IGNORE
+<code>postfix-header-checks-content</code><pre class="src src-conf" id="orga3a4c3c"><code>/^Received:/ IGNORE
/^User-Agent:/ IGNORE
</code></pre>
</div>
</p>
<div class="org-src-container">
-<code>postfix-front</code><pre class="src src-conf" id="org6ba4e17"><code>- { p: smtpd_tls_cert_file, v: /etc/server.crt }
+<code>postfix-front</code><pre class="src src-conf" id="orgba02da7"><code>- { p: smtpd_tls_cert_file, v: /etc/server.crt }
- { p: smtpd_tls_key_file, v: /etc/server.key }
<<postfix-front-networks>>
<<postfix-front-restrictions>>
dest: /etc/postfix/header_checks.cf
notify: Postmap header checks.
-- name: Enable/Start Postfix.
+- name: Start Postfix.
become: yes
systemd:
service: postfix
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable Postfix.
+ become: yes
+ systemd:
+ service: postfix
+ enabled: yes
</code></pre>
</div>
systemd:
service: postfix
state: restarted
+ tags: actualizer
- name: Postmap header checks.
become: yes
</div>
</div>
</div>
-<div id="outline-container-orge6123af" class="outline-3">
-<h3 id="orge6123af"><span class="section-number-3">7.11.</span> Configure Public Email Aliases</h3>
+<div id="outline-container-org4e1c5cb" class="outline-3">
+<h3 id="org4e1c5cb"><span class="section-number-3">7.11.</span> Configure Public Email Aliases</h3>
<div class="outline-text-3" id="text-7-11">
<p>
The institute's Front needs to deliver email addressed to a number of
- name: New aliases.
become: yes
command: newaliases
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-orgd8027bb" class="outline-3">
-<h3 id="orgd8027bb"><span class="section-number-3">7.12.</span> Configure Dovecot IMAPd</h3>
+<div id="outline-container-orgdc3c7f0" class="outline-3">
+<h3 id="orgdc3c7f0"><span class="section-number-3">7.12.</span> Configure Dovecot IMAPd</h3>
<div class="outline-text-3" id="text-7-12">
<p>
Front uses Dovecot's IMAPd to allow user Fetchmail jobs on Core to
bit "over the top" given that Core accesses Front via VPN, but helps
to ensure privacy even when members must, in extremis, access recent
email directly from their accounts on Front. For more information
-about Front's role in the institute's email services, see <a href="#org4f09259">The Email
+about Front's role in the institute's email services, see <a href="#orgff9aad1">The Email
Service</a>.
</p>
dest: /etc/dovecot/local.conf
notify: Restart Dovecot.
-- name: Enable/Start Dovecot.
+- name: Start Dovecot.
become: yes
systemd:
service: dovecot
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable Dovecot.
+ become: yes
+ systemd:
+ service: dovecot
+ enabled: yes
</code></pre>
</div>
systemd:
service: dovecot
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org97c8980" class="outline-3">
-<h3 id="org97c8980"><span class="section-number-3">7.13.</span> Configure Apache2 <a id="org9489aab"></a></h3>
+<div id="outline-container-orgde141cc" class="outline-3">
+<h3 id="orgde141cc"><span class="section-number-3">7.13.</span> Configure Apache2 <a id="org15438ec"></a></h3>
<div class="outline-text-3" id="text-7-13">
<p>
This is the small institute's public web site. It is simple, static,
</p>
<div class="org-src-container">
-<code>apache-ciphers</code><pre class="src src-conf" id="org47e0bee"><code>SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
+<code>apache-ciphers</code><pre class="src src-conf" id="org4b1ab7c"><code>SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLHonorCipherOrder on
<span class="org-type">SSLCipherSuite {</span>{ [ <span class="org-string">'ECDHE-ECDSA-AES128-GCM-SHA256'</span>,
<span class="org-string">'ECDHE-ECDSA-AES256-GCM-SHA384'</span>,
</p>
<div class="org-src-container">
-<code>apache-userdir-front</code><pre class="src src-conf" id="org99be9b0"><code>UserDir /home/www-users
+<code>apache-userdir-front</code><pre class="src src-conf" id="org7da24fd"><code>UserDir /home/www-users
<Directory /home/www-users/>
Require all granted
AllowOverride None
</p>
<div class="org-src-container">
-<code>apache-redirect-front</code><pre class="src src-conf" id="org65d4300"><code><VirtualHost *:80>
+<code>apache-redirect-front</code><pre class="src src-conf" id="org3b99fd9"><code><VirtualHost *:80>
Redirect permanent / https://{{ domain_name }}/
</VirtualHost>
</code></pre>
</p>
<div class="org-src-container">
-<code>apache-front</code><pre class="src src-conf" id="org160cca6"><code>ServerName {{ domain_name }}
+<code>apache-front</code><pre class="src src-conf" id="org7f3bc31"><code>ServerName {{ domain_name }}
ServerAdmin webmaster@{{ domain_name }}
DocumentRoot /home/www
creates: /etc/apache2/sites-enabled/{{ domain_name }}.conf
notify: Restart Apache2.
-- name: Enable/Start Apache2.
+- name: Start Apache2.
become: yes
systemd:
service: apache2
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable Apache2.
+ become: yes
+ systemd:
+ service: apache2
+ enabled: yes
</code></pre>
</div>
systemd:
service: apache2
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
</div>
-<div id="outline-container-org44edb94" class="outline-3">
-<h3 id="org44edb94"><span class="section-number-3">7.14.</span> Configure Public WireGuard™ Subnet</h3>
+<div id="outline-container-org25a022b" class="outline-3">
+<h3 id="org25a022b"><span class="section-number-3">7.14.</span> Configure Public WireGuard™ Subnet</h3>
<div class="outline-text-3" id="text-7-14">
<p>
Front uses WireGuard™ to provide a public (Internet accessible) VPN
</p>
<p>
-The following example <a href="#orgd684cc6"><q>private/front-wg0.conf</q></a> configuration recognizes
+The following example <a href="#org30319d3"><q>private/front-wg0.conf</q></a> configuration recognizes
Core by its public key and routes the institute's private networks to
it. It also recognizes Dick's notebook and his (replacement) phone,
assigning them host numbers 4 and 6 on the VPN.
</p>
<div class="org-src-container">
-<q>private/front-wg0.conf</q><pre class="src src-conf" id="orgd684cc6"><code>[<span class="org-type">Interface</span>]
+<q>private/front-wg0.conf</q><pre class="src src-conf" id="org30319d3"><code>[<span class="org-type">Interface</span>]
<span class="org-variable-name">Address</span> = 10.177.87.1/24
<span class="org-variable-name">ListenPort</span> = 39608
<span class="org-variable-name">PostUp</span> = wg set %i private-key /etc/wireguard/private-key
<span class="org-variable-name">PostUp</span> = resolvectl dns %i 192.168.56.1
<span class="org-variable-name">PostUp</span> = resolvectl domain %i small.private
-<span class="org-comment-delimiter"># </span><span class="org-comment">Core</span>
-[<span class="org-type">Peer</span>]
+<span class="org-comment-delimiter"># </span><span class="org-comment">Core
+</span>[<span class="org-type">Peer</span>]
<span class="org-variable-name">PublicKey</span> = lGhC51IBgZtlq4H2bsYFuKvPtV0VAEwUvVIn5fW7D0c=
<span class="org-variable-name">AllowedIPs</span> = 10.177.87.2
<span class="org-variable-name">AllowedIPs</span> = 192.168.56.0/24
<span class="org-variable-name">AllowedIPs</span> = 192.168.57.0/24
<span class="org-variable-name">AllowedIPs</span> = 10.84.139.0/24
-<span class="org-comment-delimiter"># </span><span class="org-comment">dick</span>
-[<span class="org-type">Peer</span>]
+<span class="org-comment-delimiter"># </span><span class="org-comment">dick
+</span>[<span class="org-type">Peer</span>]
<span class="org-variable-name">PublicKey</span> = 4qd4xdRztZBKhFrX9jI/b4fnMzpKQ5qhg691hwYSsX8=
<span class="org-variable-name">AllowedIPs</span> = 10.177.87.4
-<span class="org-comment-delimiter"># </span><span class="org-comment">dicks-razr</span>
-[<span class="org-type">Peer</span>]
+<span class="org-comment-delimiter"># </span><span class="org-comment">dicks-razr
+</span>[<span class="org-type">Peer</span>]
<span class="org-variable-name">PublicKey</span> = zho0qMxoLclJSQu4GeJEcMkk0hx4Q047OcNc8vOejVw=
<span class="org-variable-name">AllowedIPs</span> = 10.177.87.6
</code></pre>
<p>
The following tasks install WireGuard™, configure it with
-<a href="#orgd684cc6"><q>private/front-wg0.conf</q></a>, and enable the service.
+<a href="#org30319d3"><q>private/front-wg0.conf</q></a>, and enable the service.
</p>
<div class="org-src-container">
<a href="roles_t/front/tasks/main.yml"><q>roles_t/front/tasks/main.yml</q></a><pre class="src src-conf"><code>
+- name: Enable IP forwarding.
+ become: yes
+ sysctl:
+ name: net.ipv4.ip_forward
+ value: <span class="org-string">"1"</span>
+ state: present
+
- name: Install WireGuard™.
become: yes
<span class="org-variable-name">apt: pkg</span>=wireguard
group: root
notify: Restart WireGuard™.
-- name: Enable/Start WireGuard™ on boot.
+- name: Start WireGuard™.
become: yes
systemd:
service: wg-quick@wg0
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable WireGuard™.
+ become: yes
+ systemd:
+ service: wg-quick@wg0
+ enabled: yes
</code></pre>
</div>
systemd:
service: wg-quick@wg0
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org057fa25" class="outline-3">
-<h3 id="org057fa25"><span class="section-number-3">7.15.</span> Configure Kamailio</h3>
+<div id="outline-container-org31a52ac" class="outline-3">
+<h3 id="org31a52ac"><span class="section-number-3">7.15.</span> Configure Kamailio</h3>
<div class="outline-text-3" id="text-7-15">
<p>
Front uses Kamailio to provide a SIP service on the public VPN so that
</p>
<div class="org-src-container">
-<code>kamailio</code><pre class="src src-conf" id="org4f56f44"><code><span class="org-variable-name">listen</span>=udp:{{ front_wg_addr }}:5060
+<code>kamailio</code><pre class="src src-conf" id="orgd080cca"><code><span class="org-variable-name">listen</span>=udp:{{ front_wg_addr }}:5060
</code></pre>
</div>
become: yes
systemd:
daemon-reload: yes
+ tags: actualizer
</code></pre>
</div>
dest: /etc/kamailio/kamailio-local.cfg
notify: Restart Kamailio.
-- name: Enable/Start Kamailio.
+- name: Start Kamailio.
become: yes
systemd:
service: kamailio
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable Kamailio.
+ become: yes
+ systemd:
+ service: kamailio
+ enabled: yes
</code></pre>
</div>
systemd:
service: kamailio
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
</div>
-<div id="outline-container-orgfb09fcf" class="outline-2">
-<h2 id="orgfb09fcf"><span class="section-number-2">8.</span> The Core Role</h2>
+<div id="outline-container-orgc29541b" class="outline-2">
+<h2 id="orgc29541b"><span class="section-number-2">8.</span> The Core Role</h2>
<div class="outline-text-2" id="text-8">
<p>
The <code>core</code> role configures many essential campus network services as
well as the institute's private cloud, so the core machine has
horsepower (CPUs and RAM) and large disks and is prepared with a
Debian install and remote access to a privileged, administrator's
-account. (For details, see <a href="#org2342218">The Core Machine</a>.)
+account. (For details, see <a href="#org4d61626">The Core Machine</a>.)
</p>
</div>
-<div id="outline-container-org1d54831" class="outline-3">
-<h3 id="org1d54831"><span class="section-number-3">8.1.</span> Include Particulars</h3>
+<div id="outline-container-org7bf5f3f" class="outline-3">
+<h3 id="org7bf5f3f"><span class="section-number-3">8.1.</span> Include Particulars</h3>
<div class="outline-text-3" id="text-8-1">
<p>
-The first task, as in <a href="#org46971ff">The Front Role</a>, is to include the institute
+The first task, as in <a href="#org3fbcb30">The Front Role</a>, is to include the institute
particulars and membership roll.
</p>
</div>
</div>
</div>
-<div id="outline-container-org0705762" class="outline-3">
-<h3 id="org0705762"><span class="section-number-3">8.2.</span> Configure Hostname</h3>
+<div id="outline-container-org02ca68d" class="outline-3">
+<h3 id="org02ca68d"><span class="section-number-3">8.2.</span> Configure Hostname</h3>
<div class="outline-text-3" id="text-8-2">
<p>
This task ensures that Core's <q>/etc/hostname</q> and <q>/etc/mailname</q> are
loop:
- { name: <span class="org-string">"core.{{ domain_priv }}"</span>, file: /etc/mailname }
- { name: <span class="org-string">"{{ inventory_hostname }}"</span>, file: /etc/hostname }
- notify: Update hostname.
-</code></pre>
-</div>
-<div class="org-src-container">
-<a href="roles_t/core/handlers/main.yml"><q>roles_t/core/handlers/main.yml</q></a><pre class="src src-conf"><code>---
- name: Update hostname.
become: yes
command: hostname -F /etc/hostname
+ <span class="org-variable-name">when: inventory_hostname !</span>= ansible_hostname
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org282e2ea" class="outline-3">
-<h3 id="org282e2ea"><span class="section-number-3">8.3.</span> Configure Systemd Resolved</h3>
+<div id="outline-container-org22c7c7f" class="outline-3">
+<h3 id="org22c7c7f"><span class="section-number-3">8.3.</span> Configure Systemd Resolved</h3>
<div class="outline-text-3" id="text-8-3">
<p>
Core runs the campus name server, so Resolved is configured to use it
</div>
<div class="org-src-container">
-<a href="roles_t/core/handlers/main.yml"><q>roles_t/core/handlers/main.yml</q></a><pre class="src src-conf"><code>
+<a href="roles_t/core/handlers/main.yml"><q>roles_t/core/handlers/main.yml</q></a><pre class="src src-conf"><code>---
- name: Reload Systemd.
become: yes
systemd:
daemon-reload: yes
+ tags: actualizer
- name: Restart Systemd resolved.
become: yes
systemd:
service: systemd-resolved
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org8871f00" class="outline-3">
-<h3 id="org8871f00"><span class="section-number-3">8.4.</span> Configure Netplan</h3>
+<div id="outline-container-org7efe399" class="outline-3">
+<h3 id="org7efe399"><span class="section-number-3">8.4.</span> Configure Netplan</h3>
<div class="outline-text-3" id="text-8-4">
<p>
Core's network interface is statically configured using Netplan and an
nameservers:
search: [ {{ domain_priv }} ]
addresses: [ {{ core_addr }} ]
- gateway4: {{ gate_addr }}
+ routes:
+ - to: default
+ via: {{ gate_addr }}
dest: /etc/netplan/60-core.yaml
<span class="org-variable-name">mode: u</span>=rw,g=r,o=
notify: Apply netplan.
- name: Apply netplan.
become: yes
command: netplan apply
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-orgbd554c7" class="outline-3">
-<h3 id="orgbd554c7"><span class="section-number-3">8.5.</span> Configure DHCP For the Private Ethernet</h3>
+<div id="outline-container-org4098289" class="outline-3">
+<h3 id="org4098289"><span class="section-number-3">8.5.</span> Configure DHCP For the Private Ethernet</h3>
<div class="outline-text-3" id="text-8-5">
<p>
Core speaks DHCP (Dynamic Host Configuration Protocol) using the
dest: /etc/dhcp/dhcpd.conf
notify: Restart DHCP server.
-- name: Enable/Start DHCP server.
+- name: Start DHCP server.
become: yes
systemd:
service: isc-dhcp-server
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable DHCP server.
+ become: yes
+ systemd:
+ service: isc-dhcp-server
+ enabled: yes
</code></pre>
</div>
systemd:
service: isc-dhcp-server
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-orgc91c899" class="outline-3">
-<h3 id="orgc91c899"><span class="section-number-3">8.6.</span> Configure BIND9</h3>
+<div id="outline-container-org7875b3a" class="outline-3">
+<h3 id="org7875b3a"><span class="section-number-3">8.6.</span> Configure BIND9</h3>
<div class="outline-text-3" id="text-8-6">
<p>
Core uses BIND9 to provide name service for the institute as described
-in <a href="#org9f742c5">The Name Service</a>. The configuration supports reverse name lookups,
+in <a href="#orgda548cf">The Name Service</a>. The configuration supports reverse name lookups,
resolving many private network addresses to private domain names.
</p>
loop: [ domain, private, public_vpn, campus_vpn ]
notify: Reload BIND9.
-- name: Enable/Start BIND9.
+- name: Start BIND9.
become: yes
systemd:
service: bind9
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable BIND9.
+ become: yes
+ systemd:
+ service: bind9
+ enabled: yes
</code></pre>
</div>
systemd:
service: bind9
state: reloaded
+ tags: actualizer
</code></pre>
</div>
</p>
<div class="org-src-container">
-<code>bind-options</code><pre class="src src-conf" id="org7b2ecfa"><code><span class="org-type">acl </span><span class="org-string"><span class="org-type">"trusted"</span></span> {
+<code>bind-options</code><pre class="src src-conf" id="org132eef4"><code><span class="org-type">acl </span><span class="org-string"><span class="org-type">"trusted"</span></span> {
{{ private_net_cidr }};
{{ wild_net_cidr }};
{{ public_wg_net_cidr }};
</div>
<div class="org-src-container">
-<code>bind-local</code><pre class="src src-conf" id="org6629fb3"><code>include <span class="org-string">"/etc/bind/zones.rfc1918"</span>;
+<code>bind-local</code><pre class="src src-conf" id="orgd106c27"><code>include <span class="org-string">"/etc/bind/zones.rfc1918"</span>;
<span class="org-type">zone </span><span class="org-string"><span class="org-type">"{{ domain_priv }}."</span></span> {
type master;
file <span class="org-string">"/etc/bind/db.domain"</span>;
};
-<span class="org-type">zone </span><span class="org-string"><span class="org-type">"{</span></span><span class="org-string">{ private_net_cidr | ansible.utils.ipaddr('revdns')</span>
-<span class="org-string"> </span><span class="org-string"><span class="org-type">| regex_replace('^0\.','') }}"</span></span> {
+<span class="org-type">zone </span><span class="org-string"><span class="org-type">"{</span></span><span class="org-string">{ private_net_cidr | ansible.utils.ipaddr('revdns')
+ </span><span class="org-string"><span class="org-type">| regex_replace('^0\.','') }}"</span></span> {
type master;
file <span class="org-string">"/etc/bind/db.private"</span>;
};
-<span class="org-type">zone </span><span class="org-string"><span class="org-type">"{</span></span><span class="org-string">{ public_wg_net_cidr | ansible.utils.ipaddr('revdns')</span>
-<span class="org-string"> </span><span class="org-string"><span class="org-type">| regex_replace('^0\.','') }}"</span></span> {
+<span class="org-type">zone </span><span class="org-string"><span class="org-type">"{</span></span><span class="org-string">{ public_wg_net_cidr | ansible.utils.ipaddr('revdns')
+ </span><span class="org-string"><span class="org-type">| regex_replace('^0\.','') }}"</span></span> {
type master;
file <span class="org-string">"/etc/bind/db.public_vpn"</span>;
};
-<span class="org-type">zone </span><span class="org-string"><span class="org-type">"{</span></span><span class="org-string">{ campus_wg_net_cidr | ansible.utils.ipaddr('revdns')</span>
-<span class="org-string"> </span><span class="org-string"><span class="org-type">| regex_replace('^0\.','') }}"</span></span> {
+<span class="org-type">zone </span><span class="org-string"><span class="org-type">"{</span></span><span class="org-string">{ campus_wg_net_cidr | ansible.utils.ipaddr('revdns')
+ </span><span class="org-string"><span class="org-type">| regex_replace('^0\.','') }}"</span></span> {
type master;
file <span class="org-string">"/etc/bind/db.campus_vpn"</span>;
};
<div class="org-src-container">
<a href="private/db.domain"><q>private/db.domain</q></a><pre class="src src-conf"><code>;
-; BIND data file for a small institute<span class="org-string">'s PRIVATE domain names.</span>
-<span class="org-string">;</span>
-<span class="org-string">$TTL 604800</span>
-<span class="org-string">@ IN SOA small.private. root.small.private. (</span>
-<span class="org-string"> 1 ; Serial</span>
-<span class="org-string"> 604800 ; Refresh</span>
-<span class="org-string"> 86400 ; Retry</span>
-<span class="org-string"> 2419200 ; Expire</span>
-<span class="org-string"> 604800 ) ; Negative Cache TTL</span>
-<span class="org-string">;</span>
-<span class="org-string">@ IN NS core.small.private.</span>
-<span class="org-string">$TTL 7200</span>
-<span class="org-string">mail IN CNAME core.small.private.</span>
-<span class="org-string">smtp IN CNAME core.small.private.</span>
-<span class="org-string">ns IN CNAME core.small.private.</span>
-<span class="org-string">www IN CNAME core.small.private.</span>
-<span class="org-string">test IN CNAME core.small.private.</span>
-<span class="org-string">live IN CNAME core.small.private.</span>
-<span class="org-string">ntp IN CNAME core.small.private.</span>
-<span class="org-string">sip IN A 10.177.87.1</span>
-<span class="org-string">;</span>
-<span class="org-string">core IN A 192.168.56.1</span>
-<span class="org-string">gate IN A 192.168.56.2</span>
+; BIND data file for a small institute<span class="org-string">'s PRIVATE domain names.
+;
+$TTL 604800
+@ IN SOA small.private. root.small.private. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS core.small.private.
+$TTL 7200
+mail IN CNAME core.small.private.
+smtp IN CNAME core.small.private.
+ns IN CNAME core.small.private.
+www IN CNAME core.small.private.
+test IN CNAME core.small.private.
+live IN CNAME core.small.private.
+ntp IN CNAME core.small.private.
+sip IN A 10.177.87.1
+;
+core IN A 192.168.56.1
+gate IN A 192.168.56.2</span>
</code></pre>
</div>
<div class="org-src-container">
<a href="private/db.private"><q>private/db.private</q></a><pre class="src src-conf"><code>;
-; BIND reverse data file for a small institute<span class="org-string">'s private Ethernet.</span>
-<span class="org-string">;</span>
-<span class="org-string">$TTL 604800</span>
-<span class="org-string">@ IN SOA small.private. root.small.private. (</span>
-<span class="org-string"> 1 ; Serial</span>
-<span class="org-string"> 604800 ; Refresh</span>
-<span class="org-string"> 86400 ; Retry</span>
-<span class="org-string"> 2419200 ; Expire</span>
-<span class="org-string"> 604800 ) ; Negative Cache TTL</span>
-<span class="org-string">;</span>
-<span class="org-string">@ IN NS core.small.private.</span>
-<span class="org-string">$TTL 7200</span>
-<span class="org-string">1 IN PTR core.small.private.</span>
-<span class="org-string">2 IN PTR gate.small.private.</span>
+; BIND reverse data file for a small institute<span class="org-string">'s private Ethernet.
+;
+$TTL 604800
+@ IN SOA small.private. root.small.private. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS core.small.private.
+$TTL 7200
+1 IN PTR core.small.private.
+2 IN PTR gate.small.private.</span>
</code></pre>
</div>
<div class="org-src-container">
<a href="private/db.public_vpn"><q>private/db.public_vpn</q></a><pre class="src src-conf"><code>;
-; BIND reverse data file for a small institute<span class="org-string">'s public VPN.</span>
-<span class="org-string">;</span>
-<span class="org-string">$TTL 604800</span>
-<span class="org-string">@ IN SOA small.private. root.small.private. (</span>
-<span class="org-string"> 1 ; Serial</span>
-<span class="org-string"> 604800 ; Refresh</span>
-<span class="org-string"> 86400 ; Retry</span>
-<span class="org-string"> 2419200 ; Expire</span>
-<span class="org-string"> 604800 ) ; Negative Cache TTL</span>
-<span class="org-string">;</span>
-<span class="org-string">@ IN NS core.small.private.</span>
-<span class="org-string">$TTL 7200</span>
-<span class="org-string">1 IN PTR front-p.small.private.</span>
-<span class="org-string">2 IN PTR core-p.small.private.</span>
+; BIND reverse data file for a small institute<span class="org-string">'s public VPN.
+;
+$TTL 604800
+@ IN SOA small.private. root.small.private. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS core.small.private.
+$TTL 7200
+1 IN PTR front-p.small.private.
+2 IN PTR core-p.small.private.</span>
</code></pre>
</div>
<div class="org-src-container">
<a href="private/db.campus_vpn"><q>private/db.campus_vpn</q></a><pre class="src src-conf"><code>;
-; BIND reverse data file for a small institute<span class="org-string">'s campus VPN.</span>
-<span class="org-string">;</span>
-<span class="org-string">$TTL 604800</span>
-<span class="org-string">@ IN SOA small.private. root.small.private. (</span>
-<span class="org-string"> 1 ; Serial</span>
-<span class="org-string"> 604800 ; Refresh</span>
-<span class="org-string"> 86400 ; Retry</span>
-<span class="org-string"> 2419200 ; Expire</span>
-<span class="org-string"> 604800 ) ; Negative Cache TTL</span>
-<span class="org-string">;</span>
-<span class="org-string">@ IN NS core.small.private.</span>
-<span class="org-string">$TTL 7200</span>
-<span class="org-string">1 IN PTR gate-c.small.private.</span>
+; BIND reverse data file for a small institute<span class="org-string">'s campus VPN.
+;
+$TTL 604800
+@ IN SOA small.private. root.small.private. (
+ 1 ; Serial
+ 604800 ; Refresh
+ 86400 ; Retry
+ 2419200 ; Expire
+ 604800 ) ; Negative Cache TTL
+;
+@ IN NS core.small.private.
+$TTL 7200
+1 IN PTR gate-c.small.private.</span>
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org17b7ca5" class="outline-3">
-<h3 id="org17b7ca5"><span class="section-number-3">8.7.</span> Add Administrator to System Groups</h3>
+<div id="outline-container-org0b05646" class="outline-3">
+<h3 id="org0b05646"><span class="section-number-3">8.7.</span> Add Administrator to System Groups</h3>
<div class="outline-text-3" id="text-8-7">
<p>
The administrator often needs to read (directories of) log files owned
</div>
</div>
</div>
-<div id="outline-container-org970f5a0" class="outline-3">
-<h3 id="org970f5a0"><span class="section-number-3">8.8.</span> Configure Monkey</h3>
+<div id="outline-container-org701f5c9" class="outline-3">
+<h3 id="org701f5c9"><span class="section-number-3">8.8.</span> Configure Monkey</h3>
<div class="outline-text-3" id="text-8-8">
<p>
The small institute runs cron jobs and web scripts that generate
reports and perform checks. The un-privileged jobs are run by a
system account named <code>monkey</code>. One of Monkey's more important jobs on
Core is to run <code>rsync</code> to update the public web site on Front (as
-described in <a href="#orgb0912df">*Configure Apache2</a>).
+described in <a href="#org017921e">*Configure Apache2</a>).
</p>
<div class="org-src-container">
become: yes
user:
name: monkey
- system: yes
+ password: <span class="org-string">"!"</span>
append: yes
groups: staff
</div>
</div>
</div>
-<div id="outline-container-orga84ea2e" class="outline-3">
-<h3 id="orga84ea2e"><span class="section-number-3">8.9.</span> Install Unattended Upgrades</h3>
+<div id="outline-container-orgbcfd5c1" class="outline-3">
+<h3 id="orgbcfd5c1"><span class="section-number-3">8.9.</span> Install Unattended Upgrades</h3>
<div class="outline-text-3" id="text-8-9">
<p>
The institute prefers to install security updates as soon as possible.
</div>
</div>
</div>
-<div id="outline-container-org354a73e" class="outline-3">
-<h3 id="org354a73e"><span class="section-number-3">8.10.</span> Install Expect</h3>
+<div id="outline-container-org21821d0" class="outline-3">
+<h3 id="org21821d0"><span class="section-number-3">8.10.</span> Install Expect</h3>
<div class="outline-text-3" id="text-8-10">
<p>
-The <code>expect</code> program is used by <a href="#org935ef4b">The Institute Commands</a> to interact
+The <code>expect</code> program is used by <a href="#org79b145a">The Institute Commands</a> to interact
with Nextcloud on the command line.
</p>
</div>
</div>
</div>
-<div id="outline-container-org88f4f96" class="outline-3">
-<h3 id="org88f4f96"><span class="section-number-3">8.11.</span> Configure User Accounts</h3>
+<div id="outline-container-orgaacebdb" class="outline-3">
+<h3 id="orgaacebdb"><span class="section-number-3">8.11.</span> Configure User Accounts</h3>
<div class="outline-text-3" id="text-8-11">
<p>
User accounts are created immediately so that backups can begin
-restoring as soon as possible. The <a href="#org8ec1044">Account Management</a> chapter
+restoring as soon as possible. The <a href="#org80f2e68">Account Management</a> chapter
describes the <code>members</code> and <code>usernames</code> variables.
</p>
</div>
</div>
</div>
-<div id="outline-container-orgf7bc7b8" class="outline-3">
-<h3 id="orgf7bc7b8"><span class="section-number-3">8.12.</span> Install Server Certificate</h3>
+<div id="outline-container-org146701c" class="outline-3">
+<h3 id="org146701c"><span class="section-number-3">8.12.</span> Install Server Certificate</h3>
<div class="outline-text-3" id="text-8-12">
<p>
The servers on Core use the same certificate (and key) to authenticate
</div>
</div>
</div>
-<div id="outline-container-org9a8bb55" class="outline-3">
-<h3 id="org9a8bb55"><span class="section-number-3">8.13.</span> Install NTP</h3>
+<div id="outline-container-orga13509e" class="outline-3">
+<h3 id="orga13509e"><span class="section-number-3">8.13.</span> Install Chrony</h3>
<div class="outline-text-3" id="text-8-13">
<p>
-Core uses NTP to provide a time synchronization service to the campus.
+Core uses Chrony to provide a time synchronization service to the campus.
The default daemon's default configuration is fine.
</p>
<div class="org-src-container">
<a href="roles_t/core/tasks/main.yml"><q>roles_t/core/tasks/main.yml</q></a><pre class="src src-conf"><code>
-- name: Install NTP.
+- name: Install Chrony.
+ become: yes
+ <span class="org-variable-name">apt: pkg</span>=chrony
+
+- name: Configure NTP service.
become: yes
- <span class="org-variable-name">apt: pkg</span>=ntp
+ copy:
+ content: |
+ allow {{ private_net_cidr }}
+ allow {{ public_wg_net_cidr }}
+ allow {{ campus_wg_net_cidr }}
+ dest: /etc/chrony/conf.d/institute.conf
+ notify: Restart Chrony.
</code></pre>
</div>
+
+<div class="org-src-container">
+<a href="roles_t/core/handlers/main.yml"><q>roles_t/core/handlers/main.yml</q></a><pre class="src src-conf"><code>
+- name: Restart Chrony.
+ systemd:
+ service: chrony
+ state: restarted
+</code></pre>
</div>
</div>
-<div id="outline-container-org9a49c5b" class="outline-3">
-<h3 id="org9a49c5b"><span class="section-number-3">8.14.</span> Configure Postfix on Core</h3>
+</div>
+<div id="outline-container-orgf2d58ba" class="outline-3">
+<h3 id="orgf2d58ba"><span class="section-number-3">8.14.</span> Configure Postfix on Core</h3>
<div class="outline-text-3" id="text-8-14">
<p>
Core uses Postfix to provide SMTP service to the campus. The default
</ul>
<p>
-As discussed in <a href="#org4f09259">The Email Service</a> above, Core delivers email addressed
+As discussed in <a href="#orgff9aad1">The Email Service</a> above, Core delivers email addressed
to any internal domain name locally, and uses its smarthost Front to
relay the rest. Core is reachable only on institute networks, so
there is little benefit in enabling TLS, but it does need to handle
</p>
<div class="org-src-container">
-<code>postfix-core-networks</code><pre class="src src-conf" id="org28352b1"><code>- p: mynetworks
+<code>postfix-core-networks</code><pre class="src src-conf" id="org4247f6c"><code>- p: mynetworks
v: >-
{{ private_net_cidr }}
{{ public_wg_net_cidr }}
</p>
<div class="org-src-container">
-<code>postfix-core-relayhost</code><pre class="src src-conf" id="orge298c5a"><code>- { p: relayhost, v: <span class="org-string">"[{{ front_wg_addr }}]"</span> }
+<code>postfix-core-relayhost</code><pre class="src src-conf" id="org4eade8e"><code>- { p: relayhost, v: <span class="org-string">"[{{ front_wg_addr }}]"</span> }
</code></pre>
</div>
</p>
<div class="org-src-container">
-<code>postfix-transport</code><pre class="src src-conf" id="orgd07a1d6"><code>.{{ domain_name }} local:$myhostname
+<code>postfix-transport</code><pre class="src src-conf" id="orgeb4b125"><code>.{{ domain_name }} local:$myhostname
.{{ domain_priv }} local:$myhostname
</code></pre>
</div>
</p>
<div class="org-src-container">
-<code>postfix-core</code><pre class="src src-conf" id="orgfa67fbd"><code><<postfix-relaying>>
+<code>postfix-core</code><pre class="src src-conf" id="orgcd46829"><code><<postfix-relaying>>
- { p: smtpd_tls_security_level, v: none }
- { p: smtp_tls_security_level, v: none }
<<postfix-message-size>>
dest: /etc/postfix/transport
notify: Postmap transport.
-- name: Enable/Start Postfix.
+- name: Start Postfix.
become: yes
systemd:
service: postfix
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable Postfix.
+ become: yes
+ systemd:
+ service: postfix
+ enabled: yes
</code></pre>
</div>
systemd:
service: postfix
state: restarted
+ tags: actualizer
- name: Postmap transport.
become: yes
</div>
</div>
</div>
-<div id="outline-container-org9d33516" class="outline-3">
-<h3 id="org9d33516"><span class="section-number-3">8.15.</span> Configure Private Email Aliases</h3>
+<div id="outline-container-org22528f7" class="outline-3">
+<h3 id="org22528f7"><span class="section-number-3">8.15.</span> Configure Private Email Aliases</h3>
<div class="outline-text-3" id="text-8-15">
<p>
The institute's Core needs to deliver email addressed to institute
become: yes
blockinfile:
block: |
- webmaster: root
admin: root
www-data: root
monkey: root
- root: {{ ansible_user }}
path: /etc/aliases
marker: <span class="org-string">"# {mark} INSTITUTE MANAGED BLOCK"</span>
notify: New aliases.
- name: New aliases.
become: yes
command: newaliases
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-orgba6d47f" class="outline-3">
-<h3 id="orgba6d47f"><span class="section-number-3">8.16.</span> Configure Dovecot IMAPd</h3>
+<div id="outline-container-org8e119ad" class="outline-3">
+<h3 id="org8e119ad"><span class="section-number-3">8.16.</span> Configure Dovecot IMAPd</h3>
<div class="outline-text-3" id="text-8-16">
<p>
Core uses Dovecot's IMAPd to store and serve member emails. As on
networks, but helps to ensure privacy even when members accidentally
attempt connections from outside the private networks. For more
information about Core's role in the institute's email services, see
-<a href="#org4f09259">The Email Service</a>.
+<a href="#orgff9aad1">The Email Service</a>.
</p>
<p>
<q>README.Debian</q> (in <q>/usr/share/dovecot-core/</q>) but replaces the
default "snake oil" certificate with another, signed by the institute.
(For more information about the institute's X.509 certificates, see
-<a href="#orgbd49b65">Keys</a>.)
+<a href="#orgaf187bb">Keys</a>.)
</p>
<p>
dest: /etc/dovecot/local.conf
notify: Restart Dovecot.
-- name: Enable/Start Dovecot.
+- name: Start Dovecot.
become: yes
systemd:
service: dovecot
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable Dovecot.
+ become: yes
+ systemd:
+ service: dovecot
+ enabled: yes
</code></pre>
</div>
systemd:
service: dovecot
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-orgfd6d1ed" class="outline-3">
-<h3 id="orgfd6d1ed"><span class="section-number-3">8.17.</span> Configure Fetchmail</h3>
+<div id="outline-container-orgb01b9ad" class="outline-3">
+<h3 id="orgb01b9ad"><span class="section-number-3">8.17.</span> Configure Fetchmail</h3>
<div class="outline-text-3" id="text-8-17">
<p>
Core runs a <code>fetchmail</code> for each member of the institute. Individual
</p>
<div class="org-src-container">
-<code>fetchmail-config</code><pre class="src src-conf" id="orgdba139a"><code><span class="org-comment-delimiter"># </span><span class="org-comment">Permissions on this file may be no greater than 0600.</span>
-
+<code>fetchmail-config</code><pre class="src src-conf" id="org306ddb3"><code><span class="org-comment-delimiter"># </span><span class="org-comment">Permissions on this file may be no greater than 0600.
+</span>
set no bouncemail
set no spambounce
set no syslog
-<span class="org-comment-delimiter">#</span><span class="org-comment">set logfile /home/{{ item }}/.fetchmail.log</span>
-
+<span class="org-comment-delimiter">#</span><span class="org-comment">set logfile /home/{{ item }}/.fetchmail.log
+</span>
poll {{ front_wg_addr }} protocol imap timeout 15
username {{ item }}
password <span class="org-string">"{{ members[item].password_fetchmail }}"</span> fetchall
</p>
<div class="org-src-container">
-<code>fetchmail-service</code><pre class="src src-conf" id="org2fe43e7"><code>[<span class="org-type">Unit</span>]
+<code>fetchmail-service</code><pre class="src src-conf" id="orgd9f1e00"><code>[<span class="org-type">Unit</span>]
<span class="org-variable-name">Description</span>=Fetchmail --idle task for {{ item }}.
<span class="org-variable-name">AssertPathExists</span>=/home/{{ item }}/.fetchmailrc
<span class="org-variable-name">After</span>=wg-quick@wg0.service
when:
<span class="org-variable-name">- members[item].status</span> == <span class="org-string">'current'</span>
- members[item].password_fetchmail is defined
- tags: accounts
+ tags: accounts, actualizer
</code></pre>
</div>
</div>
</div>
</div>
-<div id="outline-container-orgeadb684" class="outline-3">
-<h3 id="orgeadb684"><span class="section-number-3">8.18.</span> Configure Apache2 <a id="orgb0912df"></a></h3>
+<div id="outline-container-org0584f40" class="outline-3">
+<h3 id="org0584f40"><span class="section-number-3">8.18.</span> Configure Apache2 <a id="org017921e"></a></h3>
<div class="outline-text-3" id="text-8-18">
<p>
This is the small institute's campus web server. It hosts several web
-sites as described in <a href="#org194fc48">The Web Services</a>.
+sites as described in <a href="#org5da08ea">The Web Services</a>.
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
</p>
<div class="org-src-container">
-<code>apache-userdir-core</code><pre class="src src-conf" id="org55d229f"><code>UserDir Public/HTML
+<code>apache-userdir-core</code><pre class="src src-conf" id="org6ad7a77"><code>UserDir Public/HTML
<Directory /home/*/Public/HTML/>
Require all granted
AllowOverride None
</p>
<div class="org-src-container">
-<code>apache-live</code><pre class="src src-conf" id="org47e2a36"><code><VirtualHost *:80>
+<code>apache-live</code><pre class="src src-conf" id="orgc1eb3c8"><code><VirtualHost *:80>
ServerName live
ServerAlias live.{{ domain_priv }}
ServerAdmin webmaster@core.{{ domain_priv }}
</p>
<div class="org-src-container">
-<code>apache-test</code><pre class="src src-conf" id="org27d04d7"><code><VirtualHost *:80>
+<code>apache-test</code><pre class="src src-conf" id="org2d1ec07"><code><VirtualHost *:80>
ServerName test
ServerAlias test.{{ domain_priv }}
ServerAdmin webmaster@core.{{ domain_priv }}
</p>
<div class="org-src-container">
-<code>apache-campus</code><pre class="src src-conf" id="org0ffca69"><code><VirtualHost *:80>
+<code>apache-campus</code><pre class="src src-conf" id="org5104462"><code><VirtualHost *:80>
ServerName www
ServerAlias www.{{ domain_priv }}
ServerAdmin webmaster@core.{{ domain_priv }}
loop: [ live, test, www, default-ssl ]
notify: Restart Apache2.
-- name: Enable/Start Apache2.
+- name: Start Apache2.
become: yes
systemd:
service: apache2
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable Apache2.
+ become: yes
+ systemd:
+ service: apache2
+ enabled: yes
</code></pre>
</div>
systemd:
service: apache2
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org56357d8" class="outline-3">
-<h3 id="org56357d8"><span class="section-number-3">8.19.</span> Configure Website Updates</h3>
+<div id="outline-container-orgf96e151" class="outline-3">
+<h3 id="orgf96e151"><span class="section-number-3">8.19.</span> Configure Website Updates</h3>
<div class="outline-text-3" id="text-8-19">
<p>
Monkey on Core runs <q>/usr/local/sbin/webupdate</q> every 15 minutes via a
</p>
<div class="org-src-container">
-<a href="private/webupdate"><q>private/webupdate</q></a><pre class="src src-sh" id="orgbd0a740"><code><span class="org-comment-delimiter">#</span><span class="org-comment">!/bin/</span><span class="org-keyword">bash</span><span class="org-comment"> -e</span>
-<span class="org-comment-delimiter">#</span>
-<span class="org-comment-delimiter"># </span><span class="org-comment">DO NOT EDIT. This file was tangled from institute.org.</span>
-
+<a href="private/webupdate"><q>private/webupdate</q></a><pre class="src src-sh" id="org408edb7"><code><span class="org-comment-delimiter">#</span><span class="org-comment">!/bin/</span><span class="org-keyword">bash</span><span class="org-comment"> -e
+</span><span class="org-comment-delimiter">#</span><span class="org-comment">
+</span><span class="org-comment-delimiter"># </span><span class="org-comment">DO NOT EDIT.
+</span><span class="org-comment-delimiter">#</span><span class="org-comment">
+</span><span class="org-comment-delimiter"># </span><span class="org-comment">This file was tangled from a small institute's README.org.
+</span>
<span class="org-builtin">cd</span> /WWW/live/
rsync -avz --delete --chmod=g-w <span class="org-sh-escaped-newline">\</span>
<p>
The following tasks install the <q>webupdate</q> script from <a href="private/"><q>private/</q></a>,
and create Monkey's <code>cron</code> job. An example <q>webupdate</q> script is
-provided <a href="#orgbd0a740">here</a>.
+provided <a href="#org408edb7">here</a>.
</p>
<div class="org-src-container">
</div>
</div>
</div>
-<div id="outline-container-org081b4be" class="outline-3">
-<h3 id="org081b4be"><span class="section-number-3">8.20.</span> Configure Core WireGuard™ Interface</h3>
+<div id="outline-container-orge87b2b4" class="outline-3">
+<h3 id="orge87b2b4"><span class="section-number-3">8.20.</span> Configure Core WireGuard™ Interface</h3>
<div class="outline-text-3" id="text-8-20">
<p>
Core connects to Front's WireGuard™ service to provide members abroad
-with a route to the campus networks. As described in <a href="#org44edb94">Configure Public
+with a route to the campus networks. As described in <a href="#org25a022b">Configure Public
WireGuard™ Subnet</a> for Front, Core is expected to forward packets from/to the
private networks.
</p>
<span class="org-variable-name">Address</span> = 10.177.87.2
<span class="org-variable-name">PostUp</span> = wg set %i private-key /etc/wireguard/private-key
-<span class="org-comment-delimiter"># </span><span class="org-comment">Front</span>
-[<span class="org-type">Peer</span>]
+<span class="org-comment-delimiter"># </span><span class="org-comment">Front
+</span>[<span class="org-type">Peer</span>]
<span class="org-variable-name">EndPoint</span> = 192.168.15.5:39608
<span class="org-variable-name">PublicKey</span> = S+6HaTnOwwhWgUGXjSBcPAvifKw+j8BDTRfq534gNW4=
<span class="org-variable-name">AllowedIPs</span> = 10.177.87.1
<div class="org-src-container">
<a href="roles_t/core/tasks/main.yml"><q>roles_t/core/tasks/main.yml</q></a><pre class="src src-conf"><code>
+- name: Enable IP forwarding.
+ become: yes
+ sysctl:
+ name: net.ipv4.ip_forward
+ value: <span class="org-string">"1"</span>
+ state: present
+
- name: Install WireGuard™.
become: yes
<span class="org-variable-name">apt: pkg</span>=wireguard
group: root
notify: Restart WireGuard™.
-- name: Enable/Start WireGuard™ on boot.
+- name: Start WireGuard™.
become: yes
systemd:
service: wg-quick@wg0
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable WireGuard™.
+ become: yes
+ systemd:
+ service: wg-quick@wg0
+ enabled: yes
</code></pre>
</div>
systemd:
service: wg-quick@wg0
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org4d7fa4b" class="outline-3">
-<h3 id="org4d7fa4b"><span class="section-number-3">8.21.</span> Configure NAGIOS</h3>
+<div id="outline-container-org0a9da4e" class="outline-3">
+<h3 id="org0a9da4e"><span class="section-number-3">8.21.</span> Configure NAGIOS</h3>
<div class="outline-text-3" id="text-8-21">
<p>
Core runs a <code>nagios4</code> server to monitor "services" on institute hosts.
dest: /etc/nagios4/conf.d/institute.cfg
notify: Reload NAGIOS4.
-- name: Enable/Start NAGIOS4.
+- name: Start NAGIOS4.
become: yes
systemd:
service: nagios4
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable NAGIOS4.
+ become: yes
+ systemd:
+ service: nagios4
+ enabled: yes
</code></pre>
</div>
systemd:
service: nagios4
state: reloaded
+ tags: actualizer
</code></pre>
</div>
</div>
-<div id="outline-container-org03215b5" class="outline-4">
-<h4 id="org03215b5"><span class="section-number-4">8.21.1.</span> Configure NAGIOS Monitors for Core</h4>
+<div id="outline-container-orgfa72bea" class="outline-4">
+<h4 id="orgfa72bea"><span class="section-number-4">8.21.1.</span> Configure NAGIOS Monitors for Core</h4>
<div class="outline-text-4" id="text-8-21-1">
<p>
The first block in <q>nagios.cfg</q> specifies monitors for services on
</div>
</div>
</div>
-<div id="outline-container-orgce0fe2c" class="outline-4">
-<h4 id="orgce0fe2c"><span class="section-number-4">8.21.2.</span> Custom NAGIOS Monitor <code>inst_sensors</code></h4>
+<div id="outline-container-org5b3e3c7" class="outline-4">
+<h4 id="org5b3e3c7"><span class="section-number-4">8.21.2.</span> Custom NAGIOS Monitor <code>inst_sensors</code></h4>
<div class="outline-text-4" id="text-8-21-2">
<p>
The <code>check_sensors</code> plugin is included in the package
</p>
<div class="org-src-container">
-<a href="roles_t/core/files/inst_sensors"><q>roles_t/core/files/inst_sensors</q></a><pre class="src src-sh"><code><span class="org-comment-delimiter">#</span><span class="org-comment">!/bin/</span><span class="org-keyword">sh</span>
-
+<a href="roles_t/core/files/inst_sensors"><q>roles_t/core/files/inst_sensors</q></a><pre class="src src-sh"><code><span class="org-comment-delimiter">#</span><span class="org-comment">!/bin/</span><span class="org-keyword">sh</span><span class="org-comment">
+</span>
<span class="org-variable-name">PATH</span>=<span class="org-string">"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"</span>
<span class="org-builtin">export</span> PATH
<span class="org-variable-name">PROGNAME</span>=<span class="org-sh-quoted-exec">`basename $0`</span>
}
<span class="org-function-name">brief_data</span>() {
- <span class="org-builtin">echo</span> <span class="org-string">"$1"</span> | sed -n -E -e <span class="org-string">'</span>
-<span class="org-string"> /^ *Core [0-9]+:/ { s/^ *Core [0-9]+: +([-+]?[0-9.]+).*/ \1/; H }</span>
-<span class="org-string"> $ { x; s/\n//g; p }'</span>
+ <span class="org-builtin">echo</span> <span class="org-string">"$1"</span> | sed -n -E -e <span class="org-string">'
+ /^ *Core [0-9]+:/ { s/^ *Core [0-9]+: +([-+]?[0-9.]+).*/ \1/; H }
+ $ { x; s/\n//g; p }'</span>
}
<span class="org-keyword">case</span> <span class="org-string">"$1"</span><span class="org-keyword"> in</span>
</div>
</div>
</div>
-<div id="outline-container-orgce11bb4" class="outline-4">
-<h4 id="orgce11bb4"><span class="section-number-4">8.21.3.</span> Configure NAGIOS Monitors for Remote Hosts</h4>
+<div id="outline-container-orgb3ae2fd" class="outline-4">
+<h4 id="orgb3ae2fd"><span class="section-number-4">8.21.3.</span> Configure NAGIOS Monitors for Remote Hosts</h4>
<div class="outline-text-4" id="text-8-21-3">
<p>
The following sections contain code blocks specifying monitors for
commands are defined in code blocks interleaved with the blocks that
monitor them. The command blocks are appended to <q>nrpe.cfg</q> and the
monitoring blocks to <q>nagios.cfg</q>. The <q>nrpe.cfg</q> file is installed
-on each campus host by the campus role's <a href="#orgb8fd0fc">Configure NRPE</a> tasks.
+on each campus host by the campus role's <a href="#org8fbeb2b">Configure NRPE</a> tasks.
</p>
</div>
</div>
-<div id="outline-container-orgd224290" class="outline-4">
-<h4 id="orgd224290"><span class="section-number-4">8.21.4.</span> Configure NAGIOS Monitors for Gate</h4>
+<div id="outline-container-orgfb7572d" class="outline-4">
+<h4 id="orgfb7572d"><span class="section-number-4">8.21.4.</span> Configure NAGIOS Monitors for Gate</h4>
<div class="outline-text-4" id="text-8-21-4">
<p>
Define the monitored host, <code>gate</code>. Monitor its response to network
</div>
</div>
</div>
-<div id="outline-container-org2ae0e40" class="outline-3">
-<h3 id="org2ae0e40"><span class="section-number-3">8.22.</span> Configure Backups</h3>
+<div id="outline-container-orgb17f0e2" class="outline-3">
+<h3 id="orgb17f0e2"><span class="section-number-3">8.22.</span> Configure Backups</h3>
<div class="outline-text-3" id="text-8-22">
<p>
The following task installs the <q>backup</q> script from <a href="private/"><q>private/</q></a>. An
-example script is provided in <a href="#org2146981">here</a>.
+example script is provided in <a href="#org2d7d21c">here</a>.
</p>
<div class="org-src-container">
</div>
</div>
</div>
-<div id="outline-container-org7addaa6" class="outline-3">
-<h3 id="org7addaa6"><span class="section-number-3">8.23.</span> Configure Nextcloud</h3>
+<div id="outline-container-orga909c3b" class="outline-3">
+<h3 id="orga909c3b"><span class="section-number-3">8.23.</span> Configure Nextcloud</h3>
<div class="outline-text-3" id="text-8-23">
<p>
Core runs Nextcloud to provide a private institute cloud, as described
-in <a href="#orgc812cfe">The Cloud Service</a>. Installing, restoring (from backup), and
+in <a href="#orgdabefd7">The Cloud Service</a>. Installing, restoring (from backup), and
upgrading Nextcloud are manual processes documented in <a href="https://docs.nextcloud.com/server/latest/admin_manual/maintenance/">The Nextcloud
Admin Manual, Maintenance</a>. However Ansible can help prepare Core
before an install or restore, and perform basic security checks
afterwards.
</p>
</div>
-<div id="outline-container-orgb35e9d1" class="outline-4">
-<h4 id="orgb35e9d1"><span class="section-number-4">8.23.1.</span> Prepare Core For Nextcloud</h4>
+<div id="outline-container-org8276fb0" class="outline-4">
+<h4 id="org8276fb0"><span class="section-number-4">8.23.1.</span> Prepare Core For Nextcloud</h4>
<div class="outline-text-4" id="text-8-23-1">
<p>
The Ansible code contained herein prepares Core to run Nextcloud by
<Directory /var/www/html/>
<IfModule mod_rewrite.c>
RewriteEngine on
- <span class="org-comment-delimiter"># </span><span class="org-comment">LogLevel alert rewrite:trace3</span>
- RewriteRule ^\.well-known/carddav \
+ <span class="org-comment-delimiter"># </span><span class="org-comment">LogLevel alert rewrite:trace3
+</span> RewriteRule ^\.well-known/carddav \
<span class="org-variable-name">/nextcloud/remote.php/dav [R</span>=301,L]
RewriteRule ^\.well-known/caldav \
<span class="org-variable-name">/nextcloud/remote.php/dav [R</span>=301,L]
created manually.
</p>
-<p>
-The following task would work (<code>mysql_user</code> supports
-<code>check_implicit_admin</code>) <i>but</i> the <code>nextcloud</code> database was not created
-above. Thus both database and user are created manually, with SQL
-given in the <a href="#org8f9d1d3">8.23.5</a> subsection below, before <code>occ
-maintenance:install</code> can run.
-</p>
-
<div class="org-src-container">
<pre class="src src-conf"><code>
- name: Create Nextcloud DB user.
</code></pre>
</div>
+<p>
+The task above would work (<code>mysql_user</code> supports
+<code>check_implicit_admin</code>) <i>but</i> the <code>nextcloud</code> database was not created
+first. Thus both database and user are created manually, with the
+following SQL, before <code>occ maintenance:install</code> can run.
+</p>
+
+<div class="org-src-container">
+<pre class="src src-sql"><code><span class="org-keyword">create</span> database nextcloud
+ <span class="org-type">character</span> <span class="org-keyword">set</span> utf8mb4
+ <span class="org-keyword">collate</span> utf8mb4_general_ci;
+<span class="org-keyword">grant</span> <span class="org-keyword">all</span> <span class="org-keyword">on</span> nextcloud.*
+ <span class="org-keyword">to</span> <span class="org-string">'nextclouduser'</span>@<span class="org-string">'localhost'</span>
+ identified <span class="org-keyword">by</span> <span class="org-string">'ippAgmaygyobwyt5'</span>;
+flush <span class="org-keyword">privileges</span>;
+</code></pre>
+</div>
+
<p>
Finally, a symbolic link positions <q>/Nextcloud/nextcloud/</q> at
<q>/var/www/nextcloud/</q> as expected by the Apache2 configuration above.
</div>
</div>
</div>
-<div id="outline-container-org5646e22" class="outline-4">
-<h4 id="org5646e22"><span class="section-number-4">8.23.2.</span> Configure PHP</h4>
+<div id="outline-container-org827a6e0" class="outline-4">
+<h4 id="org827a6e0"><span class="section-number-4">8.23.2.</span> Configure PHP</h4>
<div class="outline-text-4" id="text-8-23-2">
<p>
The following tasks set a number of PHP parameters for better
</div>
</div>
</div>
-<div id="outline-container-orgcb7a84e" class="outline-4">
-<h4 id="orgcb7a84e"><span class="section-number-4">8.23.3.</span> Create <q>/Nextcloud/</q></h4>
+<div id="outline-container-orgd428b0f" class="outline-4">
+<h4 id="orgd428b0f"><span class="section-number-4">8.23.3.</span> Create <q>/Nextcloud/</q></h4>
<div class="outline-text-4" id="text-8-23-3">
<p>
The Ansible tasks up to this point have completed Core's LAMP stack
</div>
</div>
</div>
-<div id="outline-container-org5825d2f" class="outline-4">
-<h4 id="org5825d2f"><span class="section-number-4">8.23.4.</span> Restore Nextcloud</h4>
+<div id="outline-container-org0c72e46" class="outline-4">
+<h4 id="org0c72e46"><span class="section-number-4">8.23.4.</span> Restore Nextcloud</h4>
<div class="outline-text-4" id="text-8-23-4">
<p>
Restoring Nextcloud in the newly created <q>/Nextcloud/</q> presumably
The database is restored with the following commands, which assume the
last dump was made February 20th 2022 and thus was saved in
<q>/Nextcloud/20220220.bak</q>. The database will need to be
-created first as when installing Nextcloud. The appropriate SQL are
-given in <a href="#org8f9d1d3">Install Nextcloud</a> below.
+created first as when installing Nextcloud.
</p>
<div class="org-src-container">
<pre class="src src-sh"><code><span class="org-builtin">cd</span> /Nextcloud/
+sudo mysql
+create database nextcloud
+ character set utf8mb4
+ collate utf8mb4_general_ci;
+grant all on nextcloud.*
+ to <span class="org-string">'nextclouduser'</span>@<span class="org-string">'localhost'</span>
+ identified by <span class="org-string">'ippAgmaygyobwyt5'</span>;
+flush privileges;
+<span class="org-keyword">exit</span>;
sudo mysql --defaults-file=dbbackup.cnf nextcloud < 20220220.bak
<span class="org-builtin">cd</span> nextcloud/
sudo -u www-data php occ maintenance:data-fingerprint
</p>
</div>
</div>
-<div id="outline-container-org8f9d1d3" class="outline-4">
-<h4 id="org8f9d1d3"><span class="section-number-4">8.23.5.</span> Install Nextcloud</h4>
+<div id="outline-container-org0727aa7" class="outline-4">
+<h4 id="org0727aa7"><span class="section-number-4">8.23.5.</span> Install Nextcloud</h4>
<div class="outline-text-4" id="text-8-23-5">
<p>
Installing Nextcloud in the newly created <q>/Nextcloud/</q> starts with
</p>
</div>
</div>
-<div id="outline-container-org7bf8385" class="outline-4">
-<h4 id="org7bf8385"><span class="section-number-4">8.23.6.</span> Afterwards</h4>
+<div id="outline-container-orgdd1a3b6" class="outline-4">
+<h4 id="orgdd1a3b6"><span class="section-number-4">8.23.6.</span> Afterwards</h4>
<div class="outline-text-4" id="text-8-23-6">
<p>
Whether Nextcloud was restored or installed, there are a few things
</div>
</div>
</div>
-<div id="outline-container-orge255857" class="outline-2">
-<h2 id="orge255857"><span class="section-number-2">9.</span> The Gate Role</h2>
+<div id="outline-container-org14a3ff4" class="outline-2">
+<h2 id="org14a3ff4"><span class="section-number-2">9.</span> The Gate Role</h2>
<div class="outline-text-2" id="text-9">
<p>
The <code>gate</code> role configures the services expected at the campus gate:
access to the private Ethernet from the untrusted Ethernet (e.g. a
campus Wi-Fi AP) via VPN, and access to the Internet via NAT. The
-gate machine uses three network interfaces (see <a href="#org2e49760">The Gate Machine</a>)
+gate machine uses three network interfaces (see <a href="#orgd15e60d">The Gate Machine</a>)
configured with persistent names used in its firewall rules.
</p>
configurations, etc.
</p>
</div>
-<div id="outline-container-orgda5416e" class="outline-3">
-<h3 id="orgda5416e"><span class="section-number-3">9.1.</span> Include Particulars</h3>
+<div id="outline-container-orgc86b73c" class="outline-3">
+<h3 id="orgc86b73c"><span class="section-number-3">9.1.</span> Include Particulars</h3>
<div class="outline-text-3" id="text-9-1">
<p>
The following should be familiar boilerplate by now.
</div>
</div>
</div>
-<div id="outline-container-orgc353634" class="outline-3">
-<h3 id="orgc353634"><span class="section-number-3">9.2.</span> Configure Netplan <a id="orga9ce231"></a></h3>
+<div id="outline-container-orgd31a78c" class="outline-3">
+<h3 id="orgd31a78c"><span class="section-number-3">9.2.</span> Configure Netplan <a id="orgc350fb4"></a></h3>
<div class="outline-text-3" id="text-9-2">
<p>
Gate's network interfaces are configured using Netplan and two files.
- name: Apply netplan.
become: yes
command: netplan apply
+ tags: actualizer
</code></pre>
</div>
<p>
Note that the <q>60-isp.yaml</q> file is only updated (created) if it does
-not already exists, so that it can be easily modified to debug a new
+not already exist so that it can be easily modified to debug a new
campus ISP without interference from Ansible.
</p>
</div>
</div>
-<div id="outline-container-orgde42811" class="outline-3">
-<h3 id="orgde42811"><span class="section-number-3">9.3.</span> UFW Rules</h3>
+<div id="outline-container-orgfca1bef" class="outline-3">
+<h3 id="orgfca1bef"><span class="section-number-3">9.3.</span> UFW Rules</h3>
<div class="outline-text-3" id="text-9-3">
<p>
Gate uses the Uncomplicated FireWall (UFW) to install its packet
</p>
<div class="org-src-container">
-<code>ufw-nat</code><pre class="src src-conf" id="orgbeaf2b7"><code>-A POSTROUTING -s {{ private_net_cidr }} -o isp -j MASQUERADE
+<code>ufw-nat</code><pre class="src src-conf" id="orgb27bd6b"><code>-A POSTROUTING -s {{ private_net_cidr }} -o isp -j MASQUERADE
-A POSTROUTING -s {{ wild_net_cidr }} -o isp -j MASQUERADE
</code></pre>
</div>
</p>
<div class="org-src-container">
-<code>ufw-forward-nat</code><pre class="src src-conf" id="org865d896"><code>-A ufw-user-forward -i lan -o isp -j ACCEPT
+<code>ufw-forward-nat</code><pre class="src src-conf" id="org2e50ced"><code>-A ufw-user-forward -i lan -o isp -j ACCEPT
-A ufw-user-forward -i wild -o isp -j ACCEPT
</code></pre>
</div>
</p>
<div class="org-src-container">
-<code>ufw-forward-private</code><pre class="src src-conf" id="orgdd4db1f"><code>-A ufw-user-forward -i lan -o wg0 -j ACCEPT
+<code>ufw-forward-private</code><pre class="src src-conf" id="orge0c167b"><code>-A ufw-user-forward -i lan -o wg0 -j ACCEPT
-A ufw-user-forward -i wg0 -o lan -j ACCEPT
-A ufw-user-forward -i wg0 -o wg0 -j ACCEPT
</code></pre>
</p>
</div>
</div>
-<div id="outline-container-org98692b7" class="outline-3">
-<h3 id="org98692b7"><span class="section-number-3">9.4.</span> Configure UFW</h3>
+<div id="outline-container-orga4b4df7" class="outline-3">
+<h3 id="orga4b4df7"><span class="section-number-3">9.4.</span> Configure UFW</h3>
<div class="outline-text-3" id="text-9-4">
<p>
The following tasks install the Uncomplicated Firewall (UFW), set its
policy in <q>/etc/default/ufw</q>, install the NAT rules in
<q>/etc/ufw/before.rules</q>, and the Forward rules in
<q>/etc/ufw/user.rules</q> (where the <code>ufw-user-forward</code> chain
-is… mentioned?).
+is… mentioned?).
</p>
<p>
</div>
</div>
</div>
-<div id="outline-container-org3bc8c9a" class="outline-3">
-<h3 id="org3bc8c9a"><span class="section-number-3">9.5.</span> Configure DHCP For The Wild Ethernet</h3>
+<div id="outline-container-org15b077f" class="outline-3">
+<h3 id="org15b077f"><span class="section-number-3">9.5.</span> Configure DHCP For The Wild Ethernet</h3>
<div class="outline-text-3" id="text-9-5">
<p>
To accommodate commodity Wi-Fi access points, as well as wired IoT
dest: /etc/systemd/system/isc-dhcp-server.service.d/depend.conf
notify: Reload Systemd.
-- name: Enable/Start DHCP server.
+- name: Start DHCP server.
become: yes
systemd:
service: isc-dhcp-server
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable DHCP server.
+ become: yes
+ systemd:
+ service: isc-dhcp-server
+ enabled: yes
</code></pre>
</div>
systemd:
service: isc-dhcp-server
state: restarted
+ tags: actualizer
- name: Reload Systemd.
become: yes
systemd:
daemon-reload: yes
+ tags: actualizer
</code></pre>
</div>
</p>
</div>
</div>
-<div id="outline-container-orge0f6246" class="outline-3">
-<h3 id="orge0f6246"><span class="section-number-3">9.6.</span> Configure Campus WireGuard™ Subnet</h3>
+<div id="outline-container-orgaf8450e" class="outline-3">
+<h3 id="orgaf8450e"><span class="section-number-3">9.6.</span> Configure Campus WireGuard™ Subnet</h3>
<div class="outline-text-3" id="text-9-6">
<p>
Gate uses WireGuard™ to provide a campus VPN service. Gate's routes
</p>
<p>
-The following example <a href="#org433e524"><q>private/gate-wg0.conf</q></a> configuration recognizes
+The following example <a href="#org4542d41"><q>private/gate-wg0.conf</q></a> configuration recognizes
a wired IoT appliance, Dick's notebook and his replacement phone,
assigning them the host numbers 3, 4 and 6 respectively.
</p>
<div class="org-src-container">
-<q>private/gate-wg0.conf</q><pre class="src src-conf" id="org433e524"><code>[<span class="org-type">Interface</span>]
+<q>private/gate-wg0.conf</q><pre class="src src-conf" id="org4542d41"><code>[<span class="org-type">Interface</span>]
<span class="org-variable-name">Address</span> = 10.84.139.1/24
<span class="org-variable-name">ListenPort</span> = 51820
<span class="org-variable-name">PostUp</span> = wg set %i private-key /etc/wireguard/private-key
-<span class="org-comment-delimiter"># </span><span class="org-comment">thing</span>
-[<span class="org-type">Peer</span>]
+<span class="org-comment-delimiter"># </span><span class="org-comment">thing
+</span>[<span class="org-type">Peer</span>]
<span class="org-variable-name">PublicKey</span> = LdsCsgfjKCfd5+VKS+Q/dQhWO8NRNygByDO2VxbXlSQ=
<span class="org-variable-name">AllowedIPs</span> = 10.84.139.3
-<span class="org-comment-delimiter"># </span><span class="org-comment">dick</span>
-[<span class="org-type">Peer</span>]
+<span class="org-comment-delimiter"># </span><span class="org-comment">dick
+</span>[<span class="org-type">Peer</span>]
<span class="org-variable-name">PublicKey</span> = 4qd4xdRztZBKhFrX9jI/b4fnMzpKQ5qhg691hwYSsX8=
<span class="org-variable-name">AllowedIPs</span> = 10.84.139.4
-<span class="org-comment-delimiter"># </span><span class="org-comment">dicks-razr</span>
-[<span class="org-type">Peer</span>]
+<span class="org-comment-delimiter"># </span><span class="org-comment">dicks-razr
+</span>[<span class="org-type">Peer</span>]
<span class="org-variable-name">PublicKey</span> = zho0qMxoLclJSQu4GeJEcMkk0hx4Q047OcNc8vOejVw=
<span class="org-variable-name">AllowedIPs</span> = 10.84.139.6
</code></pre>
<span class="org-variable-name">DNS</span> = 192.168.56.1
<span class="org-variable-name">Domain</span> = small.private
-<span class="org-comment-delimiter"># </span><span class="org-comment">Gate</span>
-[<span class="org-type">Peer</span>]
+<span class="org-comment-delimiter"># </span><span class="org-comment">Gate
+</span>[<span class="org-type">Peer</span>]
<span class="org-variable-name">EndPoint</span> = 192.168.57.1:51820
<span class="org-variable-name">PublicKey</span> = y3cjFnvQbylmH4lGTujpqc8rusIElmJ4Gu9hh6iR7QI=
<span class="org-variable-name">AllowedIPs</span> = 10.84.139.1
<span class="org-variable-name">PostUp</span> = resolvectl dns wg0 192.168.56.1
<span class="org-variable-name">PostUp</span> = resolvectl domain wg0 small.private
-<span class="org-comment-delimiter"># </span><span class="org-comment">Gate</span>
-[<span class="org-type">Peer</span>]
+<span class="org-comment-delimiter"># </span><span class="org-comment">Gate
+</span>[<span class="org-type">Peer</span>]
<span class="org-variable-name">EndPoint</span> = 192.168.57.1:51820
<span class="org-variable-name">PublicKey</span> = y3cjFnvQbylmH4lGTujpqc8rusIElmJ4Gu9hh6iR7QI=
<span class="org-variable-name">AllowedIPs</span> = 10.84.139.1
<p>
The following tasks install WireGuard™, configure it with
-<a href="#org433e524"><q>private/gate-wg0.conf</q></a>, and enable the service.
+<a href="#org4542d41"><q>private/gate-wg0.conf</q></a>, and enable the service.
</p>
<div class="org-src-container">
<a href="roles_t/gate/tasks/main.yml"><q>roles_t/gate/tasks/main.yml</q></a><pre class="src src-conf"><code>
+- name: Enable IP forwarding.
+ become: yes
+ sysctl:
+ name: net.ipv4.ip_forward
+ value: <span class="org-string">"1"</span>
+ state: present
+
- name: Install WireGuard™.
become: yes
<span class="org-variable-name">apt: pkg</span>=wireguard
group: root
notify: Restart WireGuard™.
-- name: Enable/Start WireGuard™ on boot.
+- name: Start WireGuard™.
become: yes
systemd:
service: wg-quick@wg0
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable WireGuard™.
+ become: yes
+ systemd:
+ service: wg-quick@wg0
+ enabled: yes
</code></pre>
</div>
systemd:
service: wg-quick@wg0
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
</div>
-<div id="outline-container-org9e3146e" class="outline-2">
-<h2 id="org9e3146e"><span class="section-number-2">10.</span> The Campus Role</h2>
+<div id="outline-container-orga5f3889" class="outline-2">
+<h2 id="orga5f3889"><span class="section-number-2">10.</span> The Campus Role</h2>
<div class="outline-text-2" id="text-10">
<p>
The <code>campus</code> role configures generic campus server machines: network
client</code> command which updates the WireGuard™ configuration on Gate.
</p>
</div>
-<div id="outline-container-org327e633" class="outline-3">
-<h3 id="org327e633"><span class="section-number-3">10.1.</span> Include Particulars</h3>
+<div id="outline-container-orgd055671" class="outline-3">
+<h3 id="orgd055671"><span class="section-number-3">10.1.</span> Include Particulars</h3>
<div class="outline-text-3" id="text-10-1">
<p>
The following should be familiar boilerplate by now.
</div>
</div>
</div>
-<div id="outline-container-org10731bc" class="outline-3">
-<h3 id="org10731bc"><span class="section-number-3">10.2.</span> Configure Hostname</h3>
+<div id="outline-container-org5d48bf9" class="outline-3">
+<h3 id="org5d48bf9"><span class="section-number-3">10.2.</span> Configure Hostname</h3>
<div class="outline-text-3" id="text-10-2">
<p>
Clients should be using the expected host name.
become: yes
command: hostname -F /etc/hostname
<span class="org-variable-name">when: inventory_hostname !</span>= ansible_hostname
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org30b882e" class="outline-3">
-<h3 id="org30b882e"><span class="section-number-3">10.3.</span> Configure Systemd Timesyncd</h3>
+<div id="outline-container-org4f4ef3b" class="outline-3">
+<h3 id="org4f4ef3b"><span class="section-number-3">10.3.</span> Configure Systemd Timesyncd</h3>
<div class="outline-text-3" id="text-10-3">
<p>
The institute uses a common time reference throughout the campus.
systemd:
service: systemd-timesyncd
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org5189475" class="outline-3">
-<h3 id="org5189475"><span class="section-number-3">10.4.</span> Add Administrator to System Groups</h3>
+<div id="outline-container-org272888b" class="outline-3">
+<h3 id="org272888b"><span class="section-number-3">10.4.</span> Add Administrator to System Groups</h3>
<div class="outline-text-3" id="text-10-4">
<p>
The administrator often needs to read (directories of) log files owned
</div>
</div>
</div>
-<div id="outline-container-org15ed633" class="outline-3">
-<h3 id="org15ed633"><span class="section-number-3">10.5.</span> Install Unattended Upgrades</h3>
+<div id="outline-container-org271c98d" class="outline-3">
+<h3 id="org271c98d"><span class="section-number-3">10.5.</span> Install Unattended Upgrades</h3>
<div class="outline-text-3" id="text-10-5">
<p>
The institute prefers to install security updates as soon as possible.
</div>
</div>
</div>
-<div id="outline-container-orgf622be7" class="outline-3">
-<h3 id="orgf622be7"><span class="section-number-3">10.6.</span> Configure Postfix on Campus</h3>
+<div id="outline-container-org8b747af" class="outline-3">
+<h3 id="org8b747af"><span class="section-number-3">10.6.</span> Configure Postfix on Campus</h3>
<div class="outline-text-3" id="text-10-6">
<p>
The Postfix settings used by the campus include message size, queue
- { p: inet_interfaces, v: loopback-only }
notify: Restart Postfix.
-- name: Enable/Start Postfix.
+- name: Start Postfix.
become: yes
systemd:
service: postfix
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable Postfix.
+ become: yes
+ systemd:
+ service: postfix
+ enabled: yes
</code></pre>
</div>
systemd:
service: postfix
state: restarted
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org1b69146" class="outline-3">
-<h3 id="org1b69146"><span class="section-number-3">10.7.</span> Set Domain Name</h3>
+<div id="outline-container-orgc829e66" class="outline-3">
+<h3 id="orgc829e66"><span class="section-number-3">10.7.</span> Set Domain Name</h3>
<div class="outline-text-3" id="text-10-7">
<p>
The host's fully qualified (private) domain name (FQDN) is set by an
</div>
</div>
</div>
-<div id="outline-container-orgb8fd0fc" class="outline-3">
-<h3 id="orgb8fd0fc"><span class="section-number-3">10.8.</span> Configure NRPE</h3>
+<div id="outline-container-org8fbeb2b" class="outline-3">
+<h3 id="org8fbeb2b"><span class="section-number-3">10.8.</span> Configure NRPE</h3>
<div class="outline-text-3" id="text-10-8">
<p>
Each campus host runs an NRPE (a NAGIOS Remote Plugin Executor)
server so that the NAGIOS4 server on Core can collect statistics. The
-NAGIOS service is discussed in the <a href="#orgb8fd0fc">Configure NRPE</a> section of <a href="#orgfb09fcf">The Core
+NAGIOS service is discussed in the <a href="#org8fbeb2b">Configure NRPE</a> section of <a href="#orgc29541b">The Core
Role</a>.
</p>
dest: /etc/nagios/nrpe.d/institute.cfg
notify: Reload NRPE server.
-- name: Enable/Start NRPE server.
+- name: Start NRPE server.
become: yes
systemd:
service: nagios-nrpe-server
- enabled: yes
state: started
+ tags: actualizer
+
+- name: Enable NRPE server.
+ become: yes
+ systemd:
+ service: nagios-nrpe-server
+ enabled: yes
</code></pre>
</div>
systemd:
service: nagios-nrpe-server
state: reloaded
+ tags: actualizer
</code></pre>
</div>
</div>
</div>
</div>
-<div id="outline-container-orgafb80a0" class="outline-2">
-<h2 id="orgafb80a0"><span class="section-number-2">11.</span> The Ansible Configuration</h2>
+<div id="outline-container-orgb216592" class="outline-2">
+<h2 id="orgb216592"><span class="section-number-2">11.</span> The Ansible Configuration</h2>
<div class="outline-text-2" id="text-11">
<p>
The small institute uses Ansible to maintain the configuration of its
role(s) to each host. Examples of these files are included here, and
are used to test the roles. The example configuration applies the
institutional roles to VirtualBox machines prepared according to
-chapter <a href="#orgf67ef54">Testing</a>.
+chapter <a href="#org903c8fd">Testing</a>.
</p>
<p>
separate revision history.
</p>
</div>
-<div id="outline-container-org7a6eff2" class="outline-3">
-<h3 id="org7a6eff2"><span class="section-number-3">11.1.</span> <q>ansible.cfg</q></h3>
+<div id="outline-container-orgfb79873" class="outline-3">
+<h3 id="orgfb79873"><span class="section-number-3">11.1.</span> <q>ansible.cfg</q></h3>
<div class="outline-text-3" id="text-11-1">
<p>
The Ansible configuration file <a href="ansible.cfg"><q>ansible.cfg</q></a> contains just a handful
of settings, some included just to create a test jig as described in
-<a href="#orgf67ef54">Testing</a>.
+<a href="#org903c8fd">Testing</a>.
</p>
<ul class="org-ul">
that Python 3 can be expected on all institute hosts.</li>
<li><code>vault_password_file</code> is set to suppress prompts for the vault
password. The institute keeps its vault password in <a href="Secret/"><q>Secret/</q></a> (as
-described in <a href="#orgbd49b65">Keys</a>) and thus sets this parameter to
+described in <a href="#orgaf187bb">Keys</a>) and thus sets this parameter to
<a href="Secret/vault-password"><q>Secret/vault-password</q></a>.</li>
<li><code>inventory</code> is set to avoid specifying it on the command line.</li>
<li><code>roles_path</code> is set to the recently tangled roles files in
</div>
</div>
</div>
-<div id="outline-container-orged29d65" class="outline-3">
-<h3 id="orged29d65"><span class="section-number-3">11.2.</span> <q>hosts</q></h3>
+<div id="outline-container-orgd3555e3" class="outline-3">
+<h3 id="orgd3555e3"><span class="section-number-3">11.2.</span> <q>hosts</q></h3>
<div class="outline-text-3" id="text-11-2">
<p>
The Ansible inventory file <a href="hosts"><q>hosts</q></a> describes all of the institute's
</p>
<div class="org-src-container">
-<a href="hosts"><q>hosts</q></a><pre class="src src-conf" id="org1906017"><code>all:
+<a href="hosts"><q>hosts</q></a><pre class="src src-conf" id="orgac2939a"><code>all:
vars:
ansible_user: sysadm
ansible_ssh_extra_args: -i Secret/ssh_admin/id_rsa
</p>
</div>
</div>
-<div id="outline-container-org11b7c97" class="outline-3">
-<h3 id="org11b7c97"><span class="section-number-3">11.3.</span> <q>playbooks/site.yml</q></h3>
+<div id="outline-container-orgaa4f421" class="outline-3">
+<h3 id="orgaa4f421"><span class="section-number-3">11.3.</span> <q>playbooks/site.yml</q></h3>
<div class="outline-text-3" id="text-11-3">
<p>
The example <a href="playbooks/site.yml"><q>playbooks/site.yml</q></a> playbook (below) applies the
</div>
</div>
</div>
-<div id="outline-container-orge644910" class="outline-3">
-<h3 id="orge644910"><span class="section-number-3">11.4.</span> <q>Secret/vault-password</q></h3>
+<div id="outline-container-orgd48be68" class="outline-3">
+<h3 id="orgd48be68"><span class="section-number-3">11.4.</span> <q>Secret/vault-password</q></h3>
<div class="outline-text-3" id="text-11-4">
<p>
As already mentioned, the small institute keeps its Ansible vault
</p>
<div class="org-src-container">
-<a href="Secret/vault-password"><q>Secret/vault-password</q></a><pre class="src src-conf" id="org9eaaa94"><code>alitysortstagess
+<a href="Secret/vault-password"><q>Secret/vault-password</q></a><pre class="src src-conf" id="org861cd41"><code>alitysortstagess
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-orgc683a90" class="outline-3">
-<h3 id="orgc683a90"><span class="section-number-3">11.5.</span> Creating A Working Ansible Configuration</h3>
+<div id="outline-container-org10e919d" class="outline-3">
+<h3 id="org10e919d"><span class="section-number-3">11.5.</span> Creating A Working Ansible Configuration</h3>
<div class="outline-text-3" id="text-11-5">
<p>
A working Ansible configuration can be "tangled" from this document to
-produce the test configuration described in the <a href="#orgf67ef54">Testing</a> chapter. The
+produce the test configuration described in the <a href="#org903c8fd">Testing</a> chapter. The
tangling is done by Emacs's <code>org-babel-tangle</code> function and has
already been performed with the resulting tangle included in the
distribution with this document.
<q>public/</q> and <q>private/</q>.</li>
<li><q>~/net/Secret</q> would be a symbolic link to the (auto-mounted?)
location of the administrator's encrypted USB drive, as described in
-section <a href="#orgbd49b65">Keys</a>.</li>
+section <a href="#orgaf187bb">Keys</a>.</li>
</ul>
<p>
</div>
</div>
</div>
-<div id="outline-container-org38c4a10" class="outline-3">
-<h3 id="org38c4a10"><span class="section-number-3">11.6.</span> Maintaining A Working Ansible Configuration</h3>
+<div id="outline-container-org9fb522d" class="outline-3">
+<h3 id="org9fb522d"><span class="section-number-3">11.6.</span> Maintaining A Working Ansible Configuration</h3>
<div class="outline-text-3" id="text-11-6">
<p>
The Ansible roles currently tangle into the <a href="roles_t/"><q>roles_t/</q></a> directory to
</div>
</div>
</div>
-<div id="outline-container-org935ef4b" class="outline-2">
-<h2 id="org935ef4b"><span class="section-number-2">12.</span> The Institute Commands</h2>
+<div id="outline-container-org79b145a" class="outline-2">
+<h2 id="org79b145a"><span class="section-number-2">12.</span> The Institute Commands</h2>
<div class="outline-text-2" id="text-12">
<p>
The institute's administrator uses a convenience script to reliably
to get their defaults from <q>./ansible.cfg</q>.
</p>
</div>
-<div id="outline-container-org475c61d" class="outline-3">
-<h3 id="org475c61d"><span class="section-number-3">12.1.</span> Sub-command Blocks</h3>
+<div id="outline-container-orgcd24db3" class="outline-3">
+<h3 id="orgcd24db3"><span class="section-number-3">12.1.</span> Sub-command Blocks</h3>
<div class="outline-text-3" id="text-12-1">
<p>
The code blocks in this chapter tangle into the <a href="inst"><q>inst</q></a> script. Each
</p>
<div class="org-src-container">
-<a href="inst"><q>inst</q></a><pre class="src src-perl"><code><span class="org-comment-delimiter">#</span><span class="org-comment">!/usr/bin/perl -w</span>
-<span class="org-comment-delimiter">#</span>
-<span class="org-comment-delimiter"># </span><span class="org-comment">DO NOT EDIT. This file was tangled from an institute.org file.</span>
-
+<a href="inst"><q>inst</q></a><pre class="src src-perl"><code><span class="org-comment-delimiter">#</span><span class="org-comment">!/usr/bin/perl -w
+</span><span class="org-comment-delimiter">#</span><span class="org-comment">
+</span><span class="org-comment-delimiter"># </span><span class="org-comment">DO NOT EDIT.
+</span><span class="org-comment-delimiter">#</span><span class="org-comment">
+</span><span class="org-comment-delimiter"># </span><span class="org-comment">This file was tangled from a small institute's README.org.
+</span>
<span class="org-keyword">use</span> <span class="org-constant">strict</span>;
<span class="org-keyword">use</span> <span class="org-constant">IO::File</span>;
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-org888b543" class="outline-3">
-<h3 id="org888b543"><span class="section-number-3">12.2.</span> Sanity Check</h3>
+<div id="outline-container-orgecb1e8e" class="outline-3">
+<h3 id="orgecb1e8e"><span class="section-number-3">12.2.</span> Sanity Check</h3>
<div class="outline-text-3" id="text-12-2">
<p>
The next code block does not implement a sub-command; it implements
</div>
</div>
</div>
-<div id="outline-container-org6873e12" class="outline-3">
-<h3 id="org6873e12"><span class="section-number-3">12.3.</span> Importing Ansible Variables</h3>
+<div id="outline-container-orge20f4ad" class="outline-3">
+<h3 id="orge20f4ad"><span class="section-number-3">12.3.</span> Importing Ansible Variables</h3>
<div class="outline-text-3" id="text-12-3">
<p>
To ensure that Ansible and <code>./inst</code> are sympatico vis-a-vi certain
</table>
</div>
</div>
-<div id="outline-container-org2dc18d3" class="outline-3">
-<h3 id="org2dc18d3"><span class="section-number-3">12.4.</span> The CA Command</h3>
+<div id="outline-container-org274b741" class="outline-3">
+<h3 id="org274b741"><span class="section-number-3">12.4.</span> The CA Command</h3>
<div class="outline-text-3" id="text-12-4">
<p>
The next code block implements the <code>CA</code> sub-command, which creates a
umask 077;
mysystem <span class="org-string">"cd Secret/CA; ./easyrsa init-pki"</span>;
mysystem <span class="org-string">"cd Secret/CA; ./easyrsa build-ca nopass"</span>;
- <span class="org-comment"># Common Name: small.example.org</span>
-
+ <span class="org-comment"># Common Name: small.example.org
+</span>
<span class="org-keyword">my</span> $<span class="org-variable-name">dom</span> = $<span class="org-variable-name">domain_name</span>;
<span class="org-keyword">my</span> $<span class="org-variable-name">pvt</span> = $<span class="org-variable-name">domain_priv</span>;
mysystem <span class="org-string">"cd Secret/CA; ./easyrsa build-server-full $dom nopass"</span>;
</div>
</div>
</div>
-<div id="outline-container-org93205f9" class="outline-3">
-<h3 id="org93205f9"><span class="section-number-3">12.5.</span> The Config Command</h3>
+<div id="outline-container-org2b03642" class="outline-3">
+<h3 id="org2b03642"><span class="section-number-3">12.5.</span> The Config Command</h3>
<div class="outline-text-3" id="text-12-5">
<p>
The next code block implements the <code>config</code> sub-command, which
</div>
</div>
</div>
-<div id="outline-container-org8ec1044" class="outline-3">
-<h3 id="org8ec1044"><span class="section-number-3">12.6.</span> Account Management</h3>
+<div id="outline-container-org80f2e68" class="outline-3">
+<h3 id="org80f2e68"><span class="section-number-3">12.6.</span> Account Management</h3>
<div class="outline-text-3" id="text-12-6">
<p>
For general information about members and their Unix accounts, see
-<a href="#orge444ccb">Accounts</a>. The account management sub-commands maintain a mapping
+<a href="#org56d4f14">Accounts</a>. The account management sub-commands maintain a mapping
associating member "usernames" (Unix account names) with their
records. The mapping is stored among other things in
<q>private/members.yml</q> as the value associated with the key <code>members</code>.
<span class="org-keyword">my</span> $<span class="org-variable-name">old_umask</span> = umask 077;
<span class="org-keyword">my</span> $<span class="org-variable-name">path</span> = <span class="org-string">"private/members.yml"</span>;
print <span class="org-string">"$path: "</span>; STDOUT->flush;
- <span class="org-keyword">eval</span> { <span class="org-comment">#DumpFile ("$path.tmp", $yaml);</span>
- dump_members_yaml (<span class="org-string">"$path.tmp"</span>, $<span class="org-variable-name">yaml</span>);
+ <span class="org-keyword">eval</span> { <span class="org-comment">#DumpFile ("$path.tmp", $yaml);
+</span> dump_members_yaml (<span class="org-string">"$path.tmp"</span>, $<span class="org-variable-name">yaml</span>);
rename (<span class="org-string">"$path.tmp"</span>, $<span class="org-variable-name">path</span>)
or <span class="org-keyword">die</span> <span class="org-string">"Could not rename $path.tmp: $!\n"</span>; };
<span class="org-keyword">my</span> $<span class="org-variable-name">err</span> = $@;
</div>
</div>
</div>
-<div id="outline-container-org87951a6" class="outline-3">
-<h3 id="org87951a6"><span class="section-number-3">12.7.</span> The New Command</h3>
+<div id="outline-container-org3b09346" class="outline-3">
+<h3 id="org3b09346"><span class="section-number-3">12.7.</span> The New Command</h3>
<div class="outline-text-3" id="text-12-7">
<p>
The next code block implements the <code>new</code> sub-command. It adds a new
</div>
</div>
</div>
-<div id="outline-container-org9d93ecc" class="outline-3">
-<h3 id="org9d93ecc"><span class="section-number-3">12.8.</span> The Pass Command</h3>
+<div id="outline-container-org951ebee" class="outline-3">
+<h3 id="org951ebee"><span class="section-number-3">12.8.</span> The Pass Command</h3>
<div class="outline-text-3" id="text-12-8">
<p>
The institute's <code>passwd</code> command on Core securely emails <code>root</code> with a
message is sent to <code>member@core</code>.
</p>
</div>
-<div id="outline-container-orgaed955e" class="outline-4">
-<h4 id="orgaed955e"><span class="section-number-4">12.8.1.</span> Less Aggressive passwd.</h4>
+<div id="outline-container-org7a29d69" class="outline-4">
+<h4 id="org7a29d69"><span class="section-number-4">12.8.1.</span> Less Aggressive passwd.</h4>
<div class="outline-text-4" id="text-12-8-1">
<p>
The next code block implements the less aggressive <code>passwd</code> command.
</p>
<div class="org-src-container">
-<a href="roles_t/core/templates/passwd"><q>roles_t/core/templates/passwd</q></a><pre class="src src-perl"><code><span class="org-comment-delimiter">#</span><span class="org-comment">!/bin/perl -wT</span>
-
+<a href="roles_t/core/templates/passwd"><q>roles_t/core/templates/passwd</q></a><pre class="src src-perl"><code><span class="org-comment-delimiter">#</span><span class="org-comment">!/bin/perl -wT
+</span>
<span class="org-keyword">use</span> <span class="org-constant">strict</span>;
$<span class="org-variable-name">ENV</span>{PATH} = <span class="org-string">"/usr/sbin:/usr/bin:/bin"</span>;
open $<span class="org-variable-name">O</span>, (<span class="org-string">"| gpg --encrypt --armor"</span>
.<span class="org-string">" --trust-model always --recipient root\@core"</span>
.<span class="org-string">" > $tmp"</span>) or <span class="org-keyword">die</span> <span class="org-string">"Error running gpg > $tmp: $!\n"</span>;
-print $<span class="org-variable-name">O</span> <<EOD;
-<span class="org-perl-heredoc">username: $username</span>
-<span class="org-perl-heredoc">password: $epass</span>
-<span class="org-perl-heredoc">EOD</span>
-close $<span class="org-variable-name">O</span> or <span class="org-keyword">die</span> <span class="org-string">"Error closing pipe to gpg: $!\n"</span>;
+print $<span class="org-variable-name">O</span> <<EOD;<span class="org-perl-heredoc">
+username: $username
+password: $epass
+EOD
+</span>close $<span class="org-variable-name">O</span> or <span class="org-keyword">die</span> <span class="org-string">"Error closing pipe to gpg: $!\n"</span>;
<span class="org-keyword">use</span> <span class="org-constant">File::Copy</span>;
open ($<span class="org-variable-name">O</span>, <span class="org-string">"| sendmail root"</span>);
-print $<span class="org-variable-name">O</span> <<EOD;
-<span class="org-perl-heredoc">From: root</span>
-<span class="org-perl-heredoc">To: root</span>
-<span class="org-perl-heredoc">Subject: New password.</span>
+print $<span class="org-variable-name">O</span> <<EOD;<span class="org-perl-heredoc">
+From: root
+To: root
+Subject: New password.
-<span class="org-perl-heredoc">EOD</span>
-$<span class="org-variable-name">O</span>->flush;
+EOD
+</span>$<span class="org-variable-name">O</span>->flush;
copy $<span class="org-variable-name">tmp</span>, $<span class="org-variable-name">O</span>;
-<span class="org-comment-delimiter">#</span><span class="org-comment">print $O `cat $tmp`;</span>
-close $<span class="org-variable-name">O</span> or <span class="org-keyword">die</span> <span class="org-string">"Error closing pipe to sendmail: $!\n"</span>;
+<span class="org-comment-delimiter">#</span><span class="org-comment">print $O `cat $tmp`;
+</span>close $<span class="org-variable-name">O</span> or <span class="org-keyword">die</span> <span class="org-string">"Error closing pipe to sendmail: $!\n"</span>;
-print <span class="org-string">"</span>
-<span class="org-string">Your request was sent to Root. PLEASE WAIT for email confirmation</span>
-<span class="org-string">that the change was completed.\n"</span>;
+print <span class="org-string">"
+Your request was sent to Root. PLEASE WAIT for email confirmation
+that the change was completed.\n"</span>;
<span class="org-keyword">exit</span>;
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-orgc9aa9a5" class="outline-4">
-<h4 id="orgc9aa9a5"><span class="section-number-4">12.8.2.</span> Less Aggressive Pass Command</h4>
+<div id="outline-container-orga0fd5ab" class="outline-4">
+<h4 id="orga0fd5ab"><span class="section-number-4">12.8.2.</span> Less Aggressive Pass Command</h4>
<div class="outline-text-4" id="text-12-8-2">
<p>
The following code block implements the <code>./inst pass</code> command, used by
<span class="org-keyword">my</span> $<span class="org-variable-name">O</span> = new IO::File;
open ($<span class="org-variable-name">O</span>, <span class="org-string">"| sendmail $user\@$domain_priv"</span>)
or <span class="org-keyword">die</span> <span class="org-string">"Could not pipe to sendmail: $!\n"</span>;
- print $<span class="org-variable-name">O</span> <span class="org-string">"From: <root></span>
-<span class="org-string">To: <$user></span>
-<span class="org-string">Subject: Password change.</span>
+ print $<span class="org-variable-name">O</span> <span class="org-string">"From: <root>
+To: <$user>
+Subject: Password change.
-<span class="org-string">Your new password has been distributed to the servers.</span>
+Your new password has been distributed to the servers.
-<span class="org-string">As always: please email root with any questions or concerns.\n"</span>;
+As always: please email root with any questions or concerns.\n"</span>;
close $<span class="org-variable-name">O</span> or <span class="org-keyword">die</span> <span class="org-string">"pipe to sendmail failed: $!\n"</span>;
<span class="org-keyword">exit</span>;
}
</div>
</div>
</div>
-<div id="outline-container-org4c2403c" class="outline-4">
-<h4 id="org4c2403c"><span class="section-number-4">12.8.3.</span> Installing the Less Aggressive passwd</h4>
+<div id="outline-container-orgf5775d1" class="outline-4">
+<h4 id="orgf5775d1"><span class="section-number-4">12.8.3.</span> Installing the Less Aggressive passwd</h4>
<div class="outline-text-4" id="text-12-8-3">
<p>
The following Ansible tasks install the less aggressive <code>passwd</code>
</div>
</div>
</div>
-<div id="outline-container-orgc5d5072" class="outline-3">
-<h3 id="orgc5d5072"><span class="section-number-3">12.9.</span> The Old Command</h3>
+<div id="outline-container-orgb3a237e" class="outline-3">
+<h3 id="orgb3a237e"><span class="section-number-3">12.9.</span> The Old Command</h3>
<div class="outline-text-3" id="text-12-9">
<p>
The <code>old</code> command disables a member's account (and thus their clients).
</div>
</div>
</div>
-<div id="outline-container-org394328e" class="outline-3">
-<h3 id="org394328e"><span class="section-number-3">12.10.</span> The Client Command</h3>
+<div id="outline-container-org6edab5b" class="outline-3">
+<h3 id="org6edab5b"><span class="section-number-3">12.10.</span> The Client Command</h3>
<div class="outline-text-3" id="text-12-10">
<p>
The <code>client</code> command registers the public key of a client wishing to
<span class="org-keyword">die</span> <span class="org-string">"$user: does not exist\n"</span>
<span class="org-keyword">if</span> !defined $<span class="org-variable-name">member</span> && $<span class="org-variable-name">type</span> ne <span class="org-string">"campus"</span>;
- <span class="org-keyword">my</span> @<span class="org-perl-non-scalar-variable">campus_peers</span> <span class="org-comment"># [ name, hostnum, type, pubkey, user|"" ]</span>
- = map { [ (split <span class="org-string">/ /</span>), <span class="org-string">""</span> ] } @{$<span class="org-variable-name">yaml</span>->{<span class="org-string">"clients"</span>}};
+ <span class="org-keyword">my</span> @<span class="org-perl-non-scalar-variable">campus_peers</span> <span class="org-comment"># [ name, hostnum, type, pubkey, user|"" ]
+</span> = map { [ (split <span class="org-string">/ /</span>), <span class="org-string">""</span> ] } @{$<span class="org-variable-name">yaml</span>->{<span class="org-string">"clients"</span>}};
<span class="org-keyword">my</span> @<span class="org-perl-non-scalar-variable">member_peers</span> = ();
<span class="org-keyword">for</span> <span class="org-keyword">my</span> $<span class="org-variable-name">u</span> (sort keys %$<span class="org-variable-name">members</span>) {
}
<span class="org-keyword">my</span> $<span class="org-variable-name">core_wg_addr</span> = hostnum_to_ipaddr (2, $<span class="org-variable-name">public_wg_net_cidr</span>);
- <span class="org-keyword">my</span> $<span class="org-variable-name">extra_front_config</span> = <span class="org-string">"</span>
-<span class="org-string">PostUp = resolvectl dns %i $core_addr</span>
-<span class="org-string">PostUp = resolvectl domain %i $domain_priv</span>
-
-<span class="org-string"># Core</span>
-<span class="org-string">[Peer]</span>
-<span class="org-string">PublicKey = $core_wg_pubkey</span>
-<span class="org-string">AllowedIPs = $core_wg_addr</span>
-<span class="org-string">AllowedIPs = $private_net_cidr</span>
-<span class="org-string">AllowedIPs = $wild_net_cidr</span>
-<span class="org-string">AllowedIPs = $campus_wg_net_cidr\n"</span>;
+ <span class="org-keyword">my</span> $<span class="org-variable-name">extra_front_config</span> = <span class="org-string">"
+PostUp = resolvectl dns %i $core_addr
+PostUp = resolvectl domain %i $domain_priv
+
+# Core
+[Peer]
+PublicKey = $core_wg_pubkey
+AllowedIPs = $core_wg_addr
+AllowedIPs = $private_net_cidr
+AllowedIPs = $wild_net_cidr
+AllowedIPs = $campus_wg_net_cidr\n"</span>;
write_wg_server (<span class="org-string">"private/front-wg0.conf"</span>, \@<span class="org-perl-non-scalar-variable">member_peers</span>,
hostnum_to_ipaddr_cidr (1, $<span class="org-variable-name">public_wg_net_cidr</span>),
<span class="org-keyword">my</span> ($<span class="org-variable-name">file</span>, $<span class="org-variable-name">peers</span>, $<span class="org-variable-name">addr_cidr</span>, $<span class="org-variable-name">port</span>, $<span class="org-variable-name">extra</span>) = @<span class="org-perl-non-scalar-variable">_</span>;
<span class="org-keyword">my</span> $<span class="org-variable-name">O</span> = new IO::File;
open ($<span class="org-variable-name">O</span>, <span class="org-string">">$file.tmp"</span>) or <span class="org-keyword">die</span> <span class="org-string">"Could not open $file.tmp: $!\n"</span>;
- print $<span class="org-variable-name">O</span> <span class="org-string">"[Interface]</span>
-<span class="org-string">Address = $addr_cidr</span>
-<span class="org-string">ListenPort = $port</span>
-<span class="org-string">PostUp = wg set %i private-key /etc/wireguard/private-key$extra"</span>;
+ print $<span class="org-variable-name">O</span> <span class="org-string">"[Interface]
+Address = $addr_cidr
+ListenPort = $port
+PostUp = wg set %i private-key /etc/wireguard/private-key$extra"</span>;
<span class="org-keyword">for</span> <span class="org-keyword">my</span> $<span class="org-variable-name">p</span> (@$<span class="org-variable-name">peers</span>) {
<span class="org-keyword">my</span> ($<span class="org-variable-name">n</span>, $<span class="org-variable-name">h</span>, $<span class="org-variable-name">t</span>, $<span class="org-variable-name">k</span>, $<span class="org-variable-name">u</span>) = @$<span class="org-variable-name">p</span>;
<span class="org-keyword">next</span> <span class="org-keyword">if</span> $<span class="org-variable-name">k</span> =~ <span class="org-string">/^-/</span>;
<span class="org-keyword">my</span> $<span class="org-variable-name">ip</span> = hostnum_to_ipaddr ($<span class="org-variable-name">h</span>, $<span class="org-variable-name">addr_cidr</span>);
- print $<span class="org-variable-name">O</span> <span class="org-string">"</span>
-<span class="org-string"># $n</span>
-<span class="org-string">[Peer]</span>
-<span class="org-string">PublicKey = $k</span>
-<span class="org-string">AllowedIPs = $ip\n"</span>;
+ print $<span class="org-variable-name">O</span> <span class="org-string">"
+# $n
+[Peer]
+PublicKey = $k
+AllowedIPs = $ip\n"</span>;
}
close $<span class="org-variable-name">O</span> or <span class="org-keyword">die</span> <span class="org-string">"Could not close $file.tmp: $!\n"</span>;
rename (<span class="org-string">"$file.tmp"</span>, $<span class="org-variable-name">file</span>)
open ($<span class="org-variable-name">O</span>, <span class="org-string">">$file.tmp"</span>) or <span class="org-keyword">die</span> <span class="org-string">"Could not open $file.tmp: $!\n"</span>;
<span class="org-keyword">my</span> $<span class="org-variable-name">DNS</span> = ($<span class="org-variable-name">type</span> eq <span class="org-string">"android"</span>
- ? <span class="org-string">"</span>
-<span class="org-string">DNS = $core_addr</span>
-<span class="org-string">Domain = $domain_priv"</span>
- : <span class="org-string">"</span>
-<span class="org-string">PostUp = wg set %i private-key /etc/wireguard/private-key</span>
-<span class="org-string">PostUp = resolvectl dns %i $core_addr</span>
-<span class="org-string">PostUp = resolvectl domain %i $domain_priv"</span>);
+ ? <span class="org-string">"
+DNS = $core_addr
+Domain = $domain_priv"</span>
+ : <span class="org-string">"
+PostUp = wg set %i private-key /etc/wireguard/private-key
+PostUp = resolvectl dns %i $core_addr
+PostUp = resolvectl domain %i $domain_priv"</span>);
<span class="org-keyword">my</span> $<span class="org-variable-name">WILD</span> = ($<span class="org-variable-name">file</span> eq <span class="org-string">"public.conf"</span>
- ? <span class="org-string">"</span>
-<span class="org-string">AllowedIPs = $wild_net_cidr"</span>
+ ? <span class="org-string">"
+AllowedIPs = $wild_net_cidr"</span>
: <span class="org-string">""</span>);
- print $<span class="org-variable-name">O</span> <span class="org-string">"[Interface]</span>
-<span class="org-string">Address = $addr$DNS</span>
+ print $<span class="org-variable-name">O</span> <span class="org-string">"[Interface]
+Address = $addr$DNS
-<span class="org-string">[Peer]</span>
-<span class="org-string">PublicKey = $pubkey</span>
-<span class="org-string">EndPoint = $endpt</span>
-<span class="org-string">AllowedIPs = $server_addr</span>
-<span class="org-string">AllowedIPs = $private_net_cidr$WILD</span>
-<span class="org-string">AllowedIPs = $public_wg_net_cidr</span>
-<span class="org-string">AllowedIPs = $campus_wg_net_cidr\n"</span>;
+[Peer]
+PublicKey = $pubkey
+EndPoint = $endpt
+AllowedIPs = $server_addr
+AllowedIPs = $private_net_cidr$WILD
+AllowedIPs = $public_wg_net_cidr
+AllowedIPs = $campus_wg_net_cidr\n"</span>;
close $<span class="org-variable-name">O</span> or <span class="org-keyword">die</span> <span class="org-string">"Could not close $file.tmp: $!\n"</span>;
rename (<span class="org-string">"$file.tmp"</span>, $<span class="org-variable-name">file</span>)
or <span class="org-keyword">die</span> <span class="org-string">"Could not rename $file.tmp: $!\n"</span>;
{
<span class="org-keyword">my</span> ($<span class="org-variable-name">hostnum</span>, $<span class="org-variable-name">net_cidr</span>) = @<span class="org-perl-non-scalar-variable">_</span>;
- <span class="org-comment"># Assume 24bit subnet, 8bit hostnum.</span>
- <span class="org-comment"># Find a Perl library for more generality?</span>
- <span class="org-keyword">die</span> <span class="org-string">"$hostnum: hostnum too large\n"</span> <span class="org-keyword">if</span> $<span class="org-variable-name">hostnum</span> > 255;
- <span class="org-keyword">my</span> ($<span class="org-variable-name">prefix</span>) = $<span class="org-variable-name">net_cidr</span> =~ m<span class="org-string">"^(\d+\.\d+\.\d+)\.\d+/24$";</span>
-<span class="org-string"> die if !$prefix;</span>
-<span class="org-string"> return "</span>$<span class="org-variable-name">prefix</span>.$<span class="org-variable-name">hostnum</span><span class="org-string">";</span>
-<span class="org-string">}</span>
+ <span class="org-comment"># Assume 24bit subnet, 8bit hostnum.
+</span> <span class="org-comment"># Find a Perl library for more generality?
+</span> <span class="org-keyword">die</span> <span class="org-string">"$hostnum: hostnum too large\n"</span> <span class="org-keyword">if</span> $<span class="org-variable-name">hostnum</span> > 255;
+ <span class="org-keyword">my</span> ($<span class="org-variable-name">prefix</span>) = $<span class="org-variable-name">net_cidr</span> =~ m<span class="org-string">"^(\d+\.\d+\.\d+)\.\d+/24$";
+ die if !$prefix;
+ return "</span>$<span class="org-variable-name">prefix</span>.$<span class="org-variable-name">hostnum</span><span class="org-string">";
+}
-<span class="org-string">sub hostnum_to_ipaddr_cidr ($$)</span>
-<span class="org-string">{</span>
-<span class="org-string"> my ($hostnum, $net_cidr) = @_;</span>
+sub hostnum_to_ipaddr_cidr ($$)
+{
+ my ($hostnum, $net_cidr) = @_;
-<span class="org-string"> # Assume 24bit subnet, 8bit hostnum.</span>
-<span class="org-string"> # Find a Perl library for more generality?</span>
-<span class="org-string"> die "</span>$<span class="org-variable-name">hostnum</span>: hostnum too large\n<span class="org-string">" if $hostnum > 255;</span>
-<span class="org-string"> my ($prefix) = $net_cidr =~ m"</span>^(\d+\.\d+\.\d+)\.\d+<span class="org-string">/24$";</span>
-<span class="org-string"> die if !$prefix;</span>
-<span class="org-string"> return "$prefix.$hostnum/</span>24<span class="org-string">";</span>
-<span class="org-string">}</span>
+ # Assume 24bit subnet, 8bit hostnum.
+ # Find a Perl library for more generality?
+ die "</span>$<span class="org-variable-name">hostnum</span>: hostnum too large\n<span class="org-string">" if $hostnum > 255;
+ my ($prefix) = $net_cidr =~ m"</span>^(\d+\.\d+\.\d+)\.\d+<span class="org-string">/24$";
+ die if !$prefix;
+ return "$prefix.$hostnum/</span>24<span class="org-string">";
+}</span>
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-orga55b3de" class="outline-3">
-<h3 id="orga55b3de"><span class="section-number-3">12.11.</span> Institute Command Help</h3>
+<div id="outline-container-org91159fb" class="outline-3">
+<h3 id="org91159fb"><span class="section-number-3">12.11.</span> Institute Command Help</h3>
<div class="outline-text-3" id="text-12-11">
<p>
This should be the last block tangled into the <a href="inst"><q>inst</q></a> script. It
</div>
</div>
</div>
-<div id="outline-container-orgf67ef54" class="outline-2">
-<h2 id="orgf67ef54"><span class="section-number-2">13.</span> Testing</h2>
+<div id="outline-container-org903c8fd" class="outline-2">
+<h2 id="org903c8fd"><span class="section-number-2">13.</span> Testing</h2>
<div class="outline-text-2" id="text-13">
<p>
The example files in this document, <a href="ansible.cfg"><q>ansible.cfg</q></a> and <a href="hosts"><q>hosts</q></a> as well
<p>
The next two sections list the steps taken to create the simulated
Core, Gate and Front machines, and connect them to their networks.
-The process is similar to that described in <a href="#org962f0d4">The (Actual) Hardware</a>, but
+The process is similar to that described in <a href="#org6a2440c">The (Actual) Hardware</a>, but
is covered in detail here where the VirtualBox hypervisor can be
assumed and exact command lines can be given (and copied during
re-testing). The remaining sections describe the manual testing
site at <a href="https://www.virtualbox.org/manual/UserManual.html">https://www.virtualbox.org/manual/UserManual.html</a>.
</p>
</div>
-<div id="outline-container-org3772900" class="outline-3">
-<h3 id="org3772900"><span class="section-number-3">13.1.</span> The Test Networks</h3>
+<div id="outline-container-orgb37f468" class="outline-3">
+<h3 id="orgb37f468"><span class="section-number-3">13.1.</span> The Test Networks</h3>
<div class="outline-text-3" id="text-13-1">
<p>
The networks used in the test:
--network 192.168.15.0/24 <span class="org-sh-escaped-newline">\</span>
--enable --dhcp on --ipv6 off
VBoxManage natnetwork start --netname premises
-VBoxManage hostonlyif create <span class="org-comment-delimiter"># </span><span class="org-comment">vboxnet0</span>
-VBoxManage hostonlyif ipconfig vboxnet0 --ip=192.168.56.10
+VBoxManage hostonlyif create <span class="org-comment-delimiter"># </span><span class="org-comment">vboxnet0
+</span>VBoxManage hostonlyif ipconfig vboxnet0 --ip=192.168.56.10
VBoxManage dhcpserver modify --interface=vboxnet0 --disable
-VBoxManage hostonlyif create <span class="org-comment-delimiter"># </span><span class="org-comment">vboxnet1</span>
-VBoxManage hostonlyif ipconfig vboxnet1 --ip=192.168.57.2
+VBoxManage hostonlyif create <span class="org-comment-delimiter"># </span><span class="org-comment">vboxnet1
+</span>VBoxManage hostonlyif ipconfig vboxnet1 --ip=192.168.57.2
</code></pre>
</div>
</p>
</div>
</div>
-<div id="outline-container-org004874d" class="outline-3">
-<h3 id="org004874d"><span class="section-number-3">13.2.</span> The Test Machines</h3>
+<div id="outline-container-org69aa497" class="outline-3">
+<h3 id="org69aa497"><span class="section-number-3">13.2.</span> The Test Machines</h3>
<div class="outline-text-3" id="text-13-2">
<p>
The virtual machines are created by <code>VBoxManage</code> command lines in the
following sub-sections. They each start with a recent Debian release
(e.g. <q>debian-12.5.0-amd64-netinst.iso</q>) in their simulated DVD
-drives. As in <a href="#org962f0d4">The Hardware</a> preparation process being simulated, a few
-additional software packages are installed. Unlike in <a href="#org962f0d4">The Hardware</a>
+drives. As in <a href="#org6a2440c">The Hardware</a> preparation process being simulated, a few
+additional software packages are installed. Unlike in <a href="#org6a2440c">The Hardware</a>
preparation, machines are moved to their final networks and <i>then</i>
remote access is authorized. (They are not accessible via <code>ssh</code> on
the VirtualBox NAT network where they first boot.)
configuration by Ansible.
</p>
</div>
-<div id="outline-container-orgdf176b5" class="outline-4">
-<h4 id="orgdf176b5"><span class="section-number-4">13.2.1.</span> A Test Machine</h4>
+<div id="outline-container-orgc49f179" class="outline-4">
+<h4 id="orgc49f179"><span class="section-number-4">13.2.1.</span> A Test Machine</h4>
<div class="outline-text-4" id="text-13-2-1">
<p>
The following shell function contains most of the <code>VBoxManage</code>
<li>Partition disks
<ul class="org-ul">
<li>Partitioning method: Guided - use entire disk</li>
-<li>Select disk to partition: SCSI3 (0,0,0) (sda) - …</li>
+<li>Select disk to partition: SCSI3 (0,0,0) (sda) - …</li>
<li>Partitioning scheme: All files in one partition</li>
<li>Finish partitioning and write changes to disk: Continue</li>
<li>Write the changes to disks? Yes</li>
<li>Install the GRUB boot loader
<ul class="org-ul">
<li>Install the GRUB boot loader to your primary drive? Yes</li>
-<li>Device for boot loader installation: /dev/sda (ata-VBOX…</li>
+<li>Device for boot loader installation: /dev/sda (ata-VBOX…</li>
</ul></li>
</ul>
</p>
</div>
</div>
-<div id="outline-container-org184f145" class="outline-4">
-<h4 id="org184f145"><span class="section-number-4">13.2.2.</span> The Test Front Machine</h4>
+<div id="outline-container-org34fc9dd" class="outline-4">
+<h4 id="org34fc9dd"><span class="section-number-4">13.2.2.</span> The Test Front Machine</h4>
<div class="outline-text-4" id="text-13-2-2">
<p>
The <code>front</code> machine is created with 512MiB of RAM, 4GiB of disk, and
its primary network interface moved to the simulated Internet, the NAT
network <code>premises</code>. <code>front</code> also gets a second network interface, on
the host-only network <code>vboxnet1</code>, to make it directly accessible to
-the administrator's notebook (as described in <a href="#org3772900">The Test Networks</a>).
+the administrator's notebook (as described in <a href="#orgb37f468">The Test Networks</a>).
</p>
<div class="org-src-container">
deployed on a frontier, always in the cloud. Additional Debian
packages are assumed to be readily available. Thus Ansible installs
them as necessary, but first the administrator authorizes remote
-access by following the instructions in the final section: <a href="#orgc72a8cc">Ansible
+access by following the instructions in the final section: <a href="#orgf046593">Ansible
Test Authorization</a>.
</p>
</div>
</div>
-<div id="outline-container-org14b4591" class="outline-4">
-<h4 id="org14b4591"><span class="section-number-4">13.2.3.</span> The Test Gate Machine</h4>
+<div id="outline-container-orga769609" class="outline-4">
+<h4 id="orga769609"><span class="section-number-4">13.2.3.</span> The Test Gate Machine</h4>
<div class="outline-text-4" id="text-13-2-3">
<p>
The <code>gate</code> machine is created with the same amount of RAM and disk as
</div>
<p>
-After Debian is installed (as detailed in <a href="#orgdf176b5">A Test Machine</a>) and the
+After Debian is installed (as detailed in <a href="#orgc49f179">A Test Machine</a>) and the
machine rebooted, the administrator logs in and installs several
additional software packages.
</p>
<p>
Finally, the administrator authorizes remote access by following the
-instructions in the final section: <a href="#orgc72a8cc">Ansible Test Authorization</a>.
+instructions in the final section: <a href="#orgf046593">Ansible Test Authorization</a>.
</p>
</div>
</div>
-<div id="outline-container-org4ce7a4d" class="outline-4">
-<h4 id="org4ce7a4d"><span class="section-number-4">13.2.4.</span> The Test Core Machine</h4>
+<div id="outline-container-org27ade3a" class="outline-4">
+<h4 id="org27ade3a"><span class="section-number-4">13.2.4.</span> The Test Core Machine</h4>
<div class="outline-text-4" id="text-13-2-4">
<p>
The <code>core</code> machine is created with 1GiB of RAM and 6GiB of disk.
</div>
<p>
-After Debian is installed (as detailed in <a href="#orgdf176b5">A Test Machine</a>) and the
+After Debian is installed (as detailed in <a href="#orgc49f179">A Test Machine</a>) and the
machine rebooted, the administrator logs in and installs several
additional software packages.
</p>
<p>
Finally, the administrator authorizes remote access by following the
-instructions in the next section: <a href="#orgc72a8cc">Ansible Test Authorization</a>.
+instructions in the next section: <a href="#orgf046593">Ansible Test Authorization</a>.
</p>
</div>
</div>
-<div id="outline-container-orgc72a8cc" class="outline-4">
-<h4 id="orgc72a8cc"><span class="section-number-4">13.2.5.</span> Ansible Test Authorization</h4>
+<div id="outline-container-orgf046593" class="outline-4">
+<h4 id="orgf046593"><span class="section-number-4">13.2.5.</span> Ansible Test Authorization</h4>
<div class="outline-text-4" id="text-13-2-5">
<p>
To authorize Ansible's access to the three test machines, they must
<div class="org-src-container">
<pre class="src src-sh"><code><span class="org-variable-name">SRC</span>=Secret/ssh_admin/id_rsa.pub
-scp $<span class="org-variable-name">SRC</span> sysadm@192.168.57.3:admin_key <span class="org-comment-delimiter"># </span><span class="org-comment">Front</span>
-scp $<span class="org-variable-name">SRC</span> sysadm@192.168.56.2:admin_key <span class="org-comment-delimiter"># </span><span class="org-comment">Gate</span>
-scp $<span class="org-variable-name">SRC</span> sysadm@192.168.56.1:admin_key <span class="org-comment-delimiter"># </span><span class="org-comment">Core</span>
+scp $<span class="org-variable-name">SRC</span> sysadm@192.168.57.3:admin_key <span class="org-comment-delimiter"># </span><span class="org-comment">Front
+</span>scp $<span class="org-variable-name">SRC</span> sysadm@192.168.56.2:admin_key <span class="org-comment-delimiter"># </span><span class="org-comment">Gate
+</span>scp $<span class="org-variable-name">SRC</span> sysadm@192.168.56.1:admin_key <span class="org-comment-delimiter"># </span><span class="org-comment">Core</span>
</code></pre>
</div>
</div>
</div>
</div>
-<div id="outline-container-org317a41d" class="outline-3">
-<h3 id="org317a41d"><span class="section-number-3">13.3.</span> Configure Test Machines</h3>
+<div id="outline-container-orgc94c022" class="outline-3">
+<h3 id="orgc94c022"><span class="section-number-3">13.3.</span> Configure Test Machines</h3>
<div class="outline-text-3" id="text-13-3">
<p>
At this point the three test machines <code>core</code>, <code>gate</code>, and <code>front</code> are
</p>
</div>
</div>
-<div id="outline-container-orgafd4ed0" class="outline-3">
-<h3 id="orgafd4ed0"><span class="section-number-3">13.4.</span> Test Basics</h3>
+<div id="outline-container-org2f6cd0a" class="outline-3">
+<h3 id="org2f6cd0a"><span class="section-number-3">13.4.</span> Test Basics</h3>
<div class="outline-text-3" id="text-13-4">
<p>
At this point the test institute is just <code>core</code>, <code>gate</code> and <code>front</code>,
</p>
<div class="org-src-container">
-<pre class="src src-sh"><code>ping -c 1 8.8.4.4 <span class="org-comment-delimiter"># </span><span class="org-comment">dns.google</span>
-ping -c 1 192.168.15.5 <span class="org-comment-delimiter"># </span><span class="org-comment">front_addr</span>
+<pre class="src src-sh"><code>ping -c 1 8.8.4.4 <span class="org-comment-delimiter"># </span><span class="org-comment">dns.google
+</span>ping -c 1 192.168.15.5 <span class="org-comment-delimiter"># </span><span class="org-comment">front_addr</span>
</code></pre>
</div>
</p>
</div>
</div>
-<div id="outline-container-org7b9faa6" class="outline-3">
-<h3 id="org7b9faa6"><span class="section-number-3">13.5.</span> The Test Nextcloud</h3>
+<div id="outline-container-orgfceae51" class="outline-3">
+<h3 id="orgfceae51"><span class="section-number-3">13.5.</span> The Test Nextcloud</h3>
<div class="outline-text-3" id="text-13-5">
<p>
Further tests involve Nextcloud account management. Nextcloud is
-installed on <code>core</code> as described in <a href="#org7addaa6">Configure Nextcloud</a>. Once
+installed on <code>core</code> as described in <a href="#orga909c3b">Configure Nextcloud</a>. Once
<q>/Nextcloud/</q> is created, <code>./inst config core</code> will validate
or update its configuration files.
</p>
</p>
</div>
</div>
-<div id="outline-container-org9f3a7d2" class="outline-3">
-<h3 id="org9f3a7d2"><span class="section-number-3">13.6.</span> Test New Command</h3>
+<div id="outline-container-org751e880" class="outline-3">
+<h3 id="org751e880"><span class="section-number-3">13.6.</span> Test New Command</h3>
<div class="outline-text-3" id="text-13-6">
<p>
A member must be enrolled so that a member's client machine can be
</p>
</div>
</div>
-<div id="outline-container-org59da489" class="outline-3">
-<h3 id="org59da489"><span class="section-number-3">13.7.</span> The Test Member Notebook</h3>
+<div id="outline-container-org904ce59" class="outline-3">
+<h3 id="org904ce59"><span class="section-number-3">13.7.</span> The Test Member Notebook</h3>
<div class="outline-text-3" id="text-13-7">
<p>
A test member's notebook is created next, much like the servers,
</p>
<p>
-Debian is installed much as detailed in <a href="#orgdf176b5">A Test Machine</a> <i>except</i> that
+Debian is installed much as detailed in <a href="#orgc49f179">A Test Machine</a> <i>except</i> that
the SSH server option is <i>not</i> needed and the GNOME desktop option
<i>is</i>. When the machine reboots, the administrator logs into the
desktop and installs a couple additional software packages (which
</div>
</div>
</div>
-<div id="outline-container-org2e42cab" class="outline-3">
-<h3 id="org2e42cab"><span class="section-number-3">13.8.</span> Test Client Command</h3>
+<div id="outline-container-org527d5d6" class="outline-3">
+<h3 id="org527d5d6"><span class="section-number-3">13.8.</span> Test Client Command</h3>
<div class="outline-text-3" id="text-13-8">
<p>
The <code>./inst client</code> command is used to register the public key of a
</div>
</div>
</div>
-<div id="outline-container-org749b7ef" class="outline-3">
-<h3 id="org749b7ef"><span class="section-number-3">13.9.</span> Test Campus WireGuard™ Subnet</h3>
+<div id="outline-container-org4a8304f" class="outline-3">
+<h3 id="org4a8304f"><span class="section-number-3">13.9.</span> Test Campus WireGuard™ Subnet</h3>
<div class="outline-text-3" id="text-13-9">
<p>
-The <q>campus.conf</q> WireGuard™ configuration file (generated in <a href="#org2e42cab">Test
+The <q>campus.conf</q> WireGuard™ configuration file (generated in <a href="#org527d5d6">Test
Client Command</a>) is transferred to <code>dick</code>, which is at the Wi-Fi access
point's IP address, host 2 on the wild Ethernet.
</p>
<div class="org-src-container">
<pre class="src src-sh"><code>systemctl status
-ping -c 1 8.8.8.8 <span class="org-comment-delimiter"># </span><span class="org-comment">dns.google</span>
-ping -c 1 192.168.56.1 <span class="org-comment-delimiter"># </span><span class="org-comment">core</span>
-host dns.google
+ping -c 1 8.8.8.8 <span class="org-comment-delimiter"># </span><span class="org-comment">dns.google
+</span>ping -c 1 192.168.56.1 <span class="org-comment-delimiter"># </span><span class="org-comment">core
+</span>host dns.google
host core.small.private
host www
</code></pre>
</div>
</div>
</div>
-<div id="outline-container-orga2f0d71" class="outline-3">
-<h3 id="orga2f0d71"><span class="section-number-3">13.10.</span> Test Web Pages</h3>
+<div id="outline-container-orgc07c857" class="outline-3">
+<h3 id="orgc07c857"><span class="section-number-3">13.10.</span> Test Web Pages</h3>
<div class="outline-text-3" id="text-13-10">
<p>
Next, the administrator copies <a href="Backup/WWW/"><q>Backup/WWW/</q></a> (included in the
</p>
</div>
</div>
-<div id="outline-container-orgacf8e99" class="outline-3">
-<h3 id="orgacf8e99"><span class="section-number-3">13.11.</span> Test Web Update</h3>
+<div id="outline-container-org89e041c" class="outline-3">
+<h3 id="org89e041c"><span class="section-number-3">13.11.</span> Test Web Update</h3>
<div class="outline-text-3" id="text-13-11">
<p>
Modify <q>/WWW/live/index.html</q> on <code>core</code> and wait 15 minutes for it to
</p>
</div>
</div>
-<div id="outline-container-orgdb60804" class="outline-3">
-<h3 id="orgdb60804"><span class="section-number-3">13.12.</span> Test Nextcloud</h3>
+<div id="outline-container-orga3da3a3" class="outline-3">
+<h3 id="orga3da3a3"><span class="section-number-3">13.12.</span> Test Nextcloud</h3>
<div class="outline-text-3" id="text-13-12">
<p>
Nextcloud is typically installed and configured <i>after</i> the first
installation directory <q>/Nextcloud/nextcloud/</q> appears, the Ansible
code skips parts of the Nextcloud configuration. The same
installation (or restoration) process used on Core is used on <code>core</code>
-to create <q>/Nextcloud/</q>. The process starts with <a href="#orgcb7a84e">Create
-<q>/Nextcloud/</q></a>, involves <a href="#org5825d2f">Restore Nextcloud</a> or <a href="#org8f9d1d3">Install Nextcloud</a>,
-and runs <code>./inst config core</code> again <a href="#org7bf8385">8.23.6</a>. When the <code>./inst
+to create <q>/Nextcloud/</q>. The process starts with <a href="#orgd428b0f">Create
+<q>/Nextcloud/</q></a>, involves <a href="#org0c72e46">Restore Nextcloud</a> or <a href="#org0727aa7">Install Nextcloud</a>,
+and runs <code>./inst config core</code> again <a href="#orgdd1a3b6">8.23.6</a>. When the <code>./inst
config core</code> command is happy with the Nextcloud configuration on
<code>core</code>, the administrator uses Dick's notebook to test it, performing
the following tests on <code>dick</code>'s desktop.
</ul>
</div>
</div>
-<div id="outline-container-org19dd1f6" class="outline-3">
-<h3 id="org19dd1f6"><span class="section-number-3">13.13.</span> Test Email</h3>
+<div id="outline-container-org2f53c67" class="outline-3">
+<h3 id="org2f53c67"><span class="section-number-3">13.13.</span> Test Email</h3>
<div class="outline-text-3" id="text-13-13">
<p>
With Evolution running on the member notebook <code>dick</code>, one second email
</p>
</div>
</div>
-<div id="outline-container-orgdea634f" class="outline-3">
-<h3 id="orgdea634f"><span class="section-number-3">13.14.</span> Test Public VPN</h3>
+<div id="outline-container-org5177fab" class="outline-3">
+<h3 id="org5177fab"><span class="section-number-3">13.14.</span> Test Public VPN</h3>
<div class="outline-text-3" id="text-13-14">
<p>
At this point, <code>dick</code> can move abroad, from the campus Wi-Fi
</p>
<div class="org-src-container">
-<pre class="src src-sh"><code>ping -c 1 8.8.4.4 <span class="org-comment-delimiter"># </span><span class="org-comment">dns.google</span>
-ping -c 1 192.168.56.1 <span class="org-comment-delimiter"># </span><span class="org-comment">core</span>
-host dns.google
+<pre class="src src-sh"><code>ping -c 1 8.8.4.4 <span class="org-comment-delimiter"># </span><span class="org-comment">dns.google
+</span>ping -c 1 192.168.56.1 <span class="org-comment-delimiter"># </span><span class="org-comment">core
+</span>host dns.google
host core.small.private
host www
</code></pre>
</p>
</div>
</div>
-<div id="outline-container-org0df30af" class="outline-3">
-<h3 id="org0df30af"><span class="section-number-3">13.15.</span> Test Pass Command</h3>
+<div id="outline-container-orged86c59" class="outline-3">
+<h3 id="orged86c59"><span class="section-number-3">13.15.</span> Test Pass Command</h3>
<div class="outline-text-3" id="text-13-15">
<p>
To test the <code>./inst pass</code> command, the administrator logs in to <code>core</code>
</p>
</div>
</div>
-<div id="outline-container-orgcba4b86" class="outline-3">
-<h3 id="orgcba4b86"><span class="section-number-3">13.16.</span> Test Old Command</h3>
+<div id="outline-container-org3c761c1" class="outline-3">
+<h3 id="org3c761c1"><span class="section-number-3">13.16.</span> Test Old Command</h3>
<div class="outline-text-3" id="text-13-16">
<p>
One more institute command is left to exercise. The administrator
</div>
</div>
</div>
-<div id="outline-container-org7cfe8df" class="outline-2">
-<h2 id="org7cfe8df"><span class="section-number-2">14.</span> Future Work</h2>
+<div id="outline-container-org5577075" class="outline-2">
+<h2 id="org5577075"><span class="section-number-2">14.</span> Future Work</h2>
<div class="outline-text-2" id="text-14">
<p>
The small institute's network, as currently defined in this doocument,
is lacking in a number of respects.
</p>
</div>
-<div id="outline-container-org93afc94" class="outline-3">
-<h3 id="org93afc94"><span class="section-number-3">14.1.</span> Deficiencies</h3>
+<div id="outline-container-org71b5241" class="outline-3">
+<h3 id="org71b5241"><span class="section-number-3">14.1.</span> Deficiencies</h3>
<div class="outline-text-3" id="text-14-1">
<p>
The current network monitoring is rudimentary. It could use some
</p>
</div>
</div>
-<div id="outline-container-org7c83950" class="outline-3">
-<h3 id="org7c83950"><span class="section-number-3">14.2.</span> More Tests</h3>
+<div id="outline-container-orgbdadef9" class="outline-3">
+<h3 id="orgbdadef9"><span class="section-number-3">14.2.</span> More Tests</h3>
<div class="outline-text-3" id="text-14-2">
<p>
The testing process described in the previous chapter is far from
complete. Additional tests are needed.
</p>
</div>
-<div id="outline-container-org0ddb484" class="outline-4">
-<h4 id="org0ddb484"><span class="section-number-4">14.2.1.</span> Backup</h4>
+<div id="outline-container-org7f1b9ff" class="outline-4">
+<h4 id="org7f1b9ff"><span class="section-number-4">14.2.1.</span> Backup</h4>
<div class="outline-text-4" id="text-14-2-1">
<p>
The <code>backup</code> command has not been tested. It needs an encrypted
</p>
</div>
</div>
-<div id="outline-container-org2771684" class="outline-4">
-<h4 id="org2771684"><span class="section-number-4">14.2.2.</span> Restore</h4>
+<div id="outline-container-orgc776285" class="outline-4">
+<h4 id="orgc776285"><span class="section-number-4">14.2.2.</span> Restore</h4>
<div class="outline-text-4" id="text-14-2-2">
<p>
The restore process has not been tested. It might just copy <a href="Backup/"><q>Backup/</q></a>
</p>
</div>
</div>
-<div id="outline-container-orgc7e73d4" class="outline-4">
-<h4 id="orgc7e73d4"><span class="section-number-4">14.2.3.</span> Campus Disconnect</h4>
+<div id="outline-container-org1f149e9" class="outline-4">
+<h4 id="org1f149e9"><span class="section-number-4">14.2.3.</span> Campus Disconnect</h4>
<div class="outline-text-4" id="text-14-2-3">
<p>
-Email access (IMAPS) on <code>front</code> is… difficult to test unless
+Email access (IMAPS) on <code>front</code> is… difficult to test unless
<code>core</code>'s fetchmails are disconnected, i.e. the whole campus is
disconnected, so that new email stays on <code>front</code> long enough to be
seen.
</div>
</div>
</div>
-<div id="outline-container-orgf04e6a8" class="outline-2">
-<h2 id="orgf04e6a8"><span class="section-number-2">15.</span> Appendix: The Bootstrap</h2>
+<div id="outline-container-org1b47a6b" class="outline-2">
+<h2 id="org1b47a6b"><span class="section-number-2">15.</span> Appendix: The Bootstrap</h2>
<div class="outline-text-2" id="text-15">
<p>
Creating the private network from whole cloth (machines with recent
get to the additional packages.
</p>
</div>
-<div id="outline-container-org0f6bea1" class="outline-3">
-<h3 id="org0f6bea1"><span class="section-number-3">15.1.</span> The Current Strategy</h3>
+<div id="outline-container-org2325810" class="outline-3">
+<h3 id="org2325810"><span class="section-number-3">15.1.</span> The Current Strategy</h3>
<div class="outline-text-3" id="text-15-1">
<p>
-The strategy pursued in <a href="#org962f0d4">The Hardware</a> is two phase: prepare the servers
+The strategy pursued in <a href="#org6a2440c">The Hardware</a> is two phase: prepare the servers
on the Internet where additional packages are accessible, then connect
them to the campus facilities (the private Ethernet switch, Wi-Fi AP,
ISP), manually configure IP addresses (while the DHCP client silently
</p>
</div>
</div>
-<div id="outline-container-orgb02e215" class="outline-3">
-<h3 id="orgb02e215"><span class="section-number-3">15.2.</span> Starting With Gate</h3>
+<div id="outline-container-org235117e" class="outline-3">
+<h3 id="org235117e"><span class="section-number-3">15.2.</span> Starting With Gate</h3>
<div class="outline-text-3" id="text-15-2">
<p>
The strategy of Starting With Gate concentrates on configuring Gate's
</ul>
</div>
</div>
-<div id="outline-container-orgc037db8" class="outline-3">
-<h3 id="orgc037db8"><span class="section-number-3">15.3.</span> Pre-provision With Ansible</h3>
+<div id="outline-container-org894c60e" class="outline-3">
+<h3 id="org894c60e"><span class="section-number-3">15.3.</span> Pre-provision With Ansible</h3>
<div class="outline-text-3" id="text-15-3">
<p>
A refinement of the current strategy might avoid the need to maintain
<div class="footdef"><sup><a id="fn.4" class="footnum" href="#fnr.4" role="doc-backlink">4</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
Front is accessible via Gate but routing from the host address
on <code>vboxnet0</code> through Gate requires extensive interference with the
-routes on Front and Gate, making the simulation less… similar.
+routes on Front and Gate, making the simulation less… similar.
</p></div></div>
</div></div>
<div id="postamble" class="status">
<p class="author">Author: Matt Birkholz</p>
-<p class="date">Created: 2025-06-28 Sat 10:50</p>
+<p class="date">Created: 2025-09-18 Thu 17:59</p>
<p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>