Skip to content

Support maverick configuration load / save / edit #119

Description

@SamuelDudley

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

Activity

  1. self-assigned this
    on Mar 21, 2019
  2. SamuelDudley commented on Sep 4, 2019

    @SamuelDudley
    MemberAuthor

    -web related but the editor from vscode can be embedded for editing json files...
    https://www.npmjs.com/package/monaco-editor-vue

  3. SamuelDudley commented on Sep 4, 2019

    @SamuelDudley
    MemberAuthor
  4. SamuelDudley commented on Sep 4, 2019

    @SamuelDudley
    MemberAuthor

    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

  5. pinned this issue on Jan 23, 2020
  6. added this to the 1.2 milestone on Feb 2, 2020
  7. SamuelDudley commented on Mar 15, 2020

    @SamuelDudley
    MemberAuthor

    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)

  8. SamuelDudley commented on Mar 15, 2020

    @SamuelDudley
    MemberAuthor
    1. need a graphql interface for writing individual settings. (C)
    2. need a graphql interface for reading individual settings. (R)
    3. individual settings that already exist will be overwritten via 1 (U)
    4. need a unique message for deleting settings (D)
    5. need a graphql interface for reading all settings back as a list of settings.
    6. need a graphql interface for writing an entire file from a the browser with md5 checks (power user mode)
    7. need a graphql interface for reading all available settings and supported values. (like param meta)
    8. need graphql interface for diff. changed, added, deleted
    9. need graphql interface for saving files / database entry
    10. need graphql interface for loading files / database entry
    11. need graphql interface for deleting files / database entry
    12. need graphql interface for exposing available saved files / database entries
  9. SamuelDudley commented on Mar 15, 2020

    @SamuelDudley
    MemberAuthor

    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

  10. SamuelDudley commented on Mar 16, 2020

    @SamuelDudley
    MemberAuthor

    Note the following is a hierarchy with the top files overwriting any config set in the files below.
    read the hostname, environment (~/config/maverick/maverick-environment.conf) and branch (~/config/maverick/maverick-branch.conf)

    ~/software/maverick/conf/hiera.yaml

    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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions