hetzner-dyndns: add rudimentary dyndns #76
3 changed files with 38 additions and 0 deletions
6
bundles/hetzner-dyndns/items.py
Normal file
6
bundles/hetzner-dyndns/items.py
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
directories['/opt/hetzner-dyndns/src'] = {}
|
||||||
|
|
||||||
|
git_deploy['/opt/hetzner-dyndns/src'] = {
|
||||||
|
'repo': 'https://git.franzi.business/sophie/hetzner-dyndns.git',
|
||||||
|
'rev': 'main',
|
||||||
|
}
|
26
bundles/hetzner-dyndns/metadata.py
Normal file
26
bundles/hetzner-dyndns/metadata.py
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
defaults = {
|
||||||
|
'systemd-timers': {
|
||||||
|
'timers': {
|
||||||
|
'hetzner-dyndns-update': {
|
||||||
|
'when': 'hourly',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@metadata_reactor.provides(
|
||||||
|
'systemd-timers/timers/hetzner-dyndns-update',
|
||||||
|
)
|
||||||
|
def command_template(metadata):
|
||||||
|
empty_command = f'/usr/bin/python3 /opt/hetzner-dyndns/src/hetzner-api-dyndns.py --api_key {{}} --zone {node.metadata.get('hetzner-dyndns/zone')} --record {node.metadata.get('hetzner-dyndns/record')}'
|
||||||
|
|
||||||
|
return {
|
||||||
|
'systemd-timers': {
|
||||||
|
'timers': {
|
||||||
|
'hetzner-dyndns-update': {
|
||||||
|
'command': node.metadata.get('hetzner-dyndns/api_key').format_into(empty_command),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ nodes['sophie.vmhost'] = {
|
||||||
'smartd',
|
'smartd',
|
||||||
'vmhost',
|
'vmhost',
|
||||||
'zfs',
|
'zfs',
|
||||||
|
'hetzner-dyndns'
|
||||||
},
|
},
|
||||||
'groups': {
|
'groups': {
|
||||||
'debian-bookworm',
|
'debian-bookworm',
|
||||||
|
@ -21,6 +22,11 @@ nodes['sophie.vmhost'] = {
|
||||||
'groups': {
|
'groups': {
|
||||||
'nas': {},
|
'nas': {},
|
||||||
},
|
},
|
||||||
|
'hetzner-dyndns': {
|
||||||
|
'zone': 'sophies-kitchen.eu',
|
||||||
|
'record': 'home.router',
|
||||||
|
'api_key': vault.decrypt('encrypt$gAAAAABoABHrRTTyOAAFIsHK_g-bubDoNJidbAQ6_0VXyqfal8-wpVMuPPlrw-OtbI1AjNU6Rd1_gKTvwYtNYO9X6RuvuW3TCCH_eitpsoylVEQ0X6SDFNQAFfjkRlOgEiFl85oyTazl'),
|
||||||
|
},
|
||||||
'interfaces': {
|
'interfaces': {
|
||||||
'br1': {
|
'br1': {
|
||||||
'ips': {
|
'ips': {
|
||||||
|
|
Loading…
Add table
Reference in a new issue