diff options
Diffstat (limited to 'roles/jails')
| -rw-r--r-- | roles/jails/01_ingress/templates/etc_pf.conf.j2 | 2 | ||||
| -rw-r--r-- | roles/jails/17_syncthing/defaults/main.yml | 12 | ||||
| -rw-r--r-- | roles/jails/20_immich/tasks/main.yml | 14 | ||||
| -rw-r--r-- | roles/jails/20_immich/templates/jail.conf.j2 | 12 | ||||
| -rw-r--r-- | roles/jails/20_immich/templates/usr_local_etc_immich_server.env.j2 | 4 |
5 files changed, 28 insertions, 16 deletions
diff --git a/roles/jails/01_ingress/templates/etc_pf.conf.j2 b/roles/jails/01_ingress/templates/etc_pf.conf.j2 index 1d8f4c8..5250f79 100644 --- a/roles/jails/01_ingress/templates/etc_pf.conf.j2 +++ b/roles/jails/01_ingress/templates/etc_pf.conf.j2 @@ -4,7 +4,7 @@ lan = "epl{{ jail.num }}b" wan = "epw{{ jail.num }}b" lan_net = "{{ lan_ipv4_network }}" -gemini_host = "{{ jail_lan_cidr | ipv4_nth(5 + jail_lan_offset | int) }}" +gemini_host = "{{ jail_ips.homepage }}" table <blocked> persist diff --git a/roles/jails/17_syncthing/defaults/main.yml b/roles/jails/17_syncthing/defaults/main.yml index 9e1f3f1..d7449c3 100644 --- a/roles/jails/17_syncthing/defaults/main.yml +++ b/roles/jails/17_syncthing/defaults/main.yml @@ -1,5 +1,10 @@ userland: "15.1-RELEASE" +zfs: + - name: syncthing_config + owner: "1001" + group: "1001" + nullfs: - src: storage/docs dst: /mnt/docs @@ -9,13 +14,6 @@ nullfs: dst: /mnt/jan-systems-2025-content - src: storage/projects-ableton dst: /mnt/projects-ableton - -zfs: - - name: syncthing_config - owner: "1001" - group: "1001" - -nullfs: - src: syncthing_config dst: /usr/local/etc/syncthing 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 }} |
