Merge pull request 'add config for homebox container' (!137) from feat/homebox into master

Reviewed-on: https://gitea.n39.eu/Netz39_Admin/netz39-infra-ansible/pulls/137
Reviewed-by: Stefan Haun <tux@netz39.de>
This commit is contained in:
dkdent 2023-03-22 21:05:31 +01:00
commit c591199988
3 changed files with 43 additions and 0 deletions

View file

@ -30,6 +30,7 @@
local: true local: true
- name: uptime.n39.eu - name: uptime.n39.eu
- name: grafana.n39.eu - name: grafana.n39.eu
- name: inventory.n39.eu
- server: radon - server: radon
hosts: hosts:
- name: nodered.n39.eu - name: nodered.n39.eu

View file

@ -23,6 +23,7 @@
- name: "{{ influxdb_domain_name }}" - name: "{{ influxdb_domain_name }}"
- name: uptime.n39.eu - name: uptime.n39.eu
- name: "{{ grafana_domain_name }}" - name: "{{ grafana_domain_name }}"
- name: "{{ homebox_domain_name }}"
- role: penguineer.dehydrated_cron - role: penguineer.dehydrated_cron
- role: dd24_dyndns_cron - role: dd24_dyndns_cron
# variables are set in the inventory # variables are set in the inventory
@ -474,6 +475,44 @@
proxy_port: "{{ grafana_host_port }}" proxy_port: "{{ grafana_host_port }}"
proxy_preserve_host: "On" proxy_preserve_host: "On"
- name: Ensure the homebox directories exist
file:
path: "{{ item.path }}"
owner: "{{ item.owner | default('root') }}"
mode: "{{ item.mode }}"
state: directory
with_items:
- path: "{{ data_dir }}/homebox"
mode: "0755"
- path: "{{ data_dir }}/homebox/data"
mode: "0755"
- name: Ensure container for homebox is running
docker_container:
name: homebox
image: "ghcr.io/hay-kot/homebox"
pull: true
state: started
detach: yes
restart_policy: unless-stopped
ports:
- "127.0.0.1:{{ homebox_host_port }}:7745"
volumes:
- "{{ data_dir }}/homebox/data:/data"
env:
TZ: "{{ timezone }}"
HBOX_LOG_LEVEL: "info"
HBOX_LOG_FORMAT: "text"
HBOX_WEB_MAX_UPLOAD_SIZE: "10"
- name: Setup proxy site {{ homebox_domain_name }}
include_role:
name: setup_http_site_proxy
vars:
site_name: "{{ homebox_domain_name }}"
proxy_port: "{{ homebox_host_port }}"
proxy_preserve_host: "On"
handlers: handlers:
- name: Restart prosody - name: Restart prosody
community.docker.docker_container: community.docker.docker_container:

View file

@ -41,3 +41,6 @@ uptimekuma_host_port: 8085
grafana_host_port: 8089 grafana_host_port: 8089
grafana_domain_name: grafana.n39.eu grafana_domain_name: grafana.n39.eu
grafana_admin_password: "{{ vault_grafana_admin_password }}" grafana_admin_password: "{{ vault_grafana_admin_password }}"
homebox_host_port: 8090
homebox_domain_name: inventory.n39.eu