diff --git a/local.yml b/local.yml index bd652ac..a283f1e 100644 --- a/local.yml +++ b/local.yml @@ -4,7 +4,7 @@ - import_tasks: global_handlers/global_handlers.yml connection: local vars_files: - - "os_vars/{{ ansible_distribution | lower }}.yml" + - "{{ lookup('first_found', ['os_vars/' + (ansible_distribution | lower) + '.yml'], errors='ignore') }}" become: true vars: ansible_reboot_cooldown_minutes: 15 # Cooldown in Minuten diff --git a/roles/podman/tasks/main.yml b/roles/podman/tasks/main.yml index a6da60c..b65c1d3 100644 --- a/roles/podman/tasks/main.yml +++ b/roles/podman/tasks/main.yml @@ -50,20 +50,19 @@ group: root - name: Run Portainer container with Podman - warn: false # Suppresses the warning that the 'command' module is used for operations that should be idempotent - module: ansible.builtin.command - cmd: > - podman run -d - --name {{ portainer_name }} - --restart=always - -p {{ portainer_edge_agent_port }}:8000 - -p {{ portainer_web_port }}:9443 - -p {{ portainer_legacy_port }}:9000 - -v /run/podman/podman.sock:/var/run/docker.sock # Map Podman socket to Docker socket path for Portainer compatibility - -v {{ portainer_data_path }}:/data - {{ portainer_image }} - args: + ansible.builtin.command: + cmd: > + podman run -d + --name {{ portainer_name }} + --restart=always + -p {{ portainer_edge_agent_port }}:8000 + -p {{ portainer_web_port }}:9443 + -p {{ portainer_legacy_port }}:9000 + -v /run/podman/podman.sock:/var/run/docker.sock # Map Podman socket to Docker socket path for Portainer compatibility + -v {{ portainer_data_path }}:/data + {{ portainer_image }} creates: "{{ portainer_data_path }}/portainer.db" # Checks if the Portainer database file exists to ensure idempotency + warn: false # Suppresses the warning that the 'command' module is used for operations that should be idempotent # Verbesserungsvorschlag: Für eine robustere Container-Verwaltung könnte das Modul # `community.general.podman_container` verwendet werden, falls die `community.general`-Collection installiert ist. # Beispiel: