Commit Graph

110 Commits (d3592f116250cab2b7d35f67dda6b6b7e34cc2a2)

Author SHA1 Message Date
Dustin d3592f1162 hosts: Add serial0.pyrocufflink.blue
This is a Raspberry Pi 3 on the DIN rail that has USB-to-RS232 adapters
connected to the VM hosts and the Firewall.
2021-10-31 00:54:10 -05:00
Dustin 881c8de625 Switch Prometheus/collectd to pull
Transitioning from push-based to pull-based monitoring with
Prometheus/collectd.  The *write_prometheus* plugin will be installed on
all hosts, and Prometheus will be configured to scrape them directly.
2021-10-30 16:41:17 -05:00
Dustin 86aa292931 hosts: Remove dc2 from ntpd group
Fedora 34 does not include the *ntp* package, as it has been "obsoleted
by ntpsec."  Until I can create a role for *ntpsec*,
*dc2.pyrocufflink.blue* cannot be an NTP server.
2021-10-17 14:11:00 -05:00
Dustin e2c5549f35 hosts: Add dc2.p.b
*dc2.pyrocufflink.blue* acts as a second Active Directory Domain
Controller with *samba*.
2021-10-16 21:53:02 -05:00
Dustin 11357a9df3 hosts: Remove vpn0.p.b
The firewall provides both the Wireguard and IKEv2 VPN services.
2021-08-30 08:50:18 -05:00
Dustin d78005fac6 hosts: remove hass{1,db0}.p.b
*hass1.pyrocufflink.blue* and *hassdb0.pyrocufflink.blue* were part of
the old Home Assistant deployment.  Everything has been migrated to
*hass2.pyrocufflink.blue*, so these machines can be decommissioned now.
2021-08-24 20:03:59 -05:00
Dustin c1a7105d09 hosts: Add hass2.p.b to rw-root
*hass2.pyrocufflink.blue* only has a single filesystem, stored on its
NVMe disk.
2021-08-22 10:15:10 -05:00
Dustin c4cd9f13f5 hosts: Remove build1-aarch64.p.b
This machine keeps crashing.  It's mostly unused for now anyway.  I'll
probably eventually replace it with a Raspberry Pi 4.
2021-08-22 09:54:18 -05:00
Dustin 4301391a79 hosts: Remove zezere0, motion0
Didn't end up needing Zezere, as I gave up on Fedora IoT.

No longer using motionEye since switching to Frigate.
2021-08-21 17:32:49 -05:00
Dustin b7ba6a59ab hosts: Add nvr0.p.b
*nvr0.pyrocufflink.blue* hosts Frigate.  It is deployed on a separate
subnet, for two reasons:

* To avoid streaming video from the cameras through the firewall
* To prevent any hosts on the LAN except Home Assistant from
  communicating with Frigate, since it does not have any kind of
  authentication or access control
2021-08-21 17:20:19 -05:00
Dustin 997760968e r/frigate: Add role to deploy Frigate
Frigate is an NVR that uses machine learning to detect objects on camera
in real time.  It integrates with Home Assistant to expose sensors which
can be used for automation, etc.

The only official way to deploy Frigate is with a container, so we use
Podman and systemd to manage it.
2021-08-21 17:16:58 -05:00
Dustin b826d8355e hosts: Add hass2.p.b
*hass2.pyrocufflink.blue* is a Raspberry Pi Compute Module 4-based
system, currently mounted in a WaveShare CM4 Mini Base Board (A).  With
an NVMe SSD for primary storage, it runs significantly faster than a
standard Raspberry Pi 4, and blows the old Raspberry Pi 3-based Home
Assistant deployment out of the water. It has a Zooz 700 series Z-Wave
Plus S2 USB stick and a ConBee II Zigbee USB stick attached to its USB
2.0 ports.  It runs a customized Fedora Minimal distribution.
2021-07-19 15:58:58 -05:00
Dustin 4aa3cdddd9 hosts: Add zezere0.p.b
*zezere0.pyrocufflink.blue* hosts the local deployment of the Fedora
Zezere provisioning service.
2021-07-05 09:34:25 -05:00
Dustin 3d9d7423ef hosts: Add stats0.p.b to prometheus group
Although configuration policy is not yet available for Prometheus
itself, the `collectd.yml` playbook also uses the *prometheus* host
group.  Specifically, hosts in this group are configured to receive
collectd data from other hosts and expose those data through the
`write_prometheus` plugin.
2021-07-05 09:34:25 -05:00
Dustin 9565b740b0 hosts: add stats0.p.b
*stats0.pyrocufflink.blue* hosts Grafana (for now, adding Victoria
Metrics, etc. later)
2021-07-02 21:55:02 -05:00
Dustin 5e61e93cea roles/grafana: Deploy Grafana
This commit introduces the *grafana* role and the corresponding
`grafana.yml` playbook.  The role installs Grafana using the system
package manager, and configures the server (including LDAP
authentication).
2021-07-02 21:47:33 -05:00
Dustin 2df1605421 hosts: Add matrix0.p.b
*matrix0.pyrocufflink.blue* hosts the Matrix homeserver for
*hatch.chat*.
2020-12-30 22:04:51 -06:00
Dustin 371305bed4 roles/synapse: Deploy the Matrix homeserver
The *synapse* role and the corresponding `synapse.yml` playbook deploy
Synapse, the reference Matrix homeserver implementation.

Deploying Synapse itself is fairly straightforward: it is packaged by
Fedora and therefore can simply be installed via `dnf` and started by
`systemd`.  Making the service available on the Internet, however, is
more involved.  The Matrix protocol mostly works over HTTPS on the
standard port (443), so a typical reverse proxy deployment is mostly
sufficient.  Some parts of the Matrix protocol, however, involve
communication over an alternate port (8448).  This could be handled by a
reverse proxy as well, but since it is a fairly unique port, it could
also be handled by NAT/port forwarding.  In order to support both
deployment scenarios (as well as the hypothetical scenario wherein the
Synapse machine is directly accessible from the Internet), the *synapse*
role supports specifying an optional `matrix_tls_cert` variable.  If
this variable is set, it should contain the path to a certificate file
on the Ansible control machine that will be used for the "direct"
connections (i.e. on port 8448).  If it is not set, the default Apache
certificate will be used for both virtual hosts.

Synapse has a pretty extensive configuration schema, but most of the
options are set to their default values by the *synapse* role.  Other
than substituting secret keys, the only exposed configuration option is
the LDAP authentication provider.
2020-12-30 21:54:02 -06:00
Dustin 621035e89b Merge branch 'collectd' into master 2020-12-23 21:26:01 -06:00
Dustin debf7d8e5a hosts: Add pyrocufflink to collectd group
We want collectd deployed on all production machines.
2020-12-23 21:04:49 -06:00
Dustin 19f0d713f4 hosts: Move koji0.p.b to offline
I doubt I will be using Koji much if at all any more.  In preparation
for decommissioning it, I am moving the Koji inventory to hosts.offline,
to prevent Jenkins jobs from failing.
2020-12-13 09:54:01 -06:00
Dustin 3a36d6b7ff hosts: Add motion0.p.b
*motion0.pyrocufflink.blue* hosts motionEye
2020-10-03 11:30:38 -05:00
Dustin ef4e769ed2 motioneye: Deploy motionEye camera software
The *motioneye* role installs motionEye on a Fedora machine using `pip`.
It configures Apache to proxy for motionEye for outside (HTTPS) access.

The official installation instructions and default configuration for
motionEye assume it will be running as root.  There is, however, no
specific reason for this, as it works just fine as an unprivileged user.
The only minor surprise is that the `conf_path` configuration setting
must be writable, as this is where motionEye places generated
configuration for `motion`.  This path does not, however, have to
include the `motioneye.conf` file itself, which can still be read-only.
2020-10-03 11:29:39 -05:00
Dustin 8ca093050b pyrocufflink-dns: Cloudflare over ProtonVPN
This commit adds a new playbook, `protonvpn.yml`, and its supporting
roles *strongswan-swanctl* and *protonvpn*.  This playbook configures
strongSwan to connect to ProtonVPN using IPsec/IKEv2.

With this playbook, we configure the name servers on the Pyrocufflink
network to route all DNS requests through the Cloudflare public DNS
recursive servers at 1.1.1.1/1.0.0.1 over ProtonVPN.  Using this setup,
we have the benefit of the speed of using a public DNS server (which is
*significantly* faster than running our own recursive server, usually by
1-2 seconds per request), and the benefit of anonymity from ProtonVPN.

Using the public DNS server alone is great for performance, but allows
the server operator (in this case Cloudflare) to track and analyze usage
patterns.  Using ProtonVPN gives us anonymity (assuming we trust
ProtonVPN not to do the very same tracking), but can have a negative
performance impact if its used for all Internet traffic.  By combining
these solutions, we can get the benefits of both!
2020-09-06 11:06:58 -05:00
Dustin 44404950c1 Merge branch 'graylog' into master 2020-08-31 20:17:12 -05:00
Dustin 40c8df1b13 hosts: cloud0: Configure backups with BURP
Back up `/var/www/html`.
2020-08-29 14:22:17 -05:00
Dustin da3eb1aaf0 hosts: hass1: Configure backups with BURP
Back up `/var/lib/homeassistant`.
2020-08-29 14:22:17 -05:00
Dustin 276ac7e5fb Add rw-root group
Some hosts, such as the Raspberry Pis built using default Fedora images,
do not have proper filesystem separation, but use a single volume for
the entire filesystem.  These hosts cannot have the root filesystem
mounted read-only, since all the writable data are also stored there.

When Jenkins runs configuration policy jobs, it always tries to remount
the root filesystem as read-only on every machine that it configured.
For these hosts with a single volume, this step fails, causing the job
to be marked as failed.  To avoid this, I have added a new group,
*rw-root*; hosts in this group will be omitted from the final remount
step.
2020-08-29 08:53:28 -05:00
Dustin c7e4810abd hosts: Move burp0, taiga0 to offline
These machines are deprecated.  burp1 has replaced burp0. Nextcloud Deck
seems to be just as useful as Taiga.
2020-08-28 21:13:59 -05:00
Dustin 0f73b09e09 hosts: Add hassdb0.p.b
*hassdb0.pyrocufflink.blue* hosts the PostgreSQL database for Home
Assistant.
2020-07-14 11:38:44 -05:00
Dustin f1b4598601 roles/hassdb: Deploy Home Assistant database
Normally, Home Assistant uses a SQLite database for storing state
history.  On a Raspberry Pi with only an SD card for storage like
*hass1.pyrocufflink.blue*, this can become extremely slow, especially
for large data sets.  To speed up features like history and logbook,
Home Assistant supports using an external database engine such as
PostgreSQL or MariaDB.

The *hassdb* role and corresponding `hassdb.yml` playbook deploys a
PostgreSQL server for Home Assistant to use.  It needs only to create
the role and database, as Home Assistant manages its own schema.
2020-07-14 11:38:30 -05:00
Dustin 3dcc0aeacd hosts: Add ARM builders to *jenkins-slave* group
The *build1-aarch64.pyrocufflink.blue* and
*build2-armv7hl.pyrocufflink.blue* machines are now configured as
Jenkins nodes.
2020-07-04 14:35:26 -05:00
Dustin 7a4b46b455 Merge branch 'hass1' 2020-07-04 14:26:13 -05:00
Dustin 0a3ff65a8c hosts: Add hass1.p.b
*hass1.pyrocufflink.blue* is the new host for Home Assistant.  I
migrated from using a virtual machine to using a Raspberry Pi to avoid
having to deal with USB passthrough for the Z-Wave USB stick.
2020-07-04 13:49:08 -05:00
Dustin 3addbc8ea7 hosts: remove hass0.p.b 2020-05-10 16:30:04 -05:00
Dustin a828bbe56b hosts: remove proxy0.p.b 2020-05-10 16:20:13 -05:00
Dustin 1d0786f46b hosts: Add build2-armv7hl.p.b
*build2-armv7hl.pyrocufflink.blue* is a Raspberry Pi 3 running Fedora
ARM.  It will be used to build software and OS images for other ARM
machines.
2020-03-21 12:42:27 -05:00
Dustin d1a8c1db84 hosts: Add build1-aarch64.p.b
*build1-aarch64* is a Raspberry Pi 3 B+ running Fedora aarch64.  It is
intended to be used to build software and operating system images for
other aarch64 machines.
2020-03-21 12:42:27 -05:00
Dustin 66c9581d7b hosts: Decommission rprx0.p.b
*rprx0.pyrocufflink.blue* is no longer in operation.
*web0.pyrocufflink.blue* handles incoming HTTP/HTTPS requests directly,
proxying to Bitwarden, OpenVPN, etc. as needed.
2020-03-17 08:45:34 -05:00
Dustin 4c661478b2 hosts: bw0: Use Lego cert 2020-03-17 08:45:34 -05:00
Dustin 0694594445 websites/pyrocufflink.net: Use lego certificate
This commit updates the configuration for *pyrocufflink.net* to use the
wildcard certificate managed by *lego* instead of an unique certificate
managed by *certbot*.
2020-03-16 14:16:34 -05:00
Dustin b09bf84a3b nextcloud: Deploy Nextcloud w/ Apache+PHP-FPM
The *nextcloud* role installs Nextcloud from the specified release
archive, downloading it to the control machine first if necessary, and
configures Apache and PHP-FPM to serve it.

The `nextcloud.yml` playbook uses the *cert* role to install the X.509
certificate for the Nextcloud server, sets up Apache HTTPD with the
*apache* role, and installs Nextcloud using the *nextcloud* role.

The host *cloud0.pyrocufflink.blue* is the Nextcloud server for
Pyrocufflink.
2020-03-09 20:18:07 -05:00
Dustin cd1cf38774 hosts: git0: Switch to Lego wildcard cert 2020-02-22 16:43:46 -06:00
Dustin 7543815e9b hosts: Add burp1.p.b
*burp1.pyrocufflink.blue* will replace *burp0.pyrocufflink.blue* as the
BURP server for Pyrocufflink.  It is a physical machine (Fitlet), making
it simpler to manage the USB drives.  The old virtual machine will be
decommissioned soon.
2020-01-25 13:57:04 -06:00
Dustin e25b9a2e8e hosts: Add logs0.p.b
*logs0.pyrocufflink.blue* hosts Graylog
2019-10-28 18:47:09 -05:00
Dustin b137cd42fa graylog: Add PB to deploy Graylog server
The `graylog.yml` playbook installs Elasticsearch, MongoDB, and Graylog
on a single machine.
2019-10-28 18:47:09 -05:00
Dustin b2cc467581 hosts: Add build0-amd64
*build0-amd64.securepassage.com* is a Jenkins agent that runs Docker,
allowing pipeline jobs to run inside containers.
2019-09-19 19:50:35 -05:00
Dustin 43deb1f89e hosts: Remove references to zabbix-server
Having an empty (therefore undefined) group as the child of another
group causes Ansible to emit a "warning" (really an error) indicating
that it cannot parse the inventory file:

    [WARNING]:  * Failed to parse
    /var/lib/jenkins/workspace/CfgMgmt/pyrocufflink/hosts with ini plugin:
    /var/lib/jenkins/workspace/CfgMgmt/pyrocufflink/hosts:60: Section
    [smtp- relay:children] includes undefined group: zabbix-server
2019-09-19 19:50:35 -05:00
Dustin 6e57abfe2e bitwarden_rs: Configure BURP client
This commit configures *bw0.pyrocufflink.blue* as a BURP client, so that
the Bitwarden data can be backed up.  A pre-backup script is used to
take a consistent snapshot of the SQLite database before copying it to
the BURP server.
2019-09-19 19:27:30 -05:00
Dustin 9306252e75 hosts: Add bw0.p.b
*bw0.pyrocufflink.blue* runs Bitwarden_rs via Docker.
2019-09-19 19:27:30 -05:00