Hello Marius,
Marius Vollmer [2017-02-08 14:27 +0200]:
If someone drops /etc/cockpit/machines.d/10-foo.json, will those machines immediatly show up on the dashboard?
Would be nice at some point, with an inotify watch. My gut feeling was that this was a version 2 thing, as we don't do this right now either.
Do we expect 10-foo.json to specify a reasonable color for each?
They can of course, but the UI should pick an unused color if they don't.
Or would those machines only be available for autocompletion when the user explicitly adds a machine to the dashboard?
I think they should appear in full, like an entry from our current /var/.../machines.json.
If the user now adds or removes such a machine or changes the color for it, where does Cockpit store this? In 10-foo.json or in 99-webui.json?
Hmm, good question. My original intent was to change the file that defines the host entry, i. e. 10-foo.json in this example. This would look less confusing, but it might cause conflicts if 10-foo.json is being by puppet or similar which would then stomp over the config again. However, the same is true for pretty well every other setting that cockpit (indirectly) can make, such as hostname or time zone.
I think this is implicitly addressed in the wiki page, since it proposes to merge all the json files. So changing a color or visibility would go to 99-webui.json, which would overwrite what is already in 10-foo.json.
That would technically work too, yes. When reading we must support merging, the question is just where we write updates to. I don't have a strong opinion about that, though.
Thanks,
Martin