Commit Graph

932 Commits (b6cc83ad8205c64ba0504f9aee899b6afc460bbd)

Author SHA1 Message Date
Dustin 82f9ce0797 group_vars/frigate: Keep back yard recordings
We're trying to discover how the possums are getting into and out of the
house.  Let's enable continuous video recording from the back yard
camera so we can observe them and come up with a plan to get rid of
them.
2022-07-18 18:20:21 -05:00
Dustin 14332a4c3e remount: Clear facts
Cached facts interfere with the detection of which filesystems need to
be remounted.  We need to clear them all and gather again before
beginning to ensure that the correct mounts are considered.
2022-07-18 18:05:03 -05:00
Dustin 5f6e2e774c hosts: Remove build2-armv7hl
This machine has a hardware problem.
2022-07-05 20:30:19 -05:00
Dustin a3608f187c home-assistant: Enable Mosquitto persistence
Configuring Mosquitto to persist its state to the filesystem will keep
retained messages from MQTT sensors, etc.
2022-05-29 11:26:39 -05:00
Dustin e7534d36cf r/mosquitto: Support persistence
Mosquitto can save retained messages, persistent clients, etc. to the
filesystem and restore them at startup.  This allows state to be
maintained even after the process restarts.
2022-05-29 11:25:25 -05:00
Dustin 24228953b0 r/samba-dc: Configure logrotate for KDC
The KDC service, as managed by Samba, continuously logs to two files
that need to be rotated.  The upstream configuration for logrotate only
manages one of these files, and does not correctly signal the service
after rotating, as it expects the service to be managed by systemd
instead of Samba.  As such, we need to adjust the configuration to
handle both files and send SIGHUP directly to the process.
2022-04-24 11:37:13 -05:00
Dustin d363026db2 websites: dustin.hatch.name: Deploy new site
Promoting the new site I have been working on at *dustin.hatch.is* to my
main domain, *dustin.hatch.name*.  The new site is just static content,
generated and uploaded by a Jenkins job.

Finally have a certificate for *dustin.hatch.name* now, too!
2022-04-23 15:30:40 -05:00
Dustin 3c8e576841 grafana: Enable anonymous access
Allow unauthenticated users to view dashboards.  Useful for Heads-Up
Displays.
2022-03-07 20:10:13 -06:00
Dustin 5e2cfee8a1 r/protonvpn: watchdog: Improve error handling
This resolves two issues with fetching the Proton VPNserver list:

1. If a connection error occurs when fetching the list, it will be
   ignored, just as with HTTP errors
2. If any errors are encountered when fetching the list, and a valid
   cache was loaded, its contents are returned, regardless of the
   timestamp of the cache file.
2022-03-01 21:28:21 -06:00
Dustin 5485fc6f93 websites/d…and…t: Configure formsubmit
To handle the RSVP form on *dustinandtabitha.com*, we are going to use
*formsubmit*.  It runs on the same machine that hosts the website, so
there's no dealing with CORS.  The */submit/rsvp* path, which is proxied
to the backend, is the RSVP form's target.
2022-02-27 17:56:54 -06:00
Dustin b350698148 r/formsubmit: Deploy formsubmit app
*formsubmit* is a simple, customizable HTML for submission handler.  I
designed it for Tabitha to use to collect information from forms on her
websites.  Notably, we will use it for the RSVP page on our wedding
invitation site.
2022-02-27 17:42:15 -06:00
Dustin 3632698f37 websites/dustinandtabitha.com: Add role
Wedding website 😍
2022-02-27 17:41:40 -06:00
Dustin 6f29235387 burp: Add missing client password for hass2 2022-01-22 12:19:47 -06:00
Dustin c12da40228 home-assistant: Correct BURP exclude syntax
BURP does not support relative paths or globs in `exclude` values.
2022-01-16 10:08:27 -06:00
Dustin 5efbee725e home-assistant: Omit history DB from backups
The state history database is entirely too big.  It takes over an hour
to create a backup of it, which usually causes BURP to time out.  The
data it stores isn't particularly interesting anyway.  Instead of trying
to back it up and ultimately not getting any backup at all, we'll just
skip it altogether to ensure we have a consistent backup of everything
else that is actually important.
2022-01-02 12:07:12 -06:00
Dustin d8bb629c5d r/frigate: Ensure service starts at boot
Missing a task to enable the *frigate.service* unit meant that the
service would not start automatically when the machine booted.
2021-12-30 09:35:14 -06:00
Dustin 2b27a31bee frigate: Update config syntax for 0.9.x
There were several backward-incompatible changes introduced in Frigate
[0.9.0](https://github.com/blakeblackshear/frigate/releases/tag/v0.9.0).
Notably, recordings and clips are now configured together.
2021-12-30 09:33:58 -06:00
Dustin 952050e326 certs/samba: dc2: Add CA chain
The intermediate CA certificate was not included in the certificate file
used by Samba, so LDAP/TLS connections would fail with a trust
validation error.
2021-12-23 11:44:30 -06:00
Dustin dfa61c8a73 r/nextcloud: Increase Apache timeout
Uploading large files can take a very long time.  If the process takes
longer than the configured timeout in Apache, it will be aborted and the
client will receive an HTTP 504 Gateway Timeout error.  Increasing the
timeout will help alleviate this for files up to a certain size.
Notably, it now lets me upload Signal backups without errors.
2021-12-22 11:28:52 -06:00
Dustin 6acb25e309 nextcloud: Trust headers from public rev proxy
If Nextcloud does not have the Internet-facing reverse proxy listed in
its "trusted proxies" setting, it will mark all traffic as being from
the proxy itself.  This breaks brute force detection, etc.
2021-12-20 22:20:09 -06:00
Dustin 7d7dda6061 r/nextcloud: Dynamically set version in config
Nextcloud thinks it needs to run the upgrade/migration tool if the
version number in its configuration file does not match the running
version.  It then updates the config file with the correct version. The
next time the configuration policy is applied, however, the version will
revert back to whatever is set in the template.  This will re-trigger
the upgrade notification.

To avoid this problem, we now set the version in the configuration file
dynamically.  Nextcloud writes its version number in a constant in
`version.php`.
2021-12-20 22:18:14 -06:00
Dustin 7ab3787798 r/nextcloud: Correct memcache config syntax
Nextcloud uses double backslashes in its fully-qualified path names.
Although single backslashes work, the application will replace them,
leading to a constant conflict between itself and the Ansible template.
2021-12-20 22:15:53 -06:00
Dustin e55fc8f5af r/homeassistant et al.: Increase start timeout
The first time launching a container after pulling a new image, it can
take several minutes for the container to actually start.  Podman has to
set up the overlay filesystems, which is very slow on a Raspberry Pi.

With the default start timeout, systemd may end up killing the process
before the container is completely set up.  Thus, we need to increase
the timeout to ensure there is plenty of time for Podman to work.
2021-12-20 09:59:14 -06:00
Dustin f8e3bdade0 r/z*2mqtt: Fix device node contexts at start
Processes running in containers only have access to a limited set of
devices, based on their SELinux type label.  The USB serial devices
exposed by the Zwave and Zigbee adapters are not labelled correctly by
default to allow them to be used in containers.

Using `chcon` to change the type label of the device before starting the
container seems to work, but seems a bit kludgy.  It would probably be
better to use a SELinux file context rule and/or a udev rule to ensure
the label is set correctly when the device node is created.
2021-12-18 16:45:53 -06:00
Dustin 6f9ff86788 r/homeassistant: Wait for network to start
Although Home Assistant itself will start fine if the network is not yet
available, some integrations will not.  Notably, the Matrix integration
will fail to load if it cannot contact the homeserver when it is first
initialized.  To avoid this problem, we can just delay starting Home
Assistant until the network is available.
2021-12-18 16:45:53 -06:00
Dustin 1f9e13a33b r/z*2mqtt: Wait for network before starting
The Zigbee2MQTT and ZWaveJS2MQTT servers do not start correctly if the
network is not yet available.
2021-12-18 16:45:52 -06:00
Dustin d446653296 homeassistant: Split out Zigbee/Zwave playbooks
To make it simpler to apply policy specifically for Zibgee2MQTT or
ZWaveJS2MQTT, I've split them into their own playbooks.
2021-12-18 16:45:52 -06:00
Dustin 74deb895ae pyrocufflink-dns: Remove dc0 forwarder
Decommissioning *dc0.pyrocufflink.blue*.  Do not forward requests for
internal domain names to it.
2021-12-18 16:44:48 -06:00
Dustin 62ca80a5f0 pyrocufflink-dns: Remove FireMon zones
There is no longer any point to having forward zones in the main DNS
server for FireMon domains, since we don't have a network-wide VPN
anymore.
2021-12-18 10:51:17 -06:00
Dustin 739ffb2845 home-assistant: Configure BURP backups
Take a snapshot of the history database first, then back up everything
in `/var/lib/homeassistant`.
2021-12-17 20:57:38 -06:00
Dustin fdfdaa6fe6 bitwarden_rs: Update burp backup path
Vaultwarden data are stored in a different location since the migration
to Podman.
2021-12-17 20:33:31 -06:00
Dustin 3f99708c48 cloud0: burp backup paths
Nextcloud data are no longer stored at `/var/www/html` since switching
to the Fedora-packaged distribution.
2021-12-17 20:22:42 -06:00
Dustin 80b267d6e5 r/burp: Enable progress counter for ad-hoc runs
Before the `burp` tool gained the `-Q` option, the only way to disable
the progress counter was through the configuration file.  Since we do
not want any output from automatic backups (except of course
catastrophic failures), since it would end up being e-mailed by cron,
the progress counter had to be disabled globally.  This meant that
on-demand runs on a terminal could not have a progress counter, which
was pretty disappointing.

Now that `burp` has `-Q`, this is no longer the case.  Scheduled backups
can run with `-Q`, but ad-hoc runs can omit it to get a progress
counter.
2021-12-17 20:19:30 -06:00
Dustin b62f08ccd4 ci: gitea: Convert to cfgpol shared library 2021-11-13 09:49:24 -06:00
Dustin 9fab49928d ci: Update container image to Fedora 34 2021-11-09 18:07:59 -06:00
Dustin 9d3c5c0da7 samba-dc: Apply to one machine at a time
Avoid accidentally taking down the whole domain with a bad task.  It'll
fail on one DC and never change the other(s).
2021-11-07 16:20:03 -06:00
Dustin 948079dafa r/samba-dc: Configure samba logging
Send logs to the systemd journal for easier viewing and disable logging
to a file.  Also, the `samba_dc_log_level` variable can control the log
level (0-10, 0 being off, 10 being insane debugging).
2021-11-07 16:18:51 -06:00
Dustin 14c7b1fcc1 bitwarden_rs: Update collectd process name
`bitwarden_rs` is now named `vaultwarden`.
2021-11-06 19:42:07 -05:00
Dustin e3b5b4d5ff r/bitwarden_rs: Migrate to podman
Docker is effectively deprecated by Fedora/Red Hat.  It is a pain in the
ass to work with anyway.  Podman integrates better with systemd, and is
in general more aligned with how I prefer to deploy and manage
applications.

I am following the same pattern here that I have used for Home
Assistant, ZWaveJS2MQTT, etc.  The systemd service starts the container
with `podman`, passing the necessary arguments for UID/GID mapping, etc.
Note that, by default, Vaultwarden expects to be able to bind to port
80; since the container is unprivileged, we have to configure it (or
rather, its embedded HTTP server [Rocket](https://rocket.rs)) to listen
on a different port.  We also configure it to listen only on the
loopback, since it is being proxied by Apache to the outside network.

To migrate the data from the Docker volume, we just have to copy the
files and fix their ownership.

The *bitwarden_rs* project was recently renamed to *Vaultwarden*, so I
took this opportunity to update the name in most places within the
*bitwarden_rs* role.
2021-11-06 19:33:33 -05:00
Dustin 9f41f239e2 ci: Fix remount r/o stage name 2021-11-06 18:15:02 -05:00
Dustin d39b2bcb19 r/winbind: Add domain-join tag
Sometimes I need to configure a machine to be a domain member without
actually adding it to the domain.  Now I can by running
`ansible-playbook` with `--skip-tags domain-join`
2021-11-06 18:12:29 -05:00
Dustin 3f9b8c1d9b r/vmhost: Install libvirt storage driver
The *libvirt-daemon-driver-storage-core* package provides the libvirt
plugin needed for storage management, e.g. `virsh blockresize`.
2021-11-06 18:10:32 -05:00
Dustin 150798cbd5 ci: Clear fact cache before every run
Since the `remount.yml` playbook now tries to avoid redundant remounts,
it needs up-to-date facts about mounted filesystems and their options.
If the cached facts are out of date, it may incorrectly skip remounting
a filesystem.  Besides, having up-to-date facts in the CI pipeline is
probably a good thing anyway.
2021-11-02 07:30:00 -05:00
Dustin 7bb1eb677e r/samba-dc: Use rfc2307 on all DCs
I honestly don't remember why the `use rfc2307` setting was only enabled
on the first DC.  All DCs seem to need this setting in order to use the
UID/GID numbers from the directory, instead of using auto-generated
numbers.
2021-10-31 21:07:49 -05:00
Dustin 803fd5ef2a r/systemd-networkd: Enable and start the service
Obviously, the *systemd-networkd* service needs to be running in order
for it to manage the network connections.
2021-10-31 14:29:30 -05:00
Dustin c882ac45e7 nut: Add playbook for NUT
NUT runs on *serial0.pyrocufflink.blue* and monitors the two UPSes on
the server rack.
2021-10-31 14:28:27 -05:00
Dustin ff7c58ae71 r/collectd-nut: Configure nut plugin for collectd
The *nut* plugin for *collectd* fetches data from Network UPS Tools.
This is useful for monitoring UPS statistics over time.
2021-10-31 14:26:26 -05:00
Dustin 4beade5465 r/nut: Add role for Network UPS Tools
The *nut* role installs and configures Network UPS Tools.
2021-10-31 14:25:59 -05:00
Dustin 19330ac555 r/protonvpn: watchdog: reconfigure at startup
If the remote address configuration for strongSwan is not valid when the
Proton VPN watchdog starts, it will now regenerate it immediately.  This
can happen, for example, if the Internet has been down for a while, and
the watchdog has iterated through all of the servers in the cache.
Restarting the service will now force it to reconfigure the tunnel and
bring the VPN back up.
2021-10-31 01:24:52 -05:00
Dustin 328f2fa586 hosts: Set up collectd/Prometheus on vmhosts
The groups in `hosts.offline` need to match those in `hosts`.
Specifically, the *collectd* group needs to be a child of the
*collectd-prometheus* group so that the *write_prometheus* plugin is
installed and configured on hosts defined in this inventory file.
2021-10-31 01:13:50 -05:00