forked from jakub/ansible
add homarr2
This commit is contained in:
40
update_homarr2.yml
Normal file
40
update_homarr2.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# update_homarr2.yml
|
||||||
|
|
||||||
|
hosts: linux_servers
|
||||||
|
become: true
|
||||||
|
gather_facts: false
|
||||||
|
|
||||||
|
vars:
|
||||||
|
homarr_project: homarr
|
||||||
|
homarr_compose_file: /data/compose/homarr/docker-compose-homarr.yml
|
||||||
|
homarr_service: homarr
|
||||||
|
homarr_port: 7575
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Pull latest Homarr image
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ homarr_compose_file | dirname }}"
|
||||||
|
files:
|
||||||
|
- "{{ homarr_compose_file | basename }}"
|
||||||
|
pull: always
|
||||||
|
|
||||||
|
- name: Recreate Homarr service
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ homarr_compose_file | dirname }}"
|
||||||
|
files:
|
||||||
|
- "{{ homarr_compose_file | basename }}"
|
||||||
|
services:
|
||||||
|
- "{{ homarr_service }}"
|
||||||
|
state: present
|
||||||
|
recreate: always
|
||||||
|
|
||||||
|
- name: Wait for Homarr port
|
||||||
|
ansible.builtin.wait_for:
|
||||||
|
host: 127.0.0.1
|
||||||
|
port: "{{ homarr_port }}"
|
||||||
|
timeout: 60
|
||||||
|
|
||||||
|
- name: Check Homarr HTTP endpoint
|
||||||
|
ansible.builtin.uri:
|
||||||
|
url: "http://127.0.0.1:{{ homarr_port }}/"
|
||||||
|
status_code: 200
|
||||||
Reference in New Issue
Block a user