upstream.ipv6-tunnel: add ipv6-tunnel-update.sh for upstream2

This commit is contained in:
Astro 2018-04-14 22:31:40 +02:00
parent 483ae6fc9a
commit bf6f4ae912
3 changed files with 43 additions and 0 deletions

View File

@ -14,3 +14,21 @@ ipv6-tunnel:
endpoint: 216.66.80.30
address: 2001:470:1f0a:12b2::2/64
gateway: 2001:470:1f0a:12b2::1
tunnelbroker:
tunnel_id: '407181'
username: 'C3D2HQ'
key: |
-----BEGIN PGP MESSAGE-----
hQEMA2PKcvDMvlKLAQf+MPl9B7V1GfG+ps+cILxxnGA8nx9KN69Zj03T5KVYMWw7
6nMfXyhC6ZV3BTVUPqY290SaMP0wa4YjpewypfILoJLQDGV7SQaR8eVVCXQYusXK
M+L1jWr8f+GOCH5BYsX4WS0PhJ0EplSDlbsvT2NiLc7SFGsrLwpfL4jLJJ3ICSif
BbKZy7aovpAXmaeTFaYR7wsclXk7hM94U0uaF9HJK0e9WDFuHuz7dbAXLVFIHFIx
UdrjoA8GfRoCqMLXe9Uce+MPvkJX3m0oAtc68Znw/4ndMm6FIyuUhA/jh+gt4/2B
BXCch68PGnKNiFmRDW+h17ZiAFeobyb960wJBammLNJLAS+adCeoDgJCxXTzZ5Rh
IFEdKAewlFa1RXWn0HhGu7FYoeM+EbuH/ZYW9TOIWYRb3Ol36MPDoRuPEWU/bETG
UQEvc22wrpxOfjIA
=UbJD
-----END PGP MESSAGE-----

View File

@ -0,0 +1,3 @@
#!/bin/sh
curl https://{{ username }}:{{ key }}@ipv4.tunnelbroker.net/nic/update?hostname={{ tunnel_id }}

View File

@ -1,6 +1,9 @@
ifupdown:
pkg.installed: []
curl:
pkg.installed: []
/etc/systemd/network/ipv6.netdev:
file.append:
- text: |
@ -27,8 +30,27 @@ ifupdown:
[Network]
Tunnel=ipv6
{%- if pillar['ipv6-tunnel'].get('tunnelbroker') -%}
/etc/cron.hourly/ipv6-tunnel-update.sh
file.managed:
- source: salt://upstream/ipv6-tunnel-update.sh
- template: 'jinja'
- mode: 744
- context: {{ pillar['ipv6-tunnel']['tunnelbroker'] }}
- require:
- pkg: curl
cron:
service:
- enabled
- running
- watch:
- file: /etc/cron.hourly/ipv6-tunnel-update.sh
{%- endif -%}
systemd-networkd:
service:
- enabled
- running
- watch:
- file: /etc/systemd/network/ipv6.netdev