edit homarr
This commit is contained in:
@@ -1,19 +1,12 @@
|
|||||||
# update_homarr2.yml
|
|
||||||
|
|
||||||
- name: Update Homarr
|
- name: Update Homarr
|
||||||
hosts: pve2_vm
|
hosts: pve2_vm
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
homarr_project: homarr
|
homarr_project: homarr
|
||||||
|
|
||||||
# Local path (controller / where Ansible runs)
|
|
||||||
homarr_compose_local: "{{ playbook_dir }}/docker-compose/docker-compose-homarr.yml"
|
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_dir: "/data/compose/homarr"
|
||||||
homarr_compose_remote: "{{ homarr_compose_remote_dir }}/docker-compose-homarr.yml"
|
homarr_compose_remote: "{{ homarr_compose_remote_dir }}/docker-compose-homarr.yml"
|
||||||
|
|
||||||
homarr_service: homarr
|
homarr_service: homarr
|
||||||
homarr_port: 7575
|
homarr_port: 7575
|
||||||
|
|
||||||
@@ -23,12 +16,14 @@
|
|||||||
path: "{{ homarr_compose_remote_dir }}"
|
path: "{{ homarr_compose_remote_dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
become: true
|
||||||
|
|
||||||
- name: Copy compose file from controller to remote host
|
- name: Copy compose file from controller to remote host
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ homarr_compose_local }}"
|
src: "{{ homarr_compose_local }}"
|
||||||
dest: "{{ homarr_compose_remote }}"
|
dest: "{{ homarr_compose_remote }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
become: true
|
||||||
|
|
||||||
- name: Pull latest Homarr image
|
- name: Pull latest Homarr image
|
||||||
community.docker.docker_compose_v2:
|
community.docker.docker_compose_v2:
|
||||||
@@ -36,6 +31,7 @@
|
|||||||
files:
|
files:
|
||||||
- "{{ homarr_compose_remote | basename }}"
|
- "{{ homarr_compose_remote | basename }}"
|
||||||
pull: always
|
pull: always
|
||||||
|
become: true # pokud user nemá práva na docker socket, nech to tady
|
||||||
|
|
||||||
- name: Recreate Homarr service
|
- name: Recreate Homarr service
|
||||||
community.docker.docker_compose_v2:
|
community.docker.docker_compose_v2:
|
||||||
@@ -46,6 +42,7 @@
|
|||||||
- "{{ homarr_service }}"
|
- "{{ homarr_service }}"
|
||||||
state: present
|
state: present
|
||||||
recreate: always
|
recreate: always
|
||||||
|
become: true
|
||||||
|
|
||||||
- name: Wait for Homarr port
|
- name: Wait for Homarr port
|
||||||
ansible.builtin.wait_for:
|
ansible.builtin.wait_for:
|
||||||
@@ -56,4 +53,4 @@
|
|||||||
- name: Check Homarr HTTP endpoint
|
- name: Check Homarr HTTP endpoint
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "http://127.0.0.1:{{ homarr_port }}/"
|
url: "http://127.0.0.1:{{ homarr_port }}/"
|
||||||
status_code: 200
|
status_code: 200
|
||||||
|
|||||||
Reference in New Issue
Block a user