summaryrefslogtreecommitdiffstats
path: root/bin/nbroles_to_grains.sh
blob: 1ff5f69a7dc38556942128a054d65bdaa95b35b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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.

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[@]}