Skip to content

Instantly share code, notes, and snippets.

@acidprime
Last active October 10, 2017 18:08
Show Gist options
  • Save acidprime/28e0eb99e6af495a24507a8a01e2400d to your computer and use it in GitHub Desktop.
Save acidprime/28e0eb99e6af495a24507a8a01e2400d to your computer and use it in GitHub Desktop.
#!/bin/bash
CERTNAME=$(puppet master --configprint certname)
# Revoke
curl \
--verbose \
-X PUT \
-H "Content-Type: text/pson" \
--data '{"desired_state":"revoked"}' \
--cert /etc/puppetlabs/puppet/ssl/certs/$CERTNAME.pem \
--key /etc/puppetlabs/puppet/ssl/private_keys/$CERTNAME.pem \
--cacert /etc/puppetlabs/puppet/ssl/ca/ca_crt.pem \
https://$CERTNAME:8140/production/certificate_status/erica_sivak
# Delete
curl -X DELETE \
--verbose \
-H "Accept: pson" \
--cert /etc/puppetlabs/puppet/ssl/certs/$CERTNAME.pem \
--key /etc/puppetlabs/puppet/ssl/private_keys/$CERTNAME.pem \
--cacert /etc/puppetlabs/puppet/ssl/ca/ca_crt.pem \
https://$CERTNAME:8140/production/certificate_status/erica_sivak
@acidprime
Copy link
Author

tested with

puppet cert generate erica_sivak
./delete-cert.sh
puppet cert --list --all | grep erica_sivak -c
0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment