Skip to content
Snippets Groups Projects
Commit 4533a09a authored by void's avatar void
Browse files

Basiskonfiguration homeassistant

parent 5ce86095
No related branches found
No related tags found
No related merge requests found
Subproject commit 900377e4f72486f6699ecf736f96adfbc04e92da Subproject commit e8a049414bca2b14b158444dac1b94c2ca90d9be
---
- include: ../functions/get_secret.yml
with_items:
- { path: "{{ basedir }}/homeassistant_admin_password", length: 12 }
- { path: "{{ basedir }}/influxdb_password", length: 12 }
- { path: "{{ basedir }}/influxdb_token", length: 32 }
- name: "create folder struct for {{ basedir }}"
file:
path: "{{ item }}"
state: "directory"
with_items:
- "{{ basedir }}"
- "{{ basedir }}/config/"
- name: "copy config files for {{ basedir }}"
template:
src: "{{ item }}"
dest: "{{ basedir }}/{{ item }}"
with_items:
- docker-compose.yml
- config/automations.yaml
- config/configuration.yaml
- config/scenes.yaml
- config/scripts.yaml
register: config_files
- name: "stop {{ servicename }} docker"
docker_compose:
project_src: "{{ basedir }}"
state: absent
when: config_files.changed
- name: "start {{ servicename }} docker"
docker_compose:
project_src: "{{ basedir }}"
state: present
# Loads default set of integrations. Do not remove.
default_config:
# includes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
# https://www.home-assistant.io/docs/configuration/basic/
homeassistant:
name: "warpzone"
latitude: 51.944514
longitude: 7.638933
elevation: 70
unit_system: metric
currency: EUR
country: DE
time_zone: Europe/Berlin
internal_url: https://{{ domain }}
auth_providers:
- type: trusted_networks
trusted_networks:
- 10.0.0.0/22
allow_bypass_login: true
- type: homeassistant
# https://www.home-assistant.io/integrations/http/
http:
server_port: 8123
ip_ban_enabled: False
login_attempts_threshold: 10
use_x_forwarded_for: true
trusted_proxies:
- 172.0.0.0/8
# https://www.home-assistant.io/integrations/logger
# log_level= critical, fatal, error, warning, warn, info, debug, notset
logger:
default: info
# https://www.home-assistant.io/integrations/influxdb/
influxdb:
api_version: 2
host: influxdb
port: 8086
ssl: false
organization: homeassistant
bucket: homeassistant
token: {{ influxdb_token }}
default_measurement: units
version: "3"
services:
app:
image: homeassistant/home-assistant:2023.1
restart: always
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "{{ basedir }}/config:/config"
environment:
TZ: "Europe/Berlin"
labels:
- traefik.enable=true
- traefik.http.routers.{{ servicename }}.rule=Host(`{{ domain }}`)
- traefik.http.routers.{{ servicename }}.entrypoints=websecure
- traefik.http.services.{{ servicename }}.loadbalancer.server.port=8123
networks:
- default
- web
influxdb:
image: influxdb:2.6.0
restart: always
ports:
- {{ int_ip4 }}:{{ influxdb_port }}:8086
volumes:
- "{{ basedir }}/influxdb:/var/lib/influxdb2"
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: homeassistant
DOCKER_INFLUXDB_INIT_PASSWORD: {{ influxdb_password }}
DOCKER_INFLUXDB_INIT_ORG: homeassistant
DOCKER_INFLUXDB_INIT_BUCKET: homeassistant
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: {{ influxdb_token }}
networks:
- default
networks:
web:
external: true
...@@ -62,6 +62,13 @@ ...@@ -62,6 +62,13 @@
basedir: /srv/heimdall, basedir: /srv/heimdall,
domain: "services.warpzone.lan" domain: "services.warpzone.lan"
} }
- {
role: intern/docker_homeassistant, tags: homeassistant,
servicename: homeassistant,
basedir: /srv/homeassistant,
domain: "ha.warpzone.lan",
influxdb_port: 38086
}
- { - {
role: intern/docker_mqtt, tags: mqtt, role: intern/docker_mqtt, tags: mqtt,
servicename: mqtt, servicename: mqtt,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment