add jool_nat64 role

This commit is contained in:
lilly 2026-12-06 02:25:09 +01:00
commit 30420cf858
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g
6 changed files with 60 additions and 0 deletions

View file

@ -0,0 +1,8 @@
# jool_nat64
A small role which installs and configures [jool](https://www.jool.mx/en/index.html) (a NAT64 daemon) on debian.
## Options
- `jool_nat64__prefix`: IPv6 prefix to expect embedded addresses in and which gets translated to IPv4
- `jool_nat64__settings`: Raw settings file passed to jool; normally autogenerated but can be overwritten

View file

@ -0,0 +1 @@
jool_nat64__prefix: "64:ff9b::/96"

View file

@ -0,0 +1,5 @@
- name: "restart jool"
become: true
ansible.builtin.systemd_service:
name: "jool.service"
state: "restarted"

View file

@ -0,0 +1,13 @@
argument_specs:
main:
options:
jool_nat64__prefix:
description: "IPv6 prefix to expect embedded addresses in and which gets translated to IPv4"
required: false
default: "64:ff9b::/96"
type: str
jool_nat64__settings:
descriptions: "Raw settings file passed to jool; normally autogenerated but can be overwritten"
required: false
type: dict

View file

@ -0,0 +1,27 @@
- tags: [ jool_nat64, jool, nat64 ]
block:
- name: Install jool
become: true
ansible.builtin.apt:
name: [ linux-headers-amd64, jool-dkms, jool-tools ]
- name: Create jool configuration directory
become: true
ansible.builtin.file:
path: /etc/jool
state: directory
- name: Configure jool
become: true
notify: "restart jool"
ansible.builtin.copy:
content: "{{ jool_nat64__settings | to_json }}"
dest: "/etc/jool/jool.conf"
- name: Ensure jool is running and enabled
become: true
ansible.builtin.systemd_service:
name: "jool.service"
state: "started"
enabled: true

View file

@ -0,0 +1,6 @@
# https://www.jool.mx/en/config-atomic.html
jool_nat64__settings:
instance: "default"
framework: "netfilter"
global:
pool6: "{{ jool_nat64__prefix }}"