19 lines
576 B
YAML
19 lines
576 B
YAML
---
|
|
# Ensure volumes are created
|
|
|
|
- name: Create bind mount directories from containers
|
|
ansible.builtin.file:
|
|
path: "{{ item.1.split(':')[0] }}"
|
|
state: directory
|
|
mode: '0755'
|
|
owner: root
|
|
group: root
|
|
loop: "{{ podman_containers | subelements('volumes', skip_missing=True) }}"
|
|
when:
|
|
- podman_create_volumes | bool
|
|
- item.1 is string
|
|
- item.1.split(':')[0] | dirname | length > 0
|
|
- item.1.split(':')[0].startswith('/') or item.1.split(':')[0].startswith('./')
|
|
loop_control:
|
|
label: "{{ item.0.name }} -> {{ item.1.split(':')[0] }}"
|