summaryrefslogtreecommitdiffstats
path: root/bin/nbroles_to_grains.sh
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2023-01-21 18:38:41 +0100
committerGeorg Pfuetzenreuter2023-01-21 18:54:58 +0100
commit97db5ef6db7952d8f7da9e46559a352736d4cb4d (patch)
treed3cfffd077cfc63b0cb54d30eeda5dade3ee838d /bin/nbroles_to_grains.sh
parent8c72e7c63a2124d19e361821ef184ce66a5d6cd4 (diff)
downloadsalt-97db5ef6db7952d8f7da9e46559a352736d4cb4d.tar.gz
salt-97db5ef6db7952d8f7da9e46559a352736d4cb4d.tar.bz2
salt-97db5ef6db7952d8f7da9e46559a352736d4cb4d.zip
Add nbroles_to_grains script + add note
Script allows for testing and pipeline minions to work without access to the roles API. Additionally added a note about this in prepare_minion.py. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'bin/nbroles_to_grains.sh')
-rwxr-xr-xbin/nbroles_to_grains.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/nbroles_to_grains.sh b/bin/nbroles_to_grains.sh
new file mode 100755
index 0000000..4d955fb
--- /dev/null
+++ b/bin/nbroles_to_grains.sh
@@ -0,0 +1,4 @@
+#!/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.
+
+sed -i "s/salt\['nbroles.get'\](id)/grains\['roles'\]/" */top.sls