Hello all,
I am fairly new to HAAS, but already managed to amass quite large setup with Zwave components, IR blasters, Harmony, Wi-fi, rest, MQTT , homebridge , camera components, sensors…
My original configuration.yaml got to complex quite quickly. Editing those config files in VI on linux is not convenient. Making copies of config files before making changes clutter the directory. Having config files split into various includes directories, makes it difficult to see the whole project in vi.
So I quickly realised I need DevOps solution for all this and I want to edit my yaml files in a nice editor and deploy changes to my target HAAS host automatically. So my question is what are the approaches that some of you taken to solve this problem?
There multiple issues here:
- Backup - when my Rasbery Pi eventually fail, what would happen to all my configs etc. Need to have a place to restore from.
- Making continued HAAS configuration /automation changes easier to manage.
This is what I am thinking of doing. Let me know if you think alone the same lines, or have a better simpler approach that works well.
-
Create a GitHub repo (as some of you already have to show off their config)
-
Move my config files there. (Question remains how to handle secrets.yaml and other files like Zwave components, harmony files etc. That are not suitable to be published publicly) Where do you store those?
-
Clone GitHub repo to my laptop. Use PyCharm or similar IDE on my laptop to develop and make changes to my configs. Commit back to GitHub
-
Install git on my Rasbery Pi running HAAS and clone repo there. So that all changes are actually made on my laptop and I can always get latest config code on my haas Rasbery PI
-
Install Ansible on my PI and create playbooks to deploy those latest configs to my .homeassistant directory with making backups before each deployment. Can also restart it from playbooks. This can be taken even further with Free version of Ansible Tower.
Does this sound overly complex?
How do you handle your config files history of changes and how do you do your deployment in a predictable manner?