aboutsummaryrefslogtreecommitdiff
path: root/infrastructure/roles
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2026-01-05 11:52:23 +0100
committeralex <alex@pdp7.net>2026-01-05 12:08:13 +0100
commit3d440014438c1b3bb741acaf17de631029227004 (patch)
tree48d6e0315e01fea2aad31301da8ab2a87c68f04c /infrastructure/roles
parentacadb5bbf9282f660d9b6e2706613eac4fd6aafe (diff)
Use self-signed cert when web server is not reachable
Also fix some punycode niggles
Diffstat (limited to 'infrastructure/roles')
-rw-r--r--infrastructure/roles/incus_provision/tasks/main.yaml2
-rw-r--r--infrastructure/roles/web/tasks/main.yaml8
2 files changed, 9 insertions, 1 deletions
diff --git a/infrastructure/roles/incus_provision/tasks/main.yaml b/infrastructure/roles/incus_provision/tasks/main.yaml
index 5ef6ad7..178687b 100644
--- a/infrastructure/roles/incus_provision/tasks/main.yaml
+++ b/infrastructure/roles/incus_provision/tasks/main.yaml
@@ -1,5 +1,5 @@
- 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 --vm
+ ansible.builtin.shell: incus info {{ ansible_incus_host }} || incus launch images:debian/13 {{ ansible_incus_host }} --vm
delegate_to: 127.0.0.1
- name: install python
ansible.builtin.raw: apt install -y python3
diff --git a/infrastructure/roles/web/tasks/main.yaml b/infrastructure/roles/web/tasks/main.yaml
index 92bb88f..f9c722a 100644
--- a/infrastructure/roles/web/tasks/main.yaml
+++ b/infrastructure/roles/web/tasks/main.yaml
@@ -30,12 +30,20 @@
ansible.builtin.copy:
dest: /etc/apache2/sites-enabled/ssl.conf
content: |
+ {% if web_server_reachable %}
MDomain {{ public_hostname_punycode }}
MDCertificateAgreement accepted
+ {% endif %}
<VirtualHost *:443>
ServerName {{ public_hostname_punycode }}
SSLEngine on
+
+ {% if not web_server_reachable %}
+ SSLCertificateFile "/etc/ssl/certs/ssl-cert-snakeoil.pem"
+ SSLCertificateKeyFile "/etc/ssl/private/ssl-cert-snakeoil.key"
+ {% endif %}
+
ServerAdmin {{ admin_email }}
<Location /vaultwarden/>