-
Notifications
You must be signed in to change notification settings - Fork 5
/
esphome.yml
86 lines (76 loc) · 3.16 KB
/
esphome.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
- hosts: homelab
vars:
application: esphome
# the key is a 32-byte base64 encoded string. provide the base64 encoded value when authenticating
esphome_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
39303363653265306461386262303334616636653234623764616465303437653236386466663562
3362643130303635633134313630666436353234393362620a623661636134633236383039303535
37363462666637643065353535363238616532363866613865616565663333646566303739373638
6631303231646635350a363730626262626336386638383266613065353461616362633063353037
39636332366333306563646138613934386338653366343963613231303162663838303332653236
6235383039663730666262393961303832653539616363633630
esphome_ota_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
62356662363835663030326237343162633731373030666231653736393034303463396365613233
3031626337323936383262323964656666643636613938380a343736653938383338616533356633
61306666333931373936323037396333396261346662663662323063663031333564393731316263
6434663635373032660a303065666166316136643331633030323431303165323164303232323762
37663761383339346533366130333734636435323863303963343837393532326136
esphome_web_server_auth:
username: "{{ common_user }}"
password: !vault |
$ANSIBLE_VAULT;1.1;AES256
62313466356462633335313864663138346664613565373166353266333038313462363435313363
6135373262636333623665656465383134393135623831390a643436396230633534663265653233
38356431323330333665643163363365316639616263643032336438306366303936386164333536
3865386332333038360a376665376130326333616561386538346333646666383462316530626561
37653936366165333038376137303663666539623063386263636332333830656635
docker_network: "{{ networks.iot }}"
handlers:
- name: Restart
community.docker.docker_container:
name: "{{ application }}"
restart: true
comparisons:
'*': ignore
tasks:
- name: Create config folder
ansible.builtin.file:
path: "{{ config_directory }}"
state: directory
owner: "{{ common_user }}"
group: "{{ common_group }}"
mode: "0771"
- name: Create configs
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ config_directory }}/{{ item | basename | regex_replace('\\.j2$', '') }}"
mode: "0755"
owner: "{{ common_root_id }}"
group: "{{ common_root_group }}"
with_fileglob:
- "{{ files_directory }}/*.j2"
- "{{ files_directory }}/.*.j2" # dotfiles are hidden from the dashboard
- name: Create container
ansible.builtin.include_role:
name: docker_container
vars:
image: ghcr.io/esphome/esphome:2024.10.3
env:
volumes:
- "{{ config_directory }}:/config"
- /etc/localtime:/etc/localtime:ro
privileged: true
network_mode: "host"
traefik:
- port: 6052
auth: page
homepage:
name: ESPHome
group: Home Automation
weight: 150
description: "Control ESP8266/ESP32 devices"
widget:
fields: '["online", "offline_alt"]'