diff options
| author | alex <alex@pdp7.net> | 2026-01-03 14:13:42 +0100 |
|---|---|---|
| committer | alex <alex@pdp7.net> | 2026-01-03 14:13:42 +0100 |
| commit | 998a2fb1000cce3732af30cfdcf3923413091322 (patch) | |
| tree | 2ce6f862b139c04f7cfa1a8478e4a48e6fddc58d | |
| parent | f6afaa96b7adfadd8395104a822be06fda7ab041 (diff) | |
Draft Incus test environment
| -rw-r--r-- | infrastructure/README.md | 9 | ||||
| -rw-r--r-- | infrastructure/incus-test-local.yaml | 7 | ||||
| -rw-r--r-- | infrastructure/roles/incus_provision/tasks/main.yaml | 7 | ||||
| -rw-r--r-- | infrastructure/site.yaml | 4 |
4 files changed, 27 insertions, 0 deletions
diff --git a/infrastructure/README.md b/infrastructure/README.md index 56ba48d..bd49dcf 100644 --- a/infrastructure/README.md +++ b/infrastructure/README.md @@ -41,6 +41,15 @@ uv run ansible-playbook -K -i local-exec.yaml -i production.yaml site.yaml * The [git](roles/git) role to host Git repositories (https and Gitweb) * The [vaultwarden](roles/vaultwarden) role for secret management +## Testing + +With Incus installed, edit `local_incus.hosts.ñix.es.ansible_incus_project` in `incus-test-local.yaml` with your project from `incus project list`. +Then, you can use the following command to create a test container on Incus and deploy: + +``` +uv run ansible-playbook -i production.yaml -i incus-test-local.yaml site.yaml +``` + ## Notes ### Contabo Debian 13 diff --git a/infrastructure/incus-test-local.yaml b/infrastructure/incus-test-local.yaml new file mode 100644 index 0000000..1ed937d --- /dev/null +++ b/infrastructure/incus-test-local.yaml @@ -0,0 +1,7 @@ +local_incus: + hosts: + ñix.es: + ansible_connection: community.general.incus + ansible_incus_host: incus-test-xn--ix-yja-es + ansible_become: false + ansible_incus_project: user-1284000001 diff --git a/infrastructure/roles/incus_provision/tasks/main.yaml b/infrastructure/roles/incus_provision/tasks/main.yaml new file mode 100644 index 0000000..e4015a6 --- /dev/null +++ b/infrastructure/roles/incus_provision/tasks/main.yaml @@ -0,0 +1,7 @@ +- name: create incus container + ansible.builtin.shell: incus info incus-test-xn--ix-yja-es || incus launch images:debian/13 incus-test-xn--ix-yja-es + delegate_to: 127.0.0.1 +- name: install python + ansible.builtin.raw: apt install -y python3 + retries: 10 + delay: 3 diff --git a/infrastructure/site.yaml b/infrastructure/site.yaml index 2b5e78a..6adae90 100644 --- a/infrastructure/site.yaml +++ b/infrastructure/site.yaml @@ -1,4 +1,8 @@ --- +- hosts: local_incus + gather_facts: false + roles: + - incus_provision - hosts: all roles: - users |
