summaryrefslogtreecommitdiffstats
path: root/scripts/hbac-add-host.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/hbac-add-host.sh')
-rwxr-xr-xscripts/hbac-add-host.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/hbac-add-host.sh b/scripts/hbac-add-host.sh
new file mode 100755
index 0000000..74dcac9
--- /dev/null
+++ b/scripts/hbac-add-host.sh
@@ -0,0 +1,24 @@
+#!/bin/sh +x
+
+. ./include.sh
+
+json="{
+ \"method\": \"hbac_add_host\",
+ \"params\": [
+ [ \"test\" ],
+ {
+ \"host\": \"dev.example.com\",
+ \"hostgroup\": \"production\"
+ }
+ ],
+ \"id\":0
+}"\
+
+curl\
+ -H "Content-Type:application/json"\
+ -H "Accept:applicaton/json"\
+ --negotiate -u :\
+ --cacert /etc/ipa/ca.crt\
+ -d "$json"\
+ -X POST\
+ $IPA_JSON_URL