Best DevOps practices for HAAS config management and deployment

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:

  1. Backup - when my Rasbery Pi eventually fail, what would happen to all my configs etc. Need to have a place to restore from.
  2. 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.

  1. Create a GitHub repo (as some of you already have to show off their config)

  2. 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?

  3. 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

  4. 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

  5. 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?

I use this configuration, except that I have a Lubuntu VM on my desktop with a test installation of HA so that I can check out any changes I make before I deploy them to my Pi.

It works quite well for me.

Although I still use vi on my VM.

I’m setting up a similar set up (and use it for all my home stuff, like plex, sabnzbd, etc). The only thing I’d do differently is not necessarily clone the git repo to the laptop directly. I’d use ansible to ship your code and configurations.

I.e let ansible manage it all and then just run your playbooks after an update.