service: Add support for template mounts

Template mounts are templated from jinja2 templates to a service name
-specific directory under /srv and bind mounted inside the container.
This commit is contained in:
uumas
2024-11-19 20:10:33 +02:00
parent b17932816b
commit 1b62d4df72
6 changed files with 68 additions and 18 deletions

View File

@@ -8,3 +8,9 @@
ansible.builtin.fail:
msg: "service_postgres_tag needs to be set when database type is postgres"
when: "service_database_type == 'postgres' and service_postgres_tag is not defined"
- name: Fail if template mount source doesn't end in .j2
ansible.builtin.fail:
msg: "Template mount source file name needs to end in .j2. The file {{ item.source }} of {{ service_name }} doesn't."
when: "item.source | split('.') | last != 'j2'"
loop: "{{ _service_template_mounts }}"