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.
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
Features
- ✅ Integration with AWS AppConfig for managing server configuration files
- ✅ Extensible design supports backends for new providers and formats
- ✅
jinja2templating for arbitrary configuration file formats - ✅ Execute
poethepoettasks after updating files
Installation
config-ninja is installed using the official installer or with pip / pipx. After installation, you can enable config-ninja as a systemd service.
Official Installer
The recommended way to install config-ninja is with the official installer:
curl -sSL https://config-ninja.github.io/config-ninja/install.py | python3 -
To view available installation options, run the installer with the --help flag:
curl -sSL https://config-ninja.github.io/config-ninja/install.py | python3 - --help
usage: install [-h] [--version VERSION] [--pre] [--uninstall] [--force] [--path PATH] [--backends BACKENDS]
Installs the latest (or given) version of config-ninja
options:
-h, --help show this help message and exit
--version VERSION install named version
--pre allow pre-release versions to be installed
--uninstall uninstall config-ninja
--force respond 'yes' to confirmation prompts; overwrite existing installations
--path PATH install config-ninja to this directory
--backends BACKENDS comma-separated list of package extras to install, or 'none' to install no backends
With pip / pipx
Alternatively, use pip / pipx to install all available backends (or choose a specific one):
pipx install 'config-ninja[all]'
With uv
uv tool install 'config-ninja[all]'
Enable the systemd Service
After installing config-ninja, enable it as a systemd service for the current user:
# omit '--user' to install the agent at the system level
config-ninja self install --user
Multiple instances of the service can also be installed to reference different settings files. For example, the following command will create the service named etc-config--ninja-alternate.service:
sudo config-ninja self install --config /etc/config-ninja/alternate.yaml
How It Works
To demonstrate how the mechanics work (using the local backend):
- create a settings file for
config-ninja:cat <<EOF >config-ninja-settings.yaml CONFIG_NINJA_OBJECTS: example-0: dest: format: json path: ./.local/settings.json source: backend: local format: toml init: kwargs: path: ./.local/config.toml EOF
- run
config-ninjain monitor mode:config-ninja apply --poll
- in a separate shell, create the
config.toml:cat <<EOF >./.local/config.toml [example-0] a = "first value" b = "second value EOF
- Inspect the
settings.jsonfile created byconfig-ninja:cat ./.local/settings.json{ "example-0": { "a": "first value", "b": "second value" } }
- Make changes to the data in
config.toml, andconfig-ninjawill updatesettings.jsonaccordingly:cat <<EOF >>./.local/config.toml [example-1] c = "third value" d = "fourth value EOF cat ./.local/settings.json
{ "example-0": { "a": "first value", "b": "second value" }, "example-1": { "c": "third value", "d": "fourth 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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file config_ninja-3.0.0.tar.gz.
File metadata
- Download URL: config_ninja-3.0.0.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8428e924fe4a0bdc468bf478da9a6a786c3c84de0604fd1120968b9caaf94fb
|
|
| MD5 |
91416fca9e1b1e5e0cfeefe5d347a15d
|
|
| BLAKE2b-256 |
c488d6878bebaf453f89046293909a1c1d813c2ff0f2523c5803e21ef1610ec1
|
Provenance
The following attestation bundles were made for config_ninja-3.0.0.tar.gz:
Publisher:
push-poe.yaml on config-ninja/config-ninja
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
config_ninja-3.0.0.tar.gz -
Subject digest:
f8428e924fe4a0bdc468bf478da9a6a786c3c84de0604fd1120968b9caaf94fb - Sigstore transparency entry: 1201859105
- Sigstore integration time:
-
Permalink:
config-ninja/config-ninja@577b3b9604f2dd5de803a0560c89720fff28698d -
Branch / Tag:
refs/tags/v3.0.0 - Owner: https://github.com/config-ninja
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
push-poe.yaml@577b3b9604f2dd5de803a0560c89720fff28698d -
Trigger Event:
push
-
Statement type:
File details
Details for the file config_ninja-3.0.0-py3-none-any.whl.
File metadata
- Download URL: config_ninja-3.0.0-py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fe2709cf294f48fcbe9b318b248303e6581cd16aeff2f38840dc1f4fdb078ef
|
|
| MD5 |
fda4c0333876538e61f462226f5f6ac4
|
|
| BLAKE2b-256 |
15fe4e30ffd24f20272677cd52a3c565d8c4a27893ebbb19e1b41f9b97036021
|
Provenance
The following attestation bundles were made for config_ninja-3.0.0-py3-none-any.whl:
Publisher:
push-poe.yaml on config-ninja/config-ninja
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
config_ninja-3.0.0-py3-none-any.whl -
Subject digest:
0fe2709cf294f48fcbe9b318b248303e6581cd16aeff2f38840dc1f4fdb078ef - Sigstore transparency entry: 1201859107
- Sigstore integration time:
-
Permalink:
config-ninja/config-ninja@577b3b9604f2dd5de803a0560c89720fff28698d -
Branch / Tag:
refs/tags/v3.0.0 - Owner: https://github.com/config-ninja
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
push-poe.yaml@577b3b9604f2dd5de803a0560c89720fff28698d -
Trigger Event:
push
-
Statement type: