New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Atomic validation and load of a config file #164
Comments
So I guess the best way to implement this is to create the databases in temporal placeholders, and once everything is tidy, swap pointers. It can be a little expensive memory-wise, but there really isn't any other way to ensure a revert will never fail, I think. All right, it doesn't look too hard, but my sidekick candidate rejected the job in the end, so I don't much see this (or the namespace gimmic) happening in the next release :/
Why don't you just
If you mean you'd be tying your script to Jool's output format, and you don't like that, you can use the
Hmmm... well, yes, but each configuration value is still a separate command. Which means if one fails (for something like invalid syntax), you still have to revert the other ones, do you not? |
Because after the Thanks for the tip about the
I'm less concerned about failing to toggle one of the global parameters, as those are mostly autonomous. I'm more worried about e.g. the contents of the EAMT. In any case, I probably won't attempt to implement rollback logic in my wrapper script, but rather try to make very certain that I don't try to apply invalid config. |
Still thinking about the milestone this should be in. I've actually never seen a table in a typical .cfg file. Failing that, does JSON sound comfortable? |
JSON or maybe YAML sounds fine. Regarding the milestone, don't give it much priority, there's no rush - just wanted to make sure the suggestion was made. |
We're using Puppet as our config management/automation system. I wanted to integrate Jool into it, and found that it would be somewhat complex. Puppet will know what Jool's complete configuration should look like, the challenge is to actually synchronise that with the actual running configuration. In order to manipulate any of the pools or the EAMT, for example, I need first dump the current contents (parsing the output from the
jool
orjool_siit
utilites, which would be somewhat fragile), look for entries there that are no longer defined in Puppet and remove them, then add any missing entries. It's far from impossible, but it would take a bit of scripting. Also, in order to ensure I don't end up in a half-committed state I need to validate that the entire new config is correct from the start, otherwise I might end up failing to add a pool/eamt entry half-way through. The global settings are easier as I assume I can just set them every time, and if they're already set correctly that should be a no-op, I guess.So what I think would be nice is to be able to write out Jool's entire configuration in configuration file, and then run, e.g.,
jool --load jool.cfg
. If the config is valid, it gets loaded (preferably in an atomic manner), or if invalid, the entire load will be aborted and Jool continues to operate using the old config. Compareiptables-restore
, which does something very similar.I'll probably end up writing a Perl script that does something like this, and would be happy to contribute it in case you're interested. Just thought I'd mention in case this is an idea you'd be interested in integrating directly into the
jool
/jool_siit
utilities.The text was updated successfully, but these errors were encountered: