summaryrefslogtreecommitdiffstats
path: root/salt/_modules
diff options
context:
space:
mode:
Diffstat (limited to 'salt/_modules')
-rw-r--r--salt/_modules/nbroles.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/salt/_modules/nbroles.py b/salt/_modules/nbroles.py
new file mode 100644
index 0000000..54c4b79
--- /dev/null
+++ b/salt/_modules/nbroles.py
@@ -0,0 +1,12 @@
+#to-do: tidy this up, make host configurable
+
+import requests
+
+host = 'http://127.0.0.1:5000/roles?machine='
+
+def get(name):
+ req = requests.get(host + name)
+ if req.status_code == 404:
+ return([])
+ if req.status_code == 200:
+ return(req.json()['roles'])