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.0b2.tar.gz
(22.4 kB
view hashes)
Built Distribution
Close
Hashes for config_ninja-1.0.0b2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f765df58b5073f155bd9449d4e29f3099585f4577302971119db6fb0b216201 |
|
MD5 | e76bd47b692edb150b1936fa327c84a9 |
|
BLAKE2b-256 | 9f99d28d73f59b53212354f28ff1cdf5bd8328900533642a4a1fcd18f314d3dc |