summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/nbroles_to_grains.sh4
-rwxr-xr-xbin/prepare_minion.py1
2 files changed, 5 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
diff --git a/bin/prepare_minion.py b/bin/prepare_minion.py
index e89434a..a4aee0c 100755
--- a/bin/prepare_minion.py
+++ b/bin/prepare_minion.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
+# Prepares a minion for local testing of Salt code in this repository. Requires roles to be written as grains, as development and pipeline containers generally do not have access to our roles API. Consider nbroles_to_grains.sh first if this is the case.
import roles
import os