aboutsummaryrefslogtreecommitdiff
path: root/infrastructure
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2026-01-07 19:36:51 +0100
committeralex <alex@pdp7.net>2026-01-07 19:36:51 +0100
commit8581f1ba8a760660af3286798ad695350ce59ec4 (patch)
tree8e613eabd6a3fab85e8f1d7875243108b4c54121 /infrastructure
parent362b7f6e0c05d44795f2e7728a1fb085dcd776e5 (diff)
Remove hardcoded uid
Diffstat (limited to 'infrastructure')
-rw-r--r--infrastructure/README.md3
-rw-r--r--infrastructure/incus-test-local.yaml1
-rw-r--r--infrastructure/roles/incus_provision/tasks/main.yaml7
3 files changed, 8 insertions, 3 deletions
diff --git a/infrastructure/README.md b/infrastructure/README.md
index 10e54e6..b040c57 100644
--- a/infrastructure/README.md
+++ b/infrastructure/README.md
@@ -46,8 +46,7 @@ Refer to the documentation of each Ansible role to learn about user functionalit
## 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 VM on Incus and deploy:
+Use the following command to create a test VM on Incus and deploy:
```
uv run ansible-playbook -i production.yaml -i incus-test-local.yaml site.yaml
diff --git a/infrastructure/incus-test-local.yaml b/infrastructure/incus-test-local.yaml
index bede2d4..d68c547 100644
--- a/infrastructure/incus-test-local.yaml
+++ b/infrastructure/incus-test-local.yaml
@@ -4,7 +4,6 @@ local_incus:
ansible_connection: community.general.incus
ansible_incus_host: xn--incus-test-ix-es-hub
ansible_become: false
- ansible_incus_project: user-1284000001
web_server_reachable: false
public_hostname: incus-test-ñix-es
public_hostname_punycode: xn--incus-test-ix-es-hub
diff --git a/infrastructure/roles/incus_provision/tasks/main.yaml b/infrastructure/roles/incus_provision/tasks/main.yaml
index 178687b..7b54f9e 100644
--- a/infrastructure/roles/incus_provision/tasks/main.yaml
+++ b/infrastructure/roles/incus_provision/tasks/main.yaml
@@ -1,6 +1,13 @@
- name: create incus container
ansible.builtin.shell: incus info {{ ansible_incus_host }} || incus launch images:debian/13 {{ ansible_incus_host }} --vm
delegate_to: 127.0.0.1
+- name: fetch your user id to identify incus project
+ ansible.builtin.command: id -u
+ delegate_to: 127.0.0.1
+ register: uid
+- name: set incus project
+ ansible.builtin.set_fact:
+ ansible_incus_project: user-{{ uid.stdout }}
- name: install python
ansible.builtin.raw: apt install -y python3
retries: 10