Commit Graph

7 Commits (master)

Author SHA1 Message Date
Dustin b9a046c7f4 plugins: Add lookup cache plugin
One major weakness with Ansible's "lookup" plugins is that they are
evaluated _every single time they are used_, even indirectly.  This
means, for example, a shell command could be run many times, potentially
resulting in different values, or executing a complex calculation that
always provides the same result.  Ansible does not have a built-in way
to cache the result of a `lookup` or `query` call, so I created this
one.  It's inspired by [ansible-cached-lookup][0], which didn't actually
work and is apparently unmaintained.  Instead of using a hard-coded
file-based caching system, however, my plugin uses Ansible's
configuration and plugin infrastructure to store values with any
available cache plugin.

Although looking up the _pyrocufflink.net_ wildcard certificate with the
Kubernetes API isn't particularly expensive by itself right now, I can
envision several other uses that may be.  Having this plugin available
could speed up future playbooks.

[0]: https://pypi.org/project/ansible-cached-lookup
2025-07-13 16:02:57 -05:00
Dustin a3a2dde6ab callbacks: Add ntfy callback plugin
This plugin sends a notification using _ntfy_ whenever a playbook
fails.  This will be useful especially for automated deployments when
the playbook was not launched manually.
2025-02-01 17:36:58 -06:00
Dustin 319cc80a9f inventory: Configure for HostVDS openstack
Using the Ansible OpenStack inventory plugin, we can automatically fetch
information about running instances in HostVDS.  We're deriving group
membership from the `groups` metadata tag.

The OpenStack API password must be specified in a `secure.yaml` file.
We're omitting this from the repository because there's no apparent way
to encrypt it.

The inventory plugin tends to prefer IPv6 addresses over IPv4 when
populating `ansible_host`, even if the control machine does not have
IPv6 connectivity.  Thus, we have to compose the relevant variables
ourselves with a Jinja2 expression.
2025-01-26 13:08:59 -06:00
Dustin 1e14dd7905 r/blackbox-exporter: Deploy blackbox_exporter
The Prometheus *blackbox_exporter* is a tool that can perform arbitrary,
generic ICMP, TCP, or HTTP "probes" against external services.  This is
useful for applications that do not export their own metrics, and for
evaluating the health of protocol-level operations (e.g. TLS
certificate expiration).

The *blackbox-exporter* Ansible role installs and configures the
Blackbox Exporter on the target system.  It fetches the specified binary
release from Github and copies it to the remote machine.  It also
creates a systemd unit and configures the Blackbox exporter's "modules"
from the `blackbox_modules` Ansible variable.
2022-08-10 22:18:53 -05:00
Dustin 0785fda26b r/v-m: Add role for Victoria Metrics
The *victoria-metrics* role deploys a single-server instance of the
Victoria Metrics time series database server.  It installs the selected
version by downloading the binary release from Github and copying it to
`/usr/local/sbin` on the managed node.  Scrape configuration is optional
and can be specified with the `scrape_configs` variable.
2022-08-10 19:47:12 -05:00
Dustin 20fb830eda Protect vault secret with GPG
Encrypting the vault password with GPG protects the key when stored on
disk and allows it to be accessed non-interactively, as long as the
GnuPG agent is set up correctly.
2018-01-29 15:11:07 -06:00
Dustin 7f86881b7c Initial commit 2018-01-02 23:36:42 -06:00