diff --git a/common/docker_traefik/templates/docker-compose.yml b/common/docker_traefik/templates/docker-compose.yml index 478f3210cd10c46b5c8835fdd8071af1544f7407..eed5579f02ea16f44fd8d8f01c67fc699ab6c7ac 100644 --- a/common/docker_traefik/templates/docker-compose.yml +++ b/common/docker_traefik/templates/docker-compose.yml @@ -10,7 +10,7 @@ services: - "443:443" {% if matrix_federation is defined and matrix_federation == true %} - "8448:8448" {% endif %} - - "{{ int_ip4 }}:8080:8080" + - "{{ int_ip4 }}:8081:8080" volumes: - "/srv/traefik/traefik.yml:/etc/traefik/traefik.yml:ro" - "/srv/traefik/dynamic:/etc/traefik/dynamic:ro" diff --git a/intern/docker_unifi/templates/docker-compose.yml b/intern/docker_unifi/templates/docker-compose.yml index ab25a3c5cdfbbe0e4a294c98792bdd07785cffc4..b8760949e8eb78e4f86dc72bbec6d482ec3dbda7 100644 --- a/intern/docker_unifi/templates/docker-compose.yml +++ b/intern/docker_unifi/templates/docker-compose.yml @@ -5,7 +5,7 @@ services: app: - image: linuxserver/unifi-controller:7.2.95 + image: linuxserver/unifi-controller:7.3.83 restart: always ports: - 8443:8443 diff --git a/remote/docker_homeassistant/tasks/main.yml b/remote/docker_homeassistant/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..9717f264b53d3c663afddfb7ff2e0da804d8761b --- /dev/null +++ b/remote/docker_homeassistant/tasks/main.yml @@ -0,0 +1,38 @@ +--- + +- 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/configuration.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 diff --git a/remote/docker_homeassistant/templates/config/configuration.yaml b/remote/docker_homeassistant/templates/config/configuration.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1464342e318f6a856d5d6479ccd35181e1bf6f83 --- /dev/null +++ b/remote/docker_homeassistant/templates/config/configuration.yaml @@ -0,0 +1,57 @@ +# 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 + - 192.168.0.0/24 + 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 + +## Automatisierungen ################################################################ diff --git a/remote/docker_homeassistant/templates/docker-compose.yml b/remote/docker_homeassistant/templates/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..e13ab898f961bf73eb93346ecc19f6b63be87641 --- /dev/null +++ b/remote/docker_homeassistant/templates/docker-compose.yml @@ -0,0 +1,46 @@ + +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 diff --git a/site.yml b/site.yml index 88dbe61d090f67a51c2ea9f5ae136ff822b2415f..240c99f5d9168a0e698c2dd076fa035a6082e18c 100644 --- a/site.yml +++ b/site.yml @@ -330,7 +330,7 @@ mqtt_influxdb_port: 18086 } - { - role: intern/docker_homeassistant, tags: homeassistant, + role: remote/docker_homeassistant, tags: homeassistant, servicename: homeassistant, basedir: /srv/homeassistant, domain: "ha.warpzone.remote",