Fix bug with container volumes

The variable probably couldn't be altered because it came
in as a variable to the role.
This commit is contained in:
Thomas Kleinendorst 2024-10-06 18:17:20 +02:00
parent cfb228cada
commit a225fc39db

View file

@ -56,8 +56,8 @@
ansible.builtin.meta: flush_handlers
- name: Map volumes to Podman accepted list
ansible.builtin.set_fact:
podman_container_volumes: "{{ podman_container_volumes + ['/home/' + container_user + '/' + item.name + ':' + item.mnt] }}"
with_items: "{{ podman_simple_container_volumes }}"
container_volumes: "{{ container_volumes | default(podman_container_volumes) + ['/home/' + container_user + '/' + item.name + ':' + item.mnt] }}"
loop: "{{ podman_simple_container_volumes }}"
- name: Start the container
containers.podman.podman_container:
name: "{{ podman_container_name }}"
@ -68,7 +68,7 @@
hostname: "{{ ansible_facts['hostname'] }}"
publish: "{{ podman_container_publish }}"
env: "{{ podman_container_env }}"
volumes: "{{ podman_container_volumes }}"
volumes: "{{ container_volumes }}"
state: stopped
# For more information on the systemd startup service, see: https://linuxhandbook.com/autostart-podman-containers/
generate_systemd: