Last active
August 29, 2015 14:07
-
-
Save marshyski/0c500dd8d487be256b89 to your computer and use it in GitHub Desktop.
Shutdown script, remove clients cert by invoking Puppet Master API
This file contains 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 | |
#Remove clients cert by invoking Puppet Master API | |
CERTNAME=`facter fqdn` | |
PUPMASTER='puppet' | |
SSLDIR=`puppet agent --configprint ssldir` | |
curl --noproxy '*' -X DELETE -H "Accept: pson" https://${PUPMASTER}:8140/production/certificate_status/${CERTNAME} --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem --key /etc/puppetlabs/puppet/ssl/private_keys/${CERTNAME} --cert /etc/puppetlabs/puppet/ssl/certs/${CERTNAME} | |
#Remove clients SSL directory | |
rm -rf ${SSLDIR} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment