jhampson-dbre / home_assistant

Ansible collection for related Home Assistant roles
MIT License
12 stars 5 forks source link

Leave the keys alone? #40

Closed powerjc closed 2 years ago

powerjc commented 2 years ago

Hi, thank you for taking the time to put this together and keep it up. Very much appreciate the collection and roles. My issue is that I always end up patching your preinstall config role to leave the ssh keys alone. It moves my default controller key and breaks lots of other stuff for me every time I run it. Could we implement a check for an existing key on the target to make this role idempotent, or perhaps a variable to skip the key manipulation altogether, or perhaps just a less common key name to step on less things?

Happy to put together a PR if one of those sounds acceptable. Thanks again for putting these out there.

jhampson-dbre commented 2 years ago

I think it's a good idea to check if key already exists on the controller and adds it to authorized keys on home assistant server. Otherwise if no key exists, then it can still create it like it does now. PR would be welcome 👍

jhampson-dbre commented 2 years ago

The fix to use pre-existing keys now available in v1.1.0 of the collection. I also went ahead and implemented the other suggestions.

Let me know if you run into any problems with the new features!