2020-11-13 21:15:36 +00:00
|
|
|
from os.path import join
|
|
|
|
|
|
|
|
directories = {
|
|
|
|
'/etc/openvpn/client': {
|
|
|
|
'purge': True,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2021-02-18 17:12:25 +00:00
|
|
|
for config in node.metadata.get('openvpn-client/configs', set()):
|
2020-11-13 21:15:36 +00:00
|
|
|
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',
|
2020-12-08 16:45:30 +00:00
|
|
|
'pkg_apt:openvpn',
|
2020-11-13 21:15:36 +00:00
|
|
|
},
|
|
|
|
}
|