From 48b3f6059a799740e819c2636fffa39ceeb02d91 Mon Sep 17 00:00:00 2001 From: "martin.fencl" Date: Tue, 3 Feb 2026 17:50:51 +0100 Subject: [PATCH] edit homarr --- update_homarr.yml | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/update_homarr.yml b/update_homarr.yml index 535eb0e..07627b2 100644 --- a/update_homarr.yml +++ b/update_homarr.yml @@ -6,23 +6,42 @@ vars: homarr_project: homarr - homarr_compose_file: "{{ playbook_dir }}/docker-compose/docker-compose-homarr.yml" + + # Local path (controller / where Ansible runs) + homarr_compose_local: "{{ playbook_dir }}/docker-compose/docker-compose-homarr.yml" + + # Remote path (target / where Docker runs) + homarr_compose_remote_dir: "/data/compose/homarr" + homarr_compose_remote: "{{ homarr_compose_remote_dir }}/docker-compose-homarr.yml" + homarr_service: homarr homarr_port: 7575 tasks: + - name: Ensure remote compose directory exists + ansible.builtin.file: + path: "{{ homarr_compose_remote_dir }}" + state: directory + mode: "0755" + + - name: Copy compose file from controller to remote host + ansible.builtin.copy: + src: "{{ homarr_compose_local }}" + dest: "{{ homarr_compose_remote }}" + mode: "0644" + - name: Pull latest Homarr image community.docker.docker_compose_v2: - project_src: "{{ homarr_compose_file | dirname }}" + project_src: "{{ homarr_compose_remote_dir }}" files: - - "{{ homarr_compose_file | basename }}" + - "{{ homarr_compose_remote | basename }}" pull: always - name: Recreate Homarr service community.docker.docker_compose_v2: - project_src: "{{ homarr_compose_file | dirname }}" + project_src: "{{ homarr_compose_remote_dir }}" files: - - "{{ homarr_compose_file | basename }}" + - "{{ homarr_compose_remote | basename }}" services: - "{{ homarr_service }}" state: present