Skip to content

Instantly share code, notes, and snippets.

@ipcrm
Created February 17, 2016 16:26
Show Gist options
  • Save ipcrm/8a7496003daef43fd9cb to your computer and use it in GitHub Desktop.
Save ipcrm/8a7496003daef43fd9cb to your computer and use it in GitHub Desktop.
Restore PE Classification
#!/bin/bash
PRIMARY_MASTER='mastera'
SECONDARY_MASTER='masterb'
PATH="/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/opt/puppet/bin:$PATH"
declare -x PE_CERT=$(puppet agent --configprint hostcert)
declare -x PE_KEY=$(puppet agent --configprint hostprivkey)
declare -x PE_CA=$(puppet agent --configprint localcacert)
declare -x NC_CURL_OPT="-s --cacert $PE_CA --cert $PE_CERT --key $PE_KEY --insecure -X POST"
curl $NC_CURL_OPT --insecure -T /vagrant/class_bkup.json https://localhost:4433/classifier-api/v1/import-hierarchy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment