digitalfabrik / entitlementcard

App for 'Digitale Berechtigungskarten', generally benefit card for volunteers or socially vulnerable groups in Germany. App for Android & iOS + Backend + Administration Web Portal – 100% Open Source.
MIT License
36 stars 3 forks source link

Remove duplication of backend config #1627

Open ztefanie opened 2 months ago

ztefanie commented 2 months ago

Issue: Currently, any changes made in config.yaml in our GitHub repository also require manual updates in the Salt .sls files, leading to redundant work and potential inconsistencies.

possible solutions:

  1. Automate the synchronization of config.yaml using a CI/CD pipeline. This can be set up so that any changes in the GitHub repository are automatically reflected in Salt Pillar or the .sls files, eliminating the need for manual updates.

Alternative Solutions:

  1. Use Jinja templating in SaltStack to dynamically reference values from config.yaml. e.g.
    
    {% set config = salt['pillar.get']('config') %}

entitlementcard: projects: {% for project in config.projects %} {{ project.id }}: print-office-domain: {{ project.id }} {% for key, value in project.items() %} {{ key }}: {{ value }} {% endfor %} {% endfor %}



3. Store config.yaml in Salt Pillar and reference it directly in Salt states.

4. Use external YAML file inclusion to pull config.yaml into Salt.
f1sh1918 commented 1 month ago

We decided on 2) We have to create a ticket for sven in open project @ztefanie

ztefanie commented 1 month ago

releated gitea issue: https://openproject.tuerantuer.org/projects/infra/work_packages/3679/activity