-
-
Save skywalka/dd571cff10f02c7cb05f to your computer and use it in GitHub Desktop.
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 | |
# node deactivation for an all-in-one (aka monolithic) PE master | |
# ignores mcollective deactivation | |
# read certnames from STDIN (one per line) and deactivate | |
while read certname; do | |
/opt/puppet/bin/puppet license 2>&1 | head - -n2 | |
/bin/su - peadmin -c "/opt/puppet/bin/mco service stop pe-puppet -I $certname" | |
/opt/puppet/bin/puppet node deactivate $certname | |
/opt/puppet/bin/puppet cert revoke $certname | |
/opt/puppet/bin/puppet agent -t | |
/opt/puppet/bin/rake -f /opt/puppet/share/puppet-dashboard/Rakefile RAILS_ENV=production node:del["$certname"] | |
/opt/puppet/bin/puppet cert clean $certname | |
done | |
/sbin/service pe-memcached restart | |
/sbin/service pe-puppetserver restart | |
/opt/puppet/bin/puppet license 2>&1 | head - -n2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment