git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
path: root/site/profile/files/puppetmaster
diff options
context:
space:
mode:
authormail_redacted_for_web 2015-11-24 11:16:51 -0800
committermail_redacted_for_web 2015-11-24 11:16:51 -0800
commitafc9a358f30c51029d7a37122d4adfcc2add88a6 (patch)
tree655439e13d1cee28e254d6d92da6f13c4c5aa670 /site/profile/files/puppetmaster
parent869a5c3aa974b53e2f7f4c8fd8ab01fab0420f6d (diff)
parent7e40513c531d98015101367baf5d480d7ea6d2e3 (diff)
downloadcontrol-repo-template-afc9a358f30c51029d7a37122d4adfcc2add88a6.tar.bz2
Merge branch 'production' of https://github.com/npwalker/control-repo into merge_npwalker_control_repo
Diffstat (limited to 'site/profile/files/puppetmaster')
-rw-r--r--site/profile/files/puppetmaster/update-classes.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/site/profile/files/puppetmaster/update-classes.sh b/site/profile/files/puppetmaster/update-classes.sh
new file mode 100644
index 0000000..fc33026
--- /dev/null
+++ b/site/profile/files/puppetmaster/update-classes.sh
@@ -0,0 +1,11 @@
+#https://docs.puppetlabs.com/pe/latest/nc_update_classes.html#post-v1update-classes
+
+CONFDIR=$(puppet master --configprint confdir)
+
+CERT=$(puppet master --confdir ${CONFDIR} --configprint hostcert)
+CACERT=$(puppet master --confdir ${CONFDIR} --configprint localcacert)
+PRVKEY=$(puppet master --confdir ${CONFDIR} --configprint hostprivkey)
+OPTIONS="--cert ${CERT} --cacert ${CACERT} --key ${PRVKEY}"
+CONSOLE=$(awk '/server: /{print $NF}' ${CONFDIR}/classifier.yaml)
+
+curl -k -X POST ${OPTIONS} "https://${CONSOLE}:4433/classifier-api/v1/update-classes"