2025-06-10 13:40:55 +08:00

39 lines
1.8 KiB
Markdown

# 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
1. **Ansible:** Must be installed on the machine where you are running the playbook.
```bash
sudo apt update
sudo apt install ansible -y
```
2. **UFW Ansible Collection:** The playbook uses the `community.general.ufw` module. Install it if you don't have it:
```bash
ansible-galaxy collection install community.general
```
3. **Sudo Access:** Your user must have `sudo` privileges to run the playbook.
## How to Run
1. **Customize Variables (Optional):** Open `playbook.yml` and review the `vars` section. You can change the storage pool driver, network settings, etc. The defaults are sensible for a standard ZFS-based setup.
2. **Execute the Playbook:**
Run the following command from the same directory as the playbook file. It will prompt you for your `sudo` password to perform the administrative tasks.
```bash
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:
1. **Log Out and Log Back In:** To apply the `incus-admin` group membership to your user session, you **must log out and log back in**. Alternatively, for the current session only, you can run `newgrp incus-admin`.
2. **Access the Web UI:** Open a browser and navigate to `https://localhost:8443`. You will need to accept the self-signed certificate.
3. **Verify Setup:** You can test the installation by running `incus list`. If it runs without `sudo`, the setup is successful.