homeassistant: add basic configuration
authorKristof Provost <kp@FreeBSD.org>
Sun, 16 Jun 2024 18:25:35 +0000 (20:25 +0200)
committerKristof Provost <kp@FreeBSD.org>
Sun, 16 Jun 2024 18:25:35 +0000 (20:25 +0200)
This completes the onboarding process and creates an admin/admin account.

ansible/homeassistant.yaml
ansible/templates/.storage/auth [new file with mode: 0644]
ansible/templates/.storage/auth_provider.homeassistant [new file with mode: 0644]
ansible/templates/.storage/core.config [new file with mode: 0644]
ansible/templates/.storage/http [new file with mode: 0644]
ansible/templates/.storage/http.auth [new file with mode: 0644]
ansible/templates/.storage/onboarding [new file with mode: 0644]
ansible/templates/.storage/person [new file with mode: 0644]

index 2a4c4b2..680fdf4 100644 (file)
         group: "domotica"
         mode: 0644
       become: true
+    - name: install more homeassistant configuration
+      ansible.builtin.copy:
+        src: "templates/.storage"
+        dest: "/home/domotica/.homeassistant/.storage"
+        owner: "domotica"
+        group: "domotica"
+        mode: 0644
+      become: true
     - name: start home assistant
       community.general.sysrc:
         name: homeassistant_enable
diff --git a/ansible/templates/.storage/auth b/ansible/templates/.storage/auth
new file mode 100644 (file)
index 0000000..0615810
--- /dev/null
@@ -0,0 +1,56 @@
+{
+  "version": 1,
+  "minor_version": 1,
+  "key": "auth",
+  "data": {
+    "users": [
+      {
+        "id": "8711b0930d8247ceadaa48c121e54f68",
+        "group_ids": [
+          "system-read-only"
+        ],
+        "is_owner": false,
+        "is_active": true,
+        "name": "Home Assistant Content",
+        "system_generated": true,
+        "local_only": false
+      },
+      {
+        "id": "79286cb6126b40ad9b61aaf558e045f9",
+        "group_ids": [
+          "system-admin"
+        ],
+        "is_owner": true,
+        "is_active": true,
+        "name": "admin",
+        "system_generated": false,
+        "local_only": false
+      }
+    ],
+    "groups": [
+      {
+        "id": "system-admin",
+        "name": "Administrators"
+      },
+      {
+        "id": "system-users",
+        "name": "Users"
+      },
+      {
+        "id": "system-read-only",
+        "name": "Read Only"
+      }
+    ],
+    "credentials": [
+      {
+        "id": "40da50a03e9143b598d030d8ef002e75",
+        "user_id": "79286cb6126b40ad9b61aaf558e045f9",
+        "auth_provider_type": "homeassistant",
+        "auth_provider_id": null,
+        "data": {
+          "username": "admin"
+        }
+      }
+    ],
+  }
+}
diff --git a/ansible/templates/.storage/auth_provider.homeassistant b/ansible/templates/.storage/auth_provider.homeassistant
new file mode 100644 (file)
index 0000000..e06fe0a
--- /dev/null
@@ -0,0 +1,13 @@
+{
+  "version": 1,
+  "minor_version": 1,
+  "key": "auth_provider.homeassistant",
+  "data": {
+    "users": [
+      {
+        "username": "admin",
+        "password": "JDJiJDEyJC9uWldxRlVGLmNoUVBrSnU4cE51Ty44WUhwUEk2MFcybFB3YXkyR3NVaXp0VGs0OXFBWGRp"
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/ansible/templates/.storage/core.config b/ansible/templates/.storage/core.config
new file mode 100644 (file)
index 0000000..d24a5ff
--- /dev/null
@@ -0,0 +1,18 @@
+{
+  "version": 1,
+  "minor_version": 3,
+  "key": "core.config",
+  "data": {
+    "latitude": 50.8868449,
+    "longitude": 3.9699125,
+    "elevation": 0,
+    "unit_system_v2": "metric",
+    "location_name": "Home",
+    "time_zone": "Europe/Brussels",
+    "external_url": null,
+    "internal_url": null,
+    "currency": "EUR",
+    "country": "BE",
+    "language": "en-GB"
+  }
+}
\ No newline at end of file
diff --git a/ansible/templates/.storage/http b/ansible/templates/.storage/http
new file mode 100644 (file)
index 0000000..3b66d5d
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "version": 1,
+  "minor_version": 1,
+  "key": "http",
+  "data": {
+    "use_x_forwarded_for": true,
+    "trusted_proxies": [
+      "127.0.0.1"
+    ],
+    "ip_ban_enabled": true,
+    "login_attempts_threshold": 5,
+    "ssl_profile": "modern",
+    "cors_allowed_origins": [
+      "https://cast.home-assistant.io"
+    ],
+    "server_port": 8123,
+    "use_x_frame_options": true
+  }
+}
\ No newline at end of file
diff --git a/ansible/templates/.storage/http.auth b/ansible/templates/.storage/http.auth
new file mode 100644 (file)
index 0000000..93de135
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "version": 1,
+  "minor_version": 1,
+  "key": "http.auth",
+  "data": {
+    "content_user": "8711b0930d8247ceadaa48c121e54f68"
+  }
+}
\ No newline at end of file
diff --git a/ansible/templates/.storage/onboarding b/ansible/templates/.storage/onboarding
new file mode 100644 (file)
index 0000000..663b719
--- /dev/null
@@ -0,0 +1,13 @@
+{
+  "version": 4,
+  "minor_version": 1,
+  "key": "onboarding",
+  "data": {
+    "done": [
+      "user",
+      "core_config",
+      "analytics",
+      "integration"
+    ]
+  }
+}
\ No newline at end of file
diff --git a/ansible/templates/.storage/person b/ansible/templates/.storage/person
new file mode 100644 (file)
index 0000000..8892320
--- /dev/null
@@ -0,0 +1,15 @@
+{
+  "version": 2,
+  "minor_version": 1,
+  "key": "person",
+  "data": {
+    "items": [
+      {
+        "id": "admin",
+        "name": "admin",
+        "user_id": "79286cb6126b40ad9b61aaf558e045f9",
+        "device_trackers": []
+      }
+    ]
+  }
+}
\ No newline at end of file