forked from CCCHH/ansible-infra
add jool_nat64 role
This commit is contained in:
parent
ca671bf3c2
commit
30420cf858
6 changed files with 60 additions and 0 deletions
8
roles/jool_nat64/README.md
Normal file
8
roles/jool_nat64/README.md
Normal 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
|
||||||
1
roles/jool_nat64/defaults/main.yml
Normal file
1
roles/jool_nat64/defaults/main.yml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
jool_nat64__prefix: "64:ff9b::/96"
|
||||||
5
roles/jool_nat64/handlers/main.yaml
Normal file
5
roles/jool_nat64/handlers/main.yaml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
- name: "restart jool"
|
||||||
|
become: true
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
name: "jool.service"
|
||||||
|
state: "restarted"
|
||||||
13
roles/jool_nat64/meta/argument_specs.yaml
Normal file
13
roles/jool_nat64/meta/argument_specs.yaml
Normal 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
|
||||||
27
roles/jool_nat64/tasks/main.yaml
Normal file
27
roles/jool_nat64/tasks/main.yaml
Normal 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
|
||||||
6
roles/jool_nat64/vars/main.yaml
Normal file
6
roles/jool_nat64/vars/main.yaml
Normal 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 }}"
|
||||||
Loading…
Reference in a new issue