Fix podman container role on empty volumes
Still some improvments could be made, such as handling the variable not being present.
This commit is contained in:
parent
71499b2610
commit
4e0e8c271a
1 changed files with 3 additions and 2 deletions
|
|
@ -54,12 +54,13 @@
|
||||||
notify: Reload systemd (daemon-reload)
|
notify: Reload systemd (daemon-reload)
|
||||||
- name: Flush handlers
|
- name: Flush handlers
|
||||||
ansible.builtin.meta: flush_handlers
|
ansible.builtin.meta: flush_handlers
|
||||||
|
- name: Define empty volume array
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
volumes: []
|
||||||
- name: Map volumes to Podman accepted list
|
- name: Map volumes to Podman accepted list
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
volumes: "{{ volumes + ['/home/' + container_user + '/' + item.name + ':' + item.mnt] }}"
|
volumes: "{{ volumes + ['/home/' + container_user + '/' + item.name + ':' + item.mnt] }}"
|
||||||
with_items: "{{ podman_container_volumes }}"
|
with_items: "{{ podman_container_volumes }}"
|
||||||
vars:
|
|
||||||
volumes: []
|
|
||||||
- name: Start the container
|
- name: Start the container
|
||||||
containers.podman.podman_container:
|
containers.podman.podman_container:
|
||||||
name: "{{ podman_container_name }}"
|
name: "{{ podman_container_name }}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue