Last active
May 13, 2016 00:25
-
-
Save natemccurdy/13e3b2d8477dbd6bd01d to your computer and use it in GitHub Desktop.
Clear the jruby pools in puppetserver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# GIST_URL: https://gist.github.com/natemccurdy/13e3b2d8477dbd6bd01d | |
# Run this on a puppetserver to delete its JRuby pools to clear their cache. | |
# A response of "HTTP/1.1 204 No Content" means it worked. | |
# | |
# https://docs.puppetlabs.com/puppetserver/latest/admin-api/v1/jruby-pool.html | |
CONFDIR="$(puppet master --configprint confdir)" | |
CERT="$(puppet master --confdir "${CONFDIR}" --configprint hostcert)" | |
PRIVKEY="$(puppet master --confdir "${CONFDIR}" --configprint hostprivkey)" | |
CACERT="$(puppet master --confdir "${CONFDIR}" --configprint localcacert)" | |
/opt/puppetlabs/puppet/bin/curl -s -i -X DELETE \ | |
--cert "$CERT" \ | |
--key "$PRIVKEY" \ | |
--cacert "$CACERT" \ | |
"https://$(hostname -f):8140/puppet-admin-api/v1/jruby-pool" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment