adagios
adagios copied to clipboard
Revert config from git commit
It would be sweet if I could just revert the config to commit xyz from git. Say for example if I accidentally delete a contact, I could just click a "Revert to" button in the object history Any thoughts?
Agreed the feature is nice, but i wonder if it is simpler to install something that has a strong focus on being a full-fledged git ui. git-webui comes to mind.
This can get complicated quite fast, if the change you want to revert is not the latest one.
Wouldn't a full blown git UI be an overkill for a simple git reset <commit hash> <filename>
.
It would be git revert (not reset), and from adagios perspective this is complicated, because adagios user might not be aware of how git works.
For example, consider the situation where a user makes 2 changes to an object, and then clicks the first change and does 'undo', will what happens be unexpected to the user ?
This would be save if it was only possible to 'undo' last change made.
However, considering that, doing a git 'revert' creates a new commit (instead of erasing an older commit) so we would have to be semantically aware of what was in a single git commit.
I am open to pull requests if anyone wants to implement this, but please make sure that the feature implemented will make sense to users who are not aware of git fundamentals.
it would be fine to revert to the last good configuration, that is, the configuration of the previous sucessful restart.
Since adagios checks the config before restarting nagios it would be enough to label the git state as "good" after a sucessful verify+restart (via adagios reload button).
In this way, the rollback button would appear after changes are made and disappear once a sucessful restart is done. It would revert to the "good" git commit.
Good idea.