bundlewrap/bundles/openvpn-client/items.py
Franziska Kunsmann b06532241b
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles: use metastack syntax for metadata.get()
2021-02-18 18:12:25 +01:00

22 lines
584 B
Python

from os.path import join
directories = {
'/etc/openvpn/client': {
'purge': True,
},
}
for config in node.metadata.get('openvpn-client/configs', set()):
files[f'/etc/openvpn/client/{config}.conf'] = {
'content': repo.vault.decrypt_file(join('openvpn-client', f'{config}.conf.vault')),
'triggers': {
f'svc_systemd:openvpn-client@{config}:restart',
},
}
svc_systemd[f'openvpn-client@{config}'] = {
'needs': {
f'file:/etc/openvpn/client/{config}.conf',
'pkg_apt:openvpn',
},
}