ema / pets

A configuration management system for Pets, not Cattle
MIT License
460 stars 9 forks source link

Option to strip pets comments #23

Closed scottdotau closed 7 months ago

scottdotau commented 1 year ago

Hey,

Thanks for this tool - has made it much easier to manage configuration on my small home cluster.

One problem I've had is with JSON configurations, for example Dockers daemon.json. As comments are not allowed in json files, Docker will fail to start if the file has been managed by pets.

Would it be possible to add functionality to strip pets comments once file has been replaced and it's post conmand run?

# pets: clean=true

I'm currently using sed in a post-command to do this, though it was a bit of a pain in the ass to get working.

The only side effect I've noticed is that the file will be marked as changed in each run - which is preferable to me than not having the file be managed at all!

Thanks again