Project

General

Profile

Actions

User story #6977

closed

Add generic methods to allow convenient data management

Added by Alexis Mousset about 7 years ago. Updated 4 months ago.

Status:
Rejected
Priority:
N/A
Category:
Generic methods
Target version:
UX impact:
Suggestion strength:
User visibility:
Effort required:
Regression:

Description

There are currently no easy way to manage complex configuration data (such as configuration to be used in template expanding), nor guidelines about file organization (in techniques or shared-files). That can be a problem for techniques with a lot of data, and makes techniques reuse and sharing quite difficult

We should be able to separate policies from data used by the policies, and offer a standard way to manage files and data in techniques created with NCF. This would also allow fetching data from varied sources (local files, remote files, API calls, etc.) For this, we can use the CFEngine data container type which can contain classic structures, JSON (since 3.6) and soon YAML (in 3.7).

Useful generic methods include:
  • load data from a json local file
  • load data from a json answer to an HTTP request
  • merge two data variables: override the content of one variable with the content of another
  • expand a mustache template from a given data variable (and not from the context)
  • define a CFEngine variable (string, int)
This allows to:
  • define several data layers, with a defined priority (host-specific -> group-specific data (for example) -> default technique data)
  • define a standard application technique using a conventional defaults.json file
Most application techniques could contain:
  • A list of actions (install packages, expand a template, start a service)
  • A system configuration (package names, service names) which needs to depend on CFEngine classes, but should probably not need to be modified
  • A default application configuration (used as parameter is some configuration actions or variables in template expansion)
  • A set of template files
    ----
  • A user application configuration which would override the default
  • Maybe more files or template files
Actions #1

Updated by Alexis Mousset about 7 years ago

  • Status changed from New to In progress
  • Assignee set to Alexis Mousset
Actions #3

Updated by Alexis Mousset almost 7 years ago

  • Status changed from In progress to Rejected
Actions #4

Updated by Alexis Mousset 4 months ago

  • Target version changed from 0.x to ncf-0.x
Actions #5

Updated by Alexis Mousset 4 months ago

  • Project changed from 41 to Rudder
  • Category set to Generic methods
Actions

Also available in: Atom PDF