diff options
| -rw-r--r-- | filter_plugins/ipv4.py | 6 | ||||
| -rw-r--r-- | inventory/prod/hosts.yml | 2 | ||||
| -rw-r--r-- | roles/jails/01_ingress/defaults/main.yml | 9 | ||||
| -rw-r--r-- | roles/jails/01_ingress/tasks/main.yml | 2 | ||||
| -rw-r--r-- | roles/jails/05_homepage/defaults/main.yml | 1 | ||||
| -rw-r--r-- | roles/jails/12_goaccess/defaults/main.yml | 1 | ||||
| -rw-r--r-- | roles/jails/14_freshrss/defaults/main.yml | 1 |
7 files changed, 16 insertions, 6 deletions
diff --git a/filter_plugins/ipv4.py b/filter_plugins/ipv4.py index 1c42e82..0bf8c67 100644 --- a/filter_plugins/ipv4.py +++ b/filter_plugins/ipv4.py @@ -19,9 +19,9 @@ def ipv4_network(cidr): def ipv4_nth(cidr, n): - """Return the nth host address in a network. '10.0.20.0/24' | ipv4_nth(101) -> '10.0.20.101'""" - network = ipv4_network(cidr) - return _int_to_ip(_ip_to_int(network) + int(n)) + """Return the nth host address relative to the given IP. '192.168.2.0/16' | ipv4_nth(101) -> '192.168.2.101'""" + ip, _ = cidr.split("/") + return _int_to_ip(_ip_to_int(ip) + int(n)) def ipv4_nth_cidr(cidr, n): diff --git a/inventory/prod/hosts.yml b/inventory/prod/hosts.yml index eff5ecb..44ae3a0 100644 --- a/inventory/prod/hosts.yml +++ b/inventory/prod/hosts.yml @@ -15,8 +15,10 @@ all: jails: vars: ansible_jail_host: pursotin + ansible_host: pursotin jail_delegate_host: pursotin jail_lan_cidr: "192.168.2.0/16" jail_lan_offset: 0 + lan_ipv4_gateway: "192.168.0.1" ssl_enabled: true is_prod: true diff --git a/roles/jails/01_ingress/defaults/main.yml b/roles/jails/01_ingress/defaults/main.yml index 9761d43..e7a2fca 100644 --- a/roles/jails/01_ingress/defaults/main.yml +++ b/roles/jails/01_ingress/defaults/main.yml @@ -2,6 +2,10 @@ userland: "15.0-RELEASE" devfs_ruleset: 6 no_default_route: true +zfs: + - name: zroot/jails/volumes/ingress_letsencrypt + mountpoint: /usr/local/etc/letsencrypt + ingress_routes: - { host: jan.systems, jail: homepage } - { host: jantuomi.fi, redirect: jan.systems } @@ -34,9 +38,10 @@ jail_conf_options: nullfs: [] pkg: + - pcre2 - nginx - - py311-certbot - - py311-certbot-nginx + - py312-certbot + - py312-certbot-nginx files: - src: etc_pf.conf.j2 diff --git a/roles/jails/01_ingress/tasks/main.yml b/roles/jails/01_ingress/tasks/main.yml index 8248c3f..15992bd 100644 --- a/roles/jails/01_ingress/tasks/main.yml +++ b/roles/jails/01_ingress/tasks/main.yml @@ -28,7 +28,7 @@ - "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 }} dhclient 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" diff --git a/roles/jails/05_homepage/defaults/main.yml b/roles/jails/05_homepage/defaults/main.yml index ae37077..9412f75 100644 --- a/roles/jails/05_homepage/defaults/main.yml +++ b/roles/jails/05_homepage/defaults/main.yml @@ -1,6 +1,7 @@ userland: "15.0-RELEASE" pkg: + - pcre2 - nginx - rsync - bash diff --git a/roles/jails/12_goaccess/defaults/main.yml b/roles/jails/12_goaccess/defaults/main.yml index e61a925..f1e00be 100644 --- a/roles/jails/12_goaccess/defaults/main.yml +++ b/roles/jails/12_goaccess/defaults/main.yml @@ -10,6 +10,7 @@ nullfs: pkg: - goaccess + - pcre2 - nginx services: diff --git a/roles/jails/14_freshrss/defaults/main.yml b/roles/jails/14_freshrss/defaults/main.yml index a8c3b54..6804a0f 100644 --- a/roles/jails/14_freshrss/defaults/main.yml +++ b/roles/jails/14_freshrss/defaults/main.yml @@ -7,6 +7,7 @@ zfs: group: "80" pkg: + - pcre2 - nginx - php82 - php82-ctype |
