-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support maverick configuration load / save / edit #119
Comments
-web related but the editor from vscode can be embedded for editing json files... |
https://github.com/Microsoft/monaco-editor/blob/master/monaco.d.ts#L5853 Possible to allow json comments |
Diffs are also possible to display. Just need to load the contents of both files. https://microsoft.github.io/monaco-editor/playground.html#creating-the-diffeditor-multi-line-example |
use pyinotify to watch for file changes... if not available (cloud9, vscode has taken all the file watchers) fall back to polling for changes (as per the config file of -api) |
|
on -api startup snapshot config files and check against what is stored in the database. If they are the same do nothing, otherwise create a new version revision. While -api is active, changes to the config file will not create a new version in the database unless it is requested from -web or a maverick-configure is run. When -api / system restarts, any non-captured changes will create a new entry in the database. It sounds a lot like git... consider using a pure python git interface to manage changes https://github.com/dulwich/dulwich |
Note the following is a hierarchy with the top files overwriting any config set in the files below.
mav@dev:~/software/maverick/conf$ cat hiera.yaml
---
version: 5
defaults:
datadir: /srv/maverick
data_hash: json_data
hierarchy:
- name: "localconf"
path: "config/maverick/localconf.json"
- name: "Local node files"
path: "config/maverick/local-nodes/%{::hostname}.json"
- name: "Environment node files"
path: "software/maverick/conf/environments/%{::environment}/nodes/%{::hostname}"
- name: "Environment defaults"
path: "software/maverick/conf/environments/%{::environment}/defaults.json"
- name: "Sample node files"
path: "software/maverick/conf/sample-nodes/%{::hostname}.json"
- name: "Maverick defaults"
path: "software/maverick/conf/maverick-defaults.json"
- name: "Puppet defaults"
path: "software/maverick/conf/puppet-defaults.json" |
Maverick configuration files are JSON
Read configuration files and expose the content via graphql as name:value pairs (similar to parameters)
On save from -web archive old file and write out new one
Expose diff of JSON via graphql
The text was updated successfully, but these errors were encountered: