23 lines
656 B
YAML
23 lines
656 B
YAML
---
|
|
- name: Initialize variables
|
|
ansible.builtin.set_fact:
|
|
_service_container_mounts: []
|
|
|
|
- name: Set container named mounts
|
|
ansible.builtin.set_fact:
|
|
_service_container_mounts: >
|
|
{{ _service_container_mounts +
|
|
[mount | combine({'source': service_name + '-' + mount.source})] }}
|
|
when: mount.type == 'volume'
|
|
loop: "{{ service_container_mounts }}"
|
|
loop_control:
|
|
loop_var: mount
|
|
|
|
- name: Set container named mounts
|
|
ansible.builtin.set_fact:
|
|
_service_container_mounts: "{{ _service_container_mounts + [mount] }}"
|
|
when: mount.type == 'bind'
|
|
loop: "{{ service_container_mounts }}"
|
|
loop_control:
|
|
loop_var: mount
|