Inspired by puppet, kustomized and GitOps practices.
- multitenant templates
- hieradata variables
- template plugins
- flask rest service
- gitsync for config repository synchronization in web mode
$ 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
$ 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
- Go to Setting -> Developer Settings -> Fine-grained personal access tokens
- Create a token with following settings:
Only select repositories
and select your repositoryRepository permissions
and selectContent
Set the token as $GH_PAT
in your local environment.
$ git tag v1.0
$ git push origin v1.0