aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/20_immich/templates/jail.conf.j2
blob: 47a045439730dbc2d9b6c923d18aeeea323c1a15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{{ jail.name }} {
  vnet;
  exec.clean;
  allow.raw_sockets;
  mount.devfs;
  enforce_statfs = 1;

  devfs_ruleset = 4;
  host.hostname = "${name}";
  path = "/usr/local/jails/containers/${name}";

  exec.start = "/bin/sh /etc/rc";
  exec.stop  = "/bin/sh /etc/rc.shutdown";

  # Networking
  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 jail.nullfs %}
  mount += "{{ mount.src }}  ${path}{{ mount.dst }}  nullfs  {{ mount.mode | default('rw') }}  0  0";
{% endfor %}
{% for img in oci_images %}

  # Mounts for {{ img.name }} rootfs
  mount += "linprocfs $path/image/{{ img.name }}/proc  linprocfs rw 0 0";
  mount += "linsysfs  $path/image/{{ img.name }}/sys   linsysfs  rw 0 0";
  mount += "devfs     $path/image/{{ img.name }}/dev   devfs     rw 0 0";
  mount += "tmpfs     $path/image/{{ img.name }}/tmp   tmpfs     rw 0 0";
  mount += "tmpfs     $path/image/{{ img.name }}/run   tmpfs     rw 0 0";
{% endfor %}
}