-
Notifications
You must be signed in to change notification settings - Fork 102
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
Idempotent configuration commands & config management #4597
Comments
I've done some work in our Ansible repo on OMERO.server: ome/infrastructure#61 There's a lot of conditionals in there to ensure idempotency, but it has crossed my mind that an OMERO Ansible module/library would be useful, e.g. importing |
... Noted. Thanks.
Have you tried just putting it into its location?
Using the regular ansible move logic, this should be idempotent. Add a handler "if moved, then run bin/omero scripts list".
... In general, definitely a good idea. If anyone has suggestions on concrete actions, we'd love to see them. Cheers, |
I did try variations on this, but in the end I decided not to do that because in the end you have to fall back on the bash foo. This happens when:
This is working for now until an idempotent configuration becomes available. |
I still think it'd be safe if using The only other alternative I can provide before a full solution is use of git. Long-term, I'd like to see a registry in the server where you register locations using |
The I think the way it's working in our ansible configuration at the moment is fine, it was just a good example of something that was hard to deal with idempotently. |
I disagree. You can still simply cp the file into place. That counts as an "official installation".
Can certainly understand that if something is working you don't want to change it! |
@joshmoore Ok, I think I understand what you are saying now after some experiments. I thought that the I might do this as it's a lot simpler. Thanks. |
This will only add a value if it's not already in the list See ome#4597
During our recent ansible configuration of OMERO I had to do some less than desirable things to make it work because some of the configuration can not be done idempotently.
Examples:
When configuring
omero.web.ui.top_links
it is not possible to useappend
because this will result in (after multiple runs) repeated entries, so instead it is necessary to useset
which necessitates specifying all of the defaults (which could easily change with a new OMERO version).I think the best solution to this could be a new command
exists
for things which are lists.For the
omero.web.ui.top_links
example:This one could probably be configured by manipulating XML instead, but as that is not the recommended way to do these changes then I think this makes more sense. Here is another example which could not be done that way though.
Plugin scripts are installed with
upload
and then replaced withreplace
. This is fine when doing things manually, but when using config management, it has no way of knowing what to do. If you runupload
every time this results in the original script not being replaced. On the flip side, even if the script is already installed, it can't be replaced without some nasty bash foo to get the ID.I'm not certain what the best way to fix that one is. Perhaps a command that is not based on ID like
replace_or_install_script_at_location
or something.It would be really nice to be able to have any idempotent commands return values be such that config management could determine if something has
changed
or not.Finally, if Ansible is what we are all using, then perhaps an action plugin or module could be developed (perhaps making use of underlying idempotent commands with nice return types) so that one could do something like:
The text was updated successfully, but these errors were encountered: