aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/01_ingress/tasks
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-05-13 00:13:57 +0300
committerJan Tuomi <jan@jantuomi.fi>2026-05-16 18:42:27 +0300
commitb5860daf11ac353049cb1654b9414a129e5cfb96 (patch)
tree87ed89711e4f0e85ace0a97fa123199152c67302 /roles/jails/01_ingress/tasks
parent4715a28fdcd87440400d17154bfa361d99db29cc (diff)
Rework
Diffstat (limited to 'roles/jails/01_ingress/tasks')
-rw-r--r--roles/jails/01_ingress/tasks/main.yml49
1 files changed, 49 insertions, 0 deletions
diff --git a/roles/jails/01_ingress/tasks/main.yml b/roles/jails/01_ingress/tasks/main.yml
new file mode 100644
index 0000000..5b56286
--- /dev/null
+++ b/roles/jails/01_ingress/tasks/main.yml
@@ -0,0 +1,49 @@
+- name: Set WAN hooks (test)
+ set_fact:
+ exec_prestart:
+ - "ifconfig epw{{ jail_num }}a destroy 2>/dev/null || true"
+ - "ifconfig epair{{ jail_num }}001 create"
+ - "ifconfig epair{{ jail_num }}001a name epw{{ jail_num }}a"
+ - "ifconfig epair{{ jail_num }}001b name epw{{ jail_num }}b"
+ - "ifconfig brlan0 addm epw{{ jail_num }}a"
+ exec_poststart:
+ - "ifconfig epw{{ jail_num }}b vnet {{ jail_name }}"
+ - "ifconfig epw{{ jail_num }}a up"
+ - "jexec {{ jail_name }} ifconfig epw{{ jail_num }}b up"
+ - "jexec {{ jail_name }} ifconfig epw{{ jail_num }}b inet {{ ingress_wan_static }}"
+ - "jexec {{ jail_name }} route add default {{ lan_ipv4_gateway }}"
+ exec_poststop:
+ - "ifconfig epw{{ jail_num }}a destroy 2>/dev/null || true"
+ when: not is_prod
+
+- name: Set WAN hooks (prod)
+ set_fact:
+ exec_prestart:
+ - "ifconfig epw{{ jail_num }}a destroy 2>/dev/null || true"
+ - "ifconfig epair{{ jail_num }}001 create"
+ - "ifconfig epair{{ jail_num }}001a name epw{{ jail_num }}a"
+ - "ifconfig epair{{ jail_num }}001b name epw{{ jail_num }}b"
+ - "ifconfig brwan0 addm epw{{ jail_num }}a"
+ exec_poststart:
+ - "ifconfig epw{{ jail_num }}b vnet {{ jail_name }}"
+ - "ifconfig epw{{ jail_num }}a up"
+ - "jexec {{ jail_name }} ifconfig epw{{ jail_num }}b up"
+ - "jexec {{ jail_name }} service dhclient restart epw{{ jail_num }}b"
+ - "jexec {{ jail_name }} route add 10.6.210.0/24 {{ lan_ipv4_gateway }} || true"
+ exec_poststop:
+ - "ifconfig epw{{ jail_num }}a destroy 2>/dev/null || true"
+ when: is_prod
+
+- import_role:
+ name: jail
+
+- name: Check if TLS certs exist
+ stat:
+ path: "/usr/local/etc/letsencrypt/live/{{ cert_name }}"
+ register: _certbot_certs
+ when: is_prod
+
+- name: Pause for manual certbot setup
+ pause:
+ prompt: "Run certbot manually in the ingress jail to obtain certs, then press Enter."
+ when: is_prod and not (_certbot_certs.stat.exists | default(true))