Initial commit
Basic roles for installing podman, creating containers, networks and services
This commit is contained in:
22
roles/service/tasks/mounts.yaml
Normal file
22
roles/service/tasks/mounts.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
- 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
|
||||
Reference in New Issue
Block a user