edit homarr
This commit is contained in:
13
docker-compose/docker-compose-homarr.yml
Normal file
13
docker-compose/docker-compose-homarr.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
services:
|
||||||
|
homarr:
|
||||||
|
container_name: homarr
|
||||||
|
image: ghcr.io/homarr-labs/homarr:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration
|
||||||
|
- /data/compose/homarr/appdata:/appdata
|
||||||
|
environment:
|
||||||
|
- SECRET_ENCRYPTION_KEY=4fb16028fa1788d9a24fa93a323aa4a278524bed177c8c38454f4c4068c1b9b6
|
||||||
|
ports:
|
||||||
|
- '7575:7575'
|
||||||
|
|
||||||
194
old/update_homarr.yml
Normal file
194
old/update_homarr.yml
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
# update_homarr.yml
|
||||||
|
|
||||||
|
- name: Update Homarr on VM via Proxmox
|
||||||
|
hosts: linux_servers
|
||||||
|
gather_facts: false
|
||||||
|
become: true
|
||||||
|
become_user: root
|
||||||
|
become_method: sudo
|
||||||
|
|
||||||
|
vars:
|
||||||
|
# VM connection (provided by Semaphore env vars)
|
||||||
|
vm_ip: "{{ lookup('env', 'VM_IP') }}"
|
||||||
|
vm_user: "{{ lookup('env', 'VM_USER') }}"
|
||||||
|
vm_pass: "{{ lookup('env', 'VM_PASS') }}"
|
||||||
|
use_sudo: false
|
||||||
|
|
||||||
|
# --- Debug mode (controlled via Semaphore variable) ---
|
||||||
|
DEBUG: "{{ lookup('env', 'DEBUG') | default(0) | int }}"
|
||||||
|
RETRIES: "{{ lookup('env', 'RETRIES') | default(25) | int }}"
|
||||||
|
|
||||||
|
# Homarr specifics
|
||||||
|
homarr_project: "homarr"
|
||||||
|
homarr_compose_file: "/data/compose/homarr/docker-compose-homarr.yml"
|
||||||
|
homarr_service: "homarr"
|
||||||
|
homarr_image: "ghcr.io/homarr-labs/homarr:latest"
|
||||||
|
homarr_port: 7575
|
||||||
|
|
||||||
|
# Optional external URL for controller-side readiness check (e.g., https://homarr.example.com)
|
||||||
|
# If empty/undefined, controller check is skipped and we only probe from the VM.
|
||||||
|
homarr_url: "{{ lookup('env', 'HOMARR_URL') | default('', true) }}"
|
||||||
|
|
||||||
|
# Fixed container name used in your compose (avoid conflicts with any leftover container)
|
||||||
|
homarr_container_name: "homarr"
|
||||||
|
|
||||||
|
# Retry policy (same pattern as Kuma): 25x with 2s delay
|
||||||
|
homarr_retries: "{{ RETRIES }}"
|
||||||
|
homarr_delay: 2
|
||||||
|
|
||||||
|
# Docker command prefix (consistent behavior)
|
||||||
|
docker_prefix: "unalias docker 2>/dev/null || true; DOCKER_CLI_HINTS=0; command docker"
|
||||||
|
|
||||||
|
# Commands to run on the target VM (quiet outputs)
|
||||||
|
homarr_commands:
|
||||||
|
- "{{ docker_prefix }} pull -q {{ homarr_image }} >/dev/null"
|
||||||
|
- "{{ docker_prefix }} compose -p {{ homarr_project }} -f {{ homarr_compose_file }} pull {{ homarr_service }} >/dev/null"
|
||||||
|
# remove conflicting container name before compose up (silently)
|
||||||
|
- "{{ docker_prefix }} rm -f {{ homarr_container_name }} >/dev/null 2>&1 || true"
|
||||||
|
- "{{ docker_prefix }} compose -p {{ homarr_project }} -f {{ homarr_compose_file }} up -d --no-deps --force-recreate {{ homarr_service }} >/dev/null"
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure sshpass is installed (for password-based SSH) # English comments
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: sshpass
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Run Homarr update commands on VM (via SSH) # use SSHPASS env, hide item label
|
||||||
|
ansible.builtin.command:
|
||||||
|
argv:
|
||||||
|
- sshpass
|
||||||
|
- -e # read password from SSHPASS environment
|
||||||
|
- ssh
|
||||||
|
- -o
|
||||||
|
- StrictHostKeyChecking=no
|
||||||
|
- -o
|
||||||
|
- ConnectTimeout=15
|
||||||
|
- "{{ vm_user }}@{{ vm_ip }}"
|
||||||
|
- bash
|
||||||
|
- -lc
|
||||||
|
- "{{ ('sudo ' if use_sudo else '') + item }}"
|
||||||
|
environment:
|
||||||
|
SSHPASS: "{{ vm_pass }}" # supply password via environment
|
||||||
|
loop: "{{ homarr_commands }}"
|
||||||
|
loop_control:
|
||||||
|
index_var: idx # capture loop index
|
||||||
|
label: "cmd-{{ idx }}" # avoid printing full command in (item=...) line
|
||||||
|
register: homarr_cmds
|
||||||
|
changed_when: false
|
||||||
|
no_log: "{{ DEBUG == 0 }}" # hide outputs and env when not debugging
|
||||||
|
|
||||||
|
- name: Show outputs for each Homarr command
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: |
|
||||||
|
CMD: {{ item.item }}
|
||||||
|
RC: {{ item.rc }}
|
||||||
|
STDOUT:
|
||||||
|
{{ (item.stdout | default('')).strip() }}
|
||||||
|
STDERR:
|
||||||
|
{{ (item.stderr | default('')).strip() }}
|
||||||
|
loop: "{{ homarr_cmds.results }}"
|
||||||
|
when: DEBUG == 1
|
||||||
|
|
||||||
|
- name: Fail play if any Homarr command failed # also hide item label
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that: "item.rc == 0"
|
||||||
|
fail_msg: "Homarr update failed on VM: {{ item.item }} (rc={{ item.rc }})"
|
||||||
|
success_msg: "All Homarr update commands succeeded."
|
||||||
|
loop: "{{ homarr_cmds.results }}"
|
||||||
|
loop_control:
|
||||||
|
index_var: idx
|
||||||
|
label: "cmd-{{ idx }}"
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Readiness checks (controller first, then VM fallback)
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
- name: Homarr | Wait for homepage (controller first, with retries)
|
||||||
|
ansible.builtin.uri:
|
||||||
|
url: "{{ (homarr_url | regex_replace('/$','')) + '/' }}"
|
||||||
|
method: GET
|
||||||
|
return_content: true
|
||||||
|
# Validate TLS only when using https://
|
||||||
|
validate_certs: "{{ (homarr_url | default('')) is match('^https://') }}"
|
||||||
|
status_code: 200
|
||||||
|
register: homarr_controller
|
||||||
|
delegate_to: localhost
|
||||||
|
run_once: true
|
||||||
|
when: homarr_url is defined and (homarr_url | length) > 0
|
||||||
|
retries: "{{ homarr_retries }}"
|
||||||
|
delay: "{{ homarr_delay }}"
|
||||||
|
until: homarr_controller.status == 200
|
||||||
|
failed_when: false
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Homarr | VM-side fetch (HTML via Python, with retries) # use SSHPASS env here too
|
||||||
|
ansible.builtin.command:
|
||||||
|
argv:
|
||||||
|
- sshpass
|
||||||
|
- -e
|
||||||
|
- ssh
|
||||||
|
- -o
|
||||||
|
- StrictHostKeyChecking=no
|
||||||
|
- -o
|
||||||
|
- ConnectTimeout=15
|
||||||
|
- "{{ vm_user }}@{{ vm_ip }}"
|
||||||
|
- bash
|
||||||
|
- -lc
|
||||||
|
- |
|
||||||
|
python3 - <<'PY'
|
||||||
|
# Fetch Homarr homepage from localhost and print HTML to stdout
|
||||||
|
import urllib.request, sys
|
||||||
|
try:
|
||||||
|
with urllib.request.urlopen("http://127.0.0.1:{{ homarr_port }}/", timeout=15) as r:
|
||||||
|
sys.stdout.write(r.read().decode(errors='ignore'))
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
PY
|
||||||
|
environment:
|
||||||
|
SSHPASS: "{{ vm_pass }}"
|
||||||
|
register: homarr_vm
|
||||||
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
when: homarr_controller.status | default(0) != 200 or homarr_controller.content is not defined
|
||||||
|
retries: "{{ homarr_retries }}"
|
||||||
|
delay: "{{ homarr_delay }}"
|
||||||
|
until: (homarr_vm.stdout | default('') | trim | length) > 0 and ('Homarr' in (homarr_vm.stdout | default('')))
|
||||||
|
no_log: "{{ DEBUG == 0 }}"
|
||||||
|
|
||||||
|
- name: Homarr | Choose homepage HTML (controller wins, else VM) # safe guard against empty result
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
homarr_home_html: >-
|
||||||
|
{{
|
||||||
|
(
|
||||||
|
homarr_controller.content
|
||||||
|
if (homarr_controller is defined)
|
||||||
|
and ((homarr_controller.status|default(0))==200)
|
||||||
|
and (homarr_controller.content is defined)
|
||||||
|
else
|
||||||
|
(homarr_vm.stdout | default('') | trim)
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
when:
|
||||||
|
- (homarr_controller is defined and (homarr_controller.status|default(0))==200 and (homarr_controller.content is defined))
|
||||||
|
or ((homarr_vm.stdout | default('') | trim | length) > 0)
|
||||||
|
|
||||||
|
- name: Homarr | Print concise summary
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: >-
|
||||||
|
Homarr homepage {{ 'reachable' if (homarr_home_html is defined) else 'NOT reachable' }}.
|
||||||
|
Source={{ 'controller' if ((homarr_controller is defined) and (homarr_controller.status|default(0))==200 and (homarr_controller.content is defined)) else 'vm' if (homarr_vm.stdout|default('')|trim|length>0) else 'n/a' }};
|
||||||
|
length={{ (homarr_home_html | default('')) | length }};
|
||||||
|
contains('Homarr')={{ (homarr_home_html is defined) and ('Homarr' in homarr_home_html) }}
|
||||||
|
when: DEBUG == 1
|
||||||
|
|
||||||
|
- name: Homarr | Homepage unavailable (after retries)
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "Homarr web není dostupný ani po pokusech."
|
||||||
|
when: homarr_home_html is not defined and DEBUG == 1
|
||||||
|
|
||||||
|
# Optional detailed dump (short excerpt only)
|
||||||
|
- name: Homarr | HTML excerpt (debug)
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ (homarr_home_html | default(''))[:500] }}"
|
||||||
|
when: homarr_home_html is defined and DEBUG == 1
|
||||||
@@ -1,194 +1,40 @@
|
|||||||
# update_homarr.yml
|
# update_homarr2.yml
|
||||||
|
|
||||||
- name: Update Homarr on VM via Proxmox
|
- name: Update Homarr
|
||||||
hosts: linux_servers
|
hosts: pve2_vm
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
become: true
|
|
||||||
become_user: root
|
|
||||||
become_method: sudo
|
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
# VM connection (provided by Semaphore env vars)
|
homarr_project: homarr
|
||||||
vm_ip: "{{ lookup('env', 'VM_IP') }}"
|
homarr_compose_file: "{{ playbook_dir }}/docker-compose/docker-compose-homarr.yml"
|
||||||
vm_user: "{{ lookup('env', 'VM_USER') }}"
|
homarr_service: homarr
|
||||||
vm_pass: "{{ lookup('env', 'VM_PASS') }}"
|
|
||||||
use_sudo: false
|
|
||||||
|
|
||||||
# --- Debug mode (controlled via Semaphore variable) ---
|
|
||||||
DEBUG: "{{ lookup('env', 'DEBUG') | default(0) | int }}"
|
|
||||||
RETRIES: "{{ lookup('env', 'RETRIES') | default(25) | int }}"
|
|
||||||
|
|
||||||
# Homarr specifics
|
|
||||||
homarr_project: "homarr"
|
|
||||||
homarr_compose_file: "/data/compose/homarr/docker-compose-homarr.yml"
|
|
||||||
homarr_service: "homarr"
|
|
||||||
homarr_image: "ghcr.io/homarr-labs/homarr:latest"
|
|
||||||
homarr_port: 7575
|
homarr_port: 7575
|
||||||
|
|
||||||
# Optional external URL for controller-side readiness check (e.g., https://homarr.example.com)
|
|
||||||
# If empty/undefined, controller check is skipped and we only probe from the VM.
|
|
||||||
homarr_url: "{{ lookup('env', 'HOMARR_URL') | default('', true) }}"
|
|
||||||
|
|
||||||
# Fixed container name used in your compose (avoid conflicts with any leftover container)
|
|
||||||
homarr_container_name: "homarr"
|
|
||||||
|
|
||||||
# Retry policy (same pattern as Kuma): 25x with 2s delay
|
|
||||||
homarr_retries: "{{ RETRIES }}"
|
|
||||||
homarr_delay: 2
|
|
||||||
|
|
||||||
# Docker command prefix (consistent behavior)
|
|
||||||
docker_prefix: "unalias docker 2>/dev/null || true; DOCKER_CLI_HINTS=0; command docker"
|
|
||||||
|
|
||||||
# Commands to run on the target VM (quiet outputs)
|
|
||||||
homarr_commands:
|
|
||||||
- "{{ docker_prefix }} pull -q {{ homarr_image }} >/dev/null"
|
|
||||||
- "{{ docker_prefix }} compose -p {{ homarr_project }} -f {{ homarr_compose_file }} pull {{ homarr_service }} >/dev/null"
|
|
||||||
# remove conflicting container name before compose up (silently)
|
|
||||||
- "{{ docker_prefix }} rm -f {{ homarr_container_name }} >/dev/null 2>&1 || true"
|
|
||||||
- "{{ docker_prefix }} compose -p {{ homarr_project }} -f {{ homarr_compose_file }} up -d --no-deps --force-recreate {{ homarr_service }} >/dev/null"
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Ensure sshpass is installed (for password-based SSH) # English comments
|
- name: Pull latest Homarr image
|
||||||
ansible.builtin.apt:
|
community.docker.docker_compose_v2:
|
||||||
name: sshpass
|
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
|
state: present
|
||||||
update_cache: yes
|
recreate: always
|
||||||
|
|
||||||
- name: Run Homarr update commands on VM (via SSH) # use SSHPASS env, hide item label
|
- name: Wait for Homarr port
|
||||||
ansible.builtin.command:
|
ansible.builtin.wait_for:
|
||||||
argv:
|
host: 127.0.0.1
|
||||||
- sshpass
|
port: "{{ homarr_port }}"
|
||||||
- -e # read password from SSHPASS environment
|
timeout: 60
|
||||||
- ssh
|
|
||||||
- -o
|
|
||||||
- StrictHostKeyChecking=no
|
|
||||||
- -o
|
|
||||||
- ConnectTimeout=15
|
|
||||||
- "{{ vm_user }}@{{ vm_ip }}"
|
|
||||||
- bash
|
|
||||||
- -lc
|
|
||||||
- "{{ ('sudo ' if use_sudo else '') + item }}"
|
|
||||||
environment:
|
|
||||||
SSHPASS: "{{ vm_pass }}" # supply password via environment
|
|
||||||
loop: "{{ homarr_commands }}"
|
|
||||||
loop_control:
|
|
||||||
index_var: idx # capture loop index
|
|
||||||
label: "cmd-{{ idx }}" # avoid printing full command in (item=...) line
|
|
||||||
register: homarr_cmds
|
|
||||||
changed_when: false
|
|
||||||
no_log: "{{ DEBUG == 0 }}" # hide outputs and env when not debugging
|
|
||||||
|
|
||||||
- name: Show outputs for each Homarr command
|
- name: Check Homarr HTTP endpoint
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: |
|
|
||||||
CMD: {{ item.item }}
|
|
||||||
RC: {{ item.rc }}
|
|
||||||
STDOUT:
|
|
||||||
{{ (item.stdout | default('')).strip() }}
|
|
||||||
STDERR:
|
|
||||||
{{ (item.stderr | default('')).strip() }}
|
|
||||||
loop: "{{ homarr_cmds.results }}"
|
|
||||||
when: DEBUG == 1
|
|
||||||
|
|
||||||
- name: Fail play if any Homarr command failed # also hide item label
|
|
||||||
ansible.builtin.assert:
|
|
||||||
that: "item.rc == 0"
|
|
||||||
fail_msg: "Homarr update failed on VM: {{ item.item }} (rc={{ item.rc }})"
|
|
||||||
success_msg: "All Homarr update commands succeeded."
|
|
||||||
loop: "{{ homarr_cmds.results }}"
|
|
||||||
loop_control:
|
|
||||||
index_var: idx
|
|
||||||
label: "cmd-{{ idx }}"
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Readiness checks (controller first, then VM fallback)
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
- name: Homarr | Wait for homepage (controller first, with retries)
|
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "{{ (homarr_url | regex_replace('/$','')) + '/' }}"
|
url: "http://127.0.0.1:{{ homarr_port }}/"
|
||||||
method: GET
|
status_code: 200
|
||||||
return_content: true
|
|
||||||
# Validate TLS only when using https://
|
|
||||||
validate_certs: "{{ (homarr_url | default('')) is match('^https://') }}"
|
|
||||||
status_code: 200
|
|
||||||
register: homarr_controller
|
|
||||||
delegate_to: localhost
|
|
||||||
run_once: true
|
|
||||||
when: homarr_url is defined and (homarr_url | length) > 0
|
|
||||||
retries: "{{ homarr_retries }}"
|
|
||||||
delay: "{{ homarr_delay }}"
|
|
||||||
until: homarr_controller.status == 200
|
|
||||||
failed_when: false
|
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- name: Homarr | VM-side fetch (HTML via Python, with retries) # use SSHPASS env here too
|
|
||||||
ansible.builtin.command:
|
|
||||||
argv:
|
|
||||||
- sshpass
|
|
||||||
- -e
|
|
||||||
- ssh
|
|
||||||
- -o
|
|
||||||
- StrictHostKeyChecking=no
|
|
||||||
- -o
|
|
||||||
- ConnectTimeout=15
|
|
||||||
- "{{ vm_user }}@{{ vm_ip }}"
|
|
||||||
- bash
|
|
||||||
- -lc
|
|
||||||
- |
|
|
||||||
python3 - <<'PY'
|
|
||||||
# Fetch Homarr homepage from localhost and print HTML to stdout
|
|
||||||
import urllib.request, sys
|
|
||||||
try:
|
|
||||||
with urllib.request.urlopen("http://127.0.0.1:{{ homarr_port }}/", timeout=15) as r:
|
|
||||||
sys.stdout.write(r.read().decode(errors='ignore'))
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
PY
|
|
||||||
environment:
|
|
||||||
SSHPASS: "{{ vm_pass }}"
|
|
||||||
register: homarr_vm
|
|
||||||
changed_when: false
|
|
||||||
failed_when: false
|
|
||||||
when: homarr_controller.status | default(0) != 200 or homarr_controller.content is not defined
|
|
||||||
retries: "{{ homarr_retries }}"
|
|
||||||
delay: "{{ homarr_delay }}"
|
|
||||||
until: (homarr_vm.stdout | default('') | trim | length) > 0 and ('Homarr' in (homarr_vm.stdout | default('')))
|
|
||||||
no_log: "{{ DEBUG == 0 }}"
|
|
||||||
|
|
||||||
- name: Homarr | Choose homepage HTML (controller wins, else VM) # safe guard against empty result
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
homarr_home_html: >-
|
|
||||||
{{
|
|
||||||
(
|
|
||||||
homarr_controller.content
|
|
||||||
if (homarr_controller is defined)
|
|
||||||
and ((homarr_controller.status|default(0))==200)
|
|
||||||
and (homarr_controller.content is defined)
|
|
||||||
else
|
|
||||||
(homarr_vm.stdout | default('') | trim)
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
when:
|
|
||||||
- (homarr_controller is defined and (homarr_controller.status|default(0))==200 and (homarr_controller.content is defined))
|
|
||||||
or ((homarr_vm.stdout | default('') | trim | length) > 0)
|
|
||||||
|
|
||||||
- name: Homarr | Print concise summary
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: >-
|
|
||||||
Homarr homepage {{ 'reachable' if (homarr_home_html is defined) else 'NOT reachable' }}.
|
|
||||||
Source={{ 'controller' if ((homarr_controller is defined) and (homarr_controller.status|default(0))==200 and (homarr_controller.content is defined)) else 'vm' if (homarr_vm.stdout|default('')|trim|length>0) else 'n/a' }};
|
|
||||||
length={{ (homarr_home_html | default('')) | length }};
|
|
||||||
contains('Homarr')={{ (homarr_home_html is defined) and ('Homarr' in homarr_home_html) }}
|
|
||||||
when: DEBUG == 1
|
|
||||||
|
|
||||||
- name: Homarr | Homepage unavailable (after retries)
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: "Homarr web není dostupný ani po pokusech."
|
|
||||||
when: homarr_home_html is not defined and DEBUG == 1
|
|
||||||
|
|
||||||
# Optional detailed dump (short excerpt only)
|
|
||||||
- name: Homarr | HTML excerpt (debug)
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: "{{ (homarr_home_html | default(''))[:500] }}"
|
|
||||||
when: homarr_home_html is defined and DEBUG == 1
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
# update_homarr2.yml
|
|
||||||
|
|
||||||
- name: Update Homarr
|
|
||||||
hosts: pve2_vm
|
|
||||||
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