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 weeks ago

ztefanie commented 2 weeks 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.