Template mounts are templated from jinja2 templates to a service name -specific directory under /srv and bind mounted inside the container.
22 lines
665 B
YAML
22 lines
665 B
YAML
---
|
|
- name: Create template mount directories under /srv
|
|
when: _service_template_mounts | length > 0
|
|
block:
|
|
- name: Create directory {{ _service_host_directory }}
|
|
ansible.builtin.file:
|
|
path: "{{ _service_host_directory }}"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: Create directory {{ _service_host_directory + '/mounts' }}
|
|
ansible.builtin.file:
|
|
path: "{{ _service_host_directory }}/mounts"
|
|
state: directory
|
|
mode: "0700"
|
|
|
|
- name: Set mount definitions for {{ service_name }}
|
|
ansible.builtin.include_tasks: mount.yaml
|
|
loop: "{{ service_container_mounts }}"
|
|
loop_control:
|
|
loop_var: mount
|