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

@@ -50,11 +50,13 @@ argument_specs:
choices:
- volume
- bind
- template
source:
description:
- Mount source.
- If mount type is volume, name of the volume.
- If mount type is bind, host path to bind mount inside the container.
- If mount type is template, the name of the template file, must end in .j2
type: str
required: true
destination:
@@ -62,10 +64,11 @@ argument_specs:
type: str
required: true
readonly:
description: If true, volume will be mounted as read only inside the container
description:
- If true, volume will be mounted as read only inside the container.
- Defaults to false for volume and bind, true for template
type: bool
required: false
default: false
service_container_secrets:
description: A list of secrets available to the service container in /run/secrets/<service name>-<secret name>
type: list
@@ -145,11 +148,13 @@ argument_specs:
choices:
- volume
- bind
- template
source:
description:
- Mount source.
- If mount type is volume, name of the volume.
- If mount type is bind, host path to bind mount inside the container.
- If mount type is template, the name of the template file, must end in .j2
type: str
required: true
destination:
@@ -157,10 +162,11 @@ argument_specs:
type: str
required: true
readonly:
description: If true, volume will be mounted as read only inside the container
description:
- If true, volume will be mounted as read only inside the container
- Defaults to false for volume and bind, true for template
type: bool
required: false
default: false
publish_ports:
description: "A list of published ports in docker format (<host listen address>:<host port>:<container port>)"
type: list