Use dict for data_directories

This commit is contained in:
Benoit S 2021-11-23 12:09:29 +09:00
parent 02ac9115e4
commit 33098de98a
2 changed files with 5 additions and 5 deletions

View file

@ -26,7 +26,7 @@ server.user(
present=True, present=True,
) )
for directory in host.data.data_directories: for directory in host.data.data_directories.keys():
files.directory( files.directory(
name=f'Make required directory {directory}', name=f'Make required directory {directory}',
path=directory, path=directory,

View file

@ -19,9 +19,9 @@ unix_account = {
'shell': '/bin/false', 'shell': '/bin/false',
} }
data_directories = [ data_directories = {
f"{unix_account['home']}/data" f"{unix_account['home']}/data": '/etc/linkding/data'
] }
systemd = { systemd = {
'Description': app['name'], 'Description': app['name'],
@ -34,7 +34,7 @@ systemd = {
'+/etc/linkding' '+/etc/linkding'
], ],
'BindPaths': [ 'BindPaths': [
f"{data_directories[0]}:/etc/linkding/data" f"{list(data_directories.items())[0][0]}:{list(data_directories.items())[0][1]}"
], ],
'BindReadOnlyPaths': [ 'BindReadOnlyPaths': [
'/etc/resolv.conf', '/etc/resolv.conf',