aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--infrastructure/README.md9
-rw-r--r--infrastructure/incus-test-local.yaml7
-rw-r--r--infrastructure/roles/incus_provision/tasks/main.yaml7
-rw-r--r--infrastructure/site.yaml4
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