service: Template file improvements
This commit is contained in:
24
roles/service/vars/main/template_validate.yaml
Normal file
24
roles/service/vars/main/template_validate.yaml
Normal 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] }}
|
||||
Reference in New Issue
Block a user