hetzner-dyndns: add rudimentary dyndns
This commit is contained in:
parent
c905b7dc13
commit
7ded2c6b3b
3 changed files with 38 additions and 0 deletions
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),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue