Ansible Playbook for Local Incus Installation
This playbook automates the installation and setup of the stable version of Incus on the local machine (Debian/Ubuntu). It is designed to be run directly on the server you wish to configure.
Prerequisites
- Ansible: Must be installed on the machine where you are running the playbook.
sudo apt update sudo apt install ansible -y - Sudo Access: Your user must have
sudoprivileges to run the playbook.
How to Run
-
Customize Variables (Optional): Open
playbook.ymland review thevarssection. -
Execute the Playbook: Run the following command from the same directory as the playbook file. It will prompt you for your
sudopassword to perform the administrative tasks.ansible-playbook playbook.yml --ask-become-pass--ask-become-pass: This flag tells Ansible to prompt for the password needed for privilege escalation (sudo).
Post-Installation Steps
After the playbook completes successfully:
-
Configure User Access:
Add your user to incus-admin group
sudo usermod -aG incus-admin $USERTo refresh group membership.
newgrp incus-admin -
Initialize Incus: Run the interactive initialization and follow the prompts to configure storage pools, networks, and other settings.
incus admin init -
Verify Setup: You can test the installation by running.
incus list -
Access the Incus Web UI: Ensure Incus is listening on the network:
incus config set core.https_address :8443 -
Setup Firewall for ufw (Optional: only if you are using ufw): Ensure Incus is listening on the network:
sudo ufw allow in on incusbr0 sudo ufw route allow in on incusbr0 sudo ufw route allow out on incusbr0 -
Incus Network - Access Containers by Name (Optional): Configuring name-to-IP resolution so the host OS can reach Incus containers using their names.
ansible-playbook incus-network.yml --ask-become-pass