Use special ninja powers to manage system configurations 🥷
Project description
Config Ninja 🥷
Similar to confd
, manage your system configuration files by populating Jinja2 templates with data from a remote provider.
Installation
To install using pip
:
pip install config-ninja
Quick Start
To demonstrate the mechanics locally:
- create a settings file for
config-ninja
:cat <<EOF >config-ninja-settings.yaml CONFIG_NINJA_OBJECTS: example-0: dest: format: json path: ./.local/config.json source: backend: local format: toml init: kwargs: path: ./.local/config.toml EOF
- start
config-ninja
inmonitor
mode:config-ninja monitor
- in a separate shell, create the
config.toml
:cat <<EOF >./.local/config.toml [example-0] a = "first value" b = "second value EOF
- inspect the generated
settings.json
:cat settings.json
{ "example-0": { "a": "first value", "b": "second value" } }
Chances are, you'll want to update the config-ninja-settings.yaml
file to use a remote backend (instead of local
). See config_ninja.contrib for a list of supported config providers.
Configuration Architecture
The config-ninja
agent monitors the backend source for changes. When the source data is changed, the agent updates the local configuration file with the new data:
sequenceDiagram
loop polling
config-ninja->>backend: query for changes
end
backend->>+config-ninja: [backend changed] fetch config
config-ninja->>-filesystem: write updated configuration file
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
config_ninja-1.0.0b3.tar.gz
(22.4 kB
view hashes)
Built Distribution
Close
Hashes for config_ninja-1.0.0b3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8deb37335690a6c60a9902bd92defbf47688f42517abfebf4493aace509fdee8 |
|
MD5 | 28cf169f407e5ed83370ba962e7f206e |
|
BLAKE2b-256 | e4b048bb5ba8e4bacd307b3c6dc4e1b04e34a59ff4982138cb8c767254344a83 |