https://github.com/pprzetacznik/gitops-configserver
GitOps ConfigServer
https://github.com/pprzetacznik/gitops-configserver
config configserver gitops hieradata jinja2 multitenancy puppet templates yaml
Last synced: 26 days ago
JSON representation
GitOps ConfigServer
- Host: GitHub
- URL: https://github.com/pprzetacznik/gitops-configserver
- Owner: pprzetacznik
- License: other
- Created: 2024-10-25T17:40:08.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-05-05T22:21:27.000Z (11 months ago)
- Last Synced: 2025-09-03T21:00:58.816Z (7 months ago)
- Topics: config, configserver, gitops, hieradata, jinja2, multitenancy, puppet, templates, yaml
- Language: Python
- Homepage: https://pypi.org/project/gitops-configserver/
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitOps Configserver
[](https://github.com/pprzetacznik/gitops-configserver/actions/workflows/release.yml)
[](https://github.com/pprzetacznik/gitops-configserver/actions/workflows/test.yml)
[](https://pypi.org/project/gitops-configserver/)
[](https://pypi.org/project/gitops-configserver/)
[](https://gitops-configserver.readthedocs.io/en/latest/?badge=latest)
Inspired by puppet, kustomized and GitOps practices.
## Planned features
* multitenant templates
* hieradata variables
* template plugins
* flask rest service
* gitsync for config repository synchronization in web mode
## Usage
```
$ python -m gitops_server.cli config_gen -h
usage: cli.py config_gen [-h] --config_dir CONFIG_DIR
options:
-h, --help show this help message and exit
--config_dir CONFIG_DIR
Config directory
```
Example target repository:
* see `config` directory for example configuration with templates,
* https://github.com/pprzetacznik/gitops-configserver-tests
```
$ python -m gitops_server.cli server --config_dir=config
...
$ curl http://localhost:8002/configs
{"tenants":["tenant1"]}
$ curl -X GET \
-H "Content-type: application/json" \
-H "Accept: application/json" \
-d "{\"environment\": \"prod\"}" \
http://localhost:8002/configs/tenant1/template1.tpl
```
## Using cli for generating config
```
$ pip install -e .
$ gitops-configserver \
template_gen \
--config_dir=resources/test_config \
--tenant_name=tenant2 \
--template_name=build_variants.yaml \
--facts='{"environment": "test"}' > result1.txt
$ cat result1.txt
build:
my_application:
- env: test
os: ubuntu22.04
python: 3.12
- env: test
os: ubuntu22.04
python: 3.13
- env: test
os: ubuntu24.04
python: 3.12
- env: test
os: ubuntu24.04
python: 3.13
- env: dev
os: ubuntu18.04
python: python3.8
```
## Setting up GitHub tokens
* Go to Setting -> Developer Settings -> Fine-grained personal access tokens
* Create a token with following settings:
* `Only select repositories` and select your repository
* `Repository permissions` and select `Content`
Set the token as `$GH_PAT` in your local environment.
## Publish new release
```
$ git tag v1.0
$ git push origin v1.0
```