This is a written from scratch project to have a default Ansible connection plugin to interact with Qubes OS. There is also an Ansible module to create/destroy/maintain state of the VM(s).
Read it online, it has better commands and setup instructions than the README file.
Put the ansible_module
directory in a known place; in our example,
we will put it in /usr/share/ansible_module
.
Remember that this project will only from dom0 or any VM with AdminAPI access.
Install Ansible whichever way you like. In Qubes 4.2 dom0 it would be,
sudo qubes-dom0-update ansible
Update your /etc/ansible/ansible.cfg
to have the following two lines.
[defaults]
library = /usr/share/ansible_module/
connection_plugins = /usr/share/ansible_module/conns/
Just keep in mind that creating/destroying vms will require a local connection and will use the qubesos module.
To work on a remote VM, use qubes connection and use standard playbooks.
Check the examples directory in this repo.
This project is still very young, and, the qubesos module is under heavy development so the syntax/keywords may change in future.
Please see the LICENSE file for a complete copy of License.