Merge pull request 'Check files in nbroles to grains script' (#60) from nbroles-to-grains-refactor into production
All checks were successful
ci/lysergic/push/pipeline Pipeline was successful

Reviewed-on: #60
This commit is contained in:
Georg Pfuetzenreuter 2023-05-01 21:48:34 +02:00
commit bfeeb8673e

View File

@ -1,4 +1,14 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# This rewrites top-files to fetch roles from grains instead of our custom roles API. Useful for testing outside of the LibertaCasa infrastructure, but not recommended for production. # This rewrites top-files to fetch roles from grains instead of our custom roles API. Useful for testing outside of the LibertaCasa infrastructure, but not recommended for production.
sed -i "s/salt\['http.query'\].*/grains\['roles'\] -%}/" */top.sls salt/common/suse.sls potential_files=(*/top.sls salt/common/suse.sls)
for file in ${potential_files[@]}
do
if [ -f "$file" ]
then
files+="$file "
fi
done
sed -i "s/salt\['http.query'\].*/grains\['roles'\] -%}/" ${files[@]}