Merge pull request 'hetzner-dyndns: add rudimentary dyndns' (#76) from hetzner-dyndns into main

Reviewed-on: #76
This commit is contained in:
Franzi 2025-06-05 16:00:02 +00:00
commit f39758711c
3 changed files with 84 additions and 1 deletions

View 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',
}

View 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),
},
},
},
}