service: Template file improvements

This commit is contained in:
uumas
2026-09-21 05:50:50 +03:00
parent e980ee0bfc
commit bb9026bb6a
5 changed files with 126 additions and 106 deletions

View File

@@ -0,0 +1,24 @@
---
_service_template_validate_secrets: >-
{{
_service_container_secrets
| map(attribute='name')
| zip(
_service_container_secrets
| community.general.remove_keys(['name', 'value', 'length'])
| map('items')
| map('map', 'join', '=')
| map('join', ',')
)
| map('join', ',')
| map('regex_replace', '^', '--secret ')
| join(' ')
}}
_service_template_validate_command: >-
podman run --rm
-v %s:{{ item.destination }}:ro
--entrypoint {{ item.template_validate_command.split(' ', 1)[0] }}
{{ _service_template_validate_secrets }}
{{ service_container_image }}
{{ item.template_validate_command.split(' ', 1)[1] }}