Commit Graph

9 Commits (a23bb1f043fe9709370e8ae63e682e14002dc93c)

Author SHA1 Message Date
Dustin 7ff18ab75e Introduce dynamic inventory
In order to fully automate host provisioning, we need to eliminate the
manual step of adding hosts to the Ansible inventory.  Ansible has had
the _community.libvirt.libvirt_ inventory plugin for quite a while, but
by itself it is insufficient, as it has no way to add hosts to groups
dynamically.  It does expose the domain XML, but parsing that and
extracting group memberships from that using Jinja templates would be
pretty terrible.  Thus, I decided the easiest and most appropriate
option would be to develop my own dynamic inventory plugin.

* Supports multiple _libvirt_ servers
* Can connect to the read-only _libvirt_ socket
* Can optionally exclude VMs that are powered off
* Can exclude VMs based on their operating system (if the _libosinfo_
  metadata is specified in the domain metadata)
* Can add hosts to groups as specified in the domain metadata
* Exposes guest info as inventory host variables (requires QEMU guest
  agent running in the VM and does not work with a read-only _libvirt_
  connection)
2025-02-08 15:29:58 -06:00
Dustin 143c96074e callbacks: Enable ARA
[ARA Records Ansible][0] is a web-based reporting tool for Ansible.  It
consists of a callback plugin that submits task/playbook results to an
HTTP API and a browser GUI to display them.

[0]: https://ara.recordsansible.org/
2025-02-01 17:36:58 -06: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 02653f7e7c ansible.cfg: Disable stupid group name warning
For some reason, Ansible developers felt like it was important that
users name their host groups according to Python identifier naming
conventions.  This prevents, among other things, hyphens from being used
in group names.  Luckily, this ridiculous behavior is configurable.
2019-09-19 19:50:35 -05:00
Dustin 30ec841cad ansible.cfg: Fix remote_tmp
Newer versions of ansible no longer require a single top-level temporary
directory per user, as each run creates its own. Combined with the weird
random failures on *dc0.pyrocufflink.blue* that prevent Jenkins from
using Ansible occasionally, it's better to just let Ansible create its
own temporary directory directly in `/var/tmp` and clean up after itself
when it finishes.
2018-05-19 10:20:22 -05:00
Dustin 55128cded7 ansible.cfg: Unset vault_password_file
Apparently, the `vault_password_file` setting in `ansible.cfg` overrides
the `--vault-password-file` command-line argument, which breaks the
Jenkins `ansiblePlaybook` task.
2018-04-14 15:57:50 -05:00
Dustin 6d9406e389 ansible.cfg: Set remote_tmp
Many hosts (should) have `/tmp` mounted with the `noexec` flag, which
prevents Ansible modules written there from running. To work around
this, the `remote_tmp` configuration option should be set to a path
under `/var/tmp`, which is not mounted noexec.
2018-04-08 14:26:53 -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