-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Georg Pfuetzenreuter <[email protected]>
- Loading branch information
Showing
5 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Salt states for TAYGA | ||
|
||
## Available states | ||
|
||
`tayga` | ||
|
||
Installs and configures [TAYGA](http://www.litech.org/tayga/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
summary: | ||
Salt states for managing TAYGA | ||
description: | ||
Salt states for managing the TAYGA NAT64 daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{{ pillar.get('managed_by_salt_formula', '# Managed by the TAYGA formula') }} | ||
|
||
{#- SUSE default settings #} | ||
data-dir /var/lib/tayga | ||
|
||
{#- Mandatory settings #} | ||
tun-device {{ tayga.get('tun-device', 'nat64') }} | ||
|
||
{#- Optional settings #} | ||
{%- if 'ipv4-addr' in tayga %} | ||
ipv4-addr {{ tayga['ipv4-addr'] }} | ||
{%- endif %} | ||
{%- if 'ipv6-addr' in tayga %} | ||
ipv6-addr {{ tayga['ipv6-addr'] }} | ||
{%- endif %} | ||
|
||
{%- if 'prefix' in tayga %} | ||
prefix {{ tayga['prefix'] }} | ||
{%- endif %} | ||
|
||
{%- if 'dynamic-pool' in tayga %} | ||
dynamic-pool {{ tayga['dynamic-pool'] }} | ||
{%- endif %} | ||
|
||
{%- if 'maps' in tayga and tayga['maps'] is mapping %} | ||
{%- for map_from, map_to in tayga['maps'].items() %} | ||
map {{ map_from }} {{ map_to }} | ||
{%- endfor %} | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{#- | ||
Salt state file for managing TAYGA | ||
Copyright (C) 2023 Georg Pfuetzenreuter <mail+opensuse@georg-pfuetzenreuter.net> | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
-#} | ||
|
||
{%- set tayga = salt.pillar.get('tayga', {}) %} | ||
|
||
tayga_package: | ||
pkg.installed: | ||
- name: tayga | ||
|
||
{%- if tayga %} | ||
tayga_configuration: | ||
file.managed: | ||
- name: /etc/tayga.conf | ||
- source: salt://{{ slspath }}/files/etc/tayga.conf.j2 | ||
- template: jinja | ||
- context: | ||
tayga: {{ tayga }} | ||
|
||
tayga_service: | ||
service.running: | ||
- name: tayga | ||
- enable: true | ||
- reload: false | ||
- require: | ||
- pkg: tayga_package | ||
- watch: | ||
- file: tayga_configuration | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
tayga: | ||
# Mandatory settings (if not set, the shown default will be written) | ||
tun-device: nat64 | ||
|
||
# Optional settings (if not set, the lines will be omitted) | ||
ipv4-addr: 192.168.255.1 | ||
ipv6-addr: 2001:db8:1::2 | ||
prefix: 64:ff9b::/96 | ||
dynamic-pool: 192.168.255.0/24 | ||
maps: | ||
192.168.255.10: 2001:db8:1::10 | ||
192.168.255.15: 2001:db8:1::a |