podman rebuilt

This commit is contained in:
2025-11-07 08:53:12 +01:00
parent 84824f17c2
commit bb4b26a578
3 changed files with 37 additions and 21 deletions

View File

@@ -41,27 +41,24 @@
# Dies stellt sicher, dass der Podman-Socket für die Kommunikation verfügbar ist,
# insbesondere für Tools wie Portainer, die sich mit dem Socket verbinden.
- name: Create Portainer data directory on NFS share
- name: Install podman-compose
ansible.builtin.pip:
name: podman-compose
state: present
- name: Create directory for Portainer compose file
ansible.builtin.file:
path: "{{ portainer_data_path }}"
path: "{{ podman_data_mount_point }}/compose/portainer"
state: directory
mode: '0755'
owner: root
group: root
- name: Run Portainer container with Podman (using podman_container module)
community.general.podman_container:
name: "{{ portainer_name }}"
image: "{{ portainer_image }}"
state: started
restart_policy: always
ports:
- "{{ portainer_edge_agent_port }}:8000"
- "{{ portainer_web_port }}:9443"
- "{{ portainer_legacy_port }}:9000"
volume:
# Map Podman socket to Docker socket path for Portainer compatibility
- "/run/podman/podman.sock:/var/run/docker.sock"
- "{{ portainer_data_path }}:/data"
# This module is idempotent by nature and provides better state management.
# Ensure 'community.general' collection is installed with `ansible-galaxy collection install community.general`.
- name: Create Portainer compose file from template
ansible.builtin.template:
src: portainer-compose.yml.j2
dest: "{{ podman_data_mount_point }}/compose/portainer/compose.yml"
mode: '0644'
- name: Start Portainer container using podman-compose
ansible.builtin.command:
cmd: podman-compose up -d
chdir: "{{ podman_data_mount_point }}/compose/portainer"