Add volume role and support setting volume owner
Add volume role container: Use volume role, including support for user and group
This commit is contained in:
@@ -1,4 +1,25 @@
|
||||
---
|
||||
_container_volumes: "{{ container_mounts | selectattr('type', '==', 'volume') }}"
|
||||
|
||||
_container_mount_sources: "{{ container_mounts | map(attribute='source') }}"
|
||||
_container_mount_destinations: "{{ container_mounts | map(attribute='destination') }}"
|
||||
|
||||
_container_volume_mount_sources: >-
|
||||
{{
|
||||
_container_volumes
|
||||
| map(attribute='source')
|
||||
| map('regex_replace', '$', '.volume')
|
||||
| map('community.general.dict_kv', 'source')
|
||||
}}
|
||||
|
||||
_container_mounts: >-
|
||||
{{
|
||||
container_mounts | selectattr('type', '!=', 'volume') +
|
||||
container_mounts | selectattr('type', '==', 'volume')
|
||||
| community.general.remove_keys(['user', 'group'])
|
||||
| zip(_container_volume_mount_sources) | map('combine')
|
||||
}}
|
||||
|
||||
_container_quadlet_unit_options: |
|
||||
[Unit]
|
||||
Description=Container {{ container_name }}
|
||||
|
||||
Reference in New Issue
Block a user