aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/20_immich
diff options
context:
space:
mode:
Diffstat (limited to 'roles/jails/20_immich')
-rw-r--r--roles/jails/20_immich/tasks/main.yml14
-rw-r--r--roles/jails/20_immich/templates/jail.conf.j212
-rw-r--r--roles/jails/20_immich/templates/usr_local_etc_immich_server.env.j24
3 files changed, 22 insertions, 8 deletions
diff --git a/roles/jails/20_immich/tasks/main.yml b/roles/jails/20_immich/tasks/main.yml
index 39decd1..cac290e 100644
--- a/roles/jails/20_immich/tasks/main.yml
+++ b/roles/jails/20_immich/tasks/main.yml
@@ -10,6 +10,20 @@
owner: root
group: wheel
mode: "0644"
+ vars:
+ jail:
+ name: "{{ jail_name }}"
+ num: "{{ jail_num }}"
+ ip: "{{ jail_ips[jail_name] }}/{{ jail_lan_cidr | ipv4_prefixlen }}"
+ devfs_ruleset: "{{ devfs_ruleset | default(4) }}"
+ options: "{{ jail_conf_options | default([]) }}"
+ exec_prestart: "{{ exec_prestart | default([]) }}"
+ exec_start: "{{ exec_start | default([]) }}"
+ exec_poststart: "{{ exec_poststart | default([]) }}"
+ exec_prestop: "{{ exec_prestop | default([]) }}"
+ exec_stop: "{{ exec_stop | default([]) }}"
+ exec_poststop: "{{ exec_poststop | default([]) }}"
+ nullfs: "{{ nullfs | default([]) | normalize_nullfs }}"
delegate_to: "{{ jail_delegate_host }}"
# Deploy extraction script
diff --git a/roles/jails/20_immich/templates/jail.conf.j2 b/roles/jails/20_immich/templates/jail.conf.j2
index 8e3c626..fb7f363 100644
--- a/roles/jails/20_immich/templates/jail.conf.j2
+++ b/roles/jails/20_immich/templates/jail.conf.j2
@@ -1,4 +1,4 @@
-immich {
+{{ jail.name }} {
vnet;
persist;
exec.clean;
@@ -20,13 +20,13 @@ immich {
exec.stop = "/bin/sh /etc/rc.shutdown";
# Networking
- exec.prestart += "jail_net prestart {{ jail_num }} ${name}";
- exec.poststart += "jail_net poststart {{ jail_num }} ${name}";
- exec.prestop += "jail_net prestop {{ jail_num }} ${name}";
- exec.poststop += "jail_net poststop {{ jail_num }} ${name}";
+ exec.prestart += "jail_net prestart ${name} {{ jail.num }} {{ jail.ip }}";
+ exec.poststart += "jail_net poststart ${name} {{ jail.num }} {{ jail.ip }}";
+ exec.prestop += "jail_net prestop ${name} {{ jail.num }} {{ jail.ip }}";
+ exec.poststop += "jail_net poststop ${name} {{ jail.num }} {{ jail.ip }}";
# nullfs mounts
-{% for mount in nullfs | default([]) | normalize_nullfs %}
+{% for mount in jail.nullfs %}
mount += "{{ mount.src }} ${path}{{ mount.dst }} nullfs {{ mount.mode | default('rw') }} 0 0";
{% endfor %}
{% for img in oci_images %}
diff --git a/roles/jails/20_immich/templates/usr_local_etc_immich_server.env.j2 b/roles/jails/20_immich/templates/usr_local_etc_immich_server.env.j2
index 87c563d..5712234 100644
--- a/roles/jails/20_immich/templates/usr_local_etc_immich_server.env.j2
+++ b/roles/jails/20_immich/templates/usr_local_etc_immich_server.env.j2
@@ -5,14 +5,14 @@ IMMICH_PORT=80
NODE_ENV=production
# Database
-DB_HOSTNAME={{ jail_lan_cidr | ipv4_nth(2 + jail_lan_offset | int) }}
+DB_HOSTNAME={{ jail_ips.postgres }}
DB_PORT=5432
DB_USERNAME=immich
DB_PASSWORD={{ pg_user_passwords.immich }}
DB_DATABASE_NAME=immich
# Redis
-REDIS_HOSTNAME={{ jail_lan_cidr | ipv4_nth(9 + jail_lan_offset | int) }}
+REDIS_HOSTNAME={{ jail_ips.redis }}
REDIS_PORT=6379
REDIS_PASSWORD={{ valkey_password }}