Skip to content

Instantly share code, notes, and snippets.

@skywalka
Forked from jpadams/deactivate_allinone.sh
Last active August 29, 2015 14:22
Show Gist options
  • Save skywalka/dd571cff10f02c7cb05f to your computer and use it in GitHub Desktop.
Save skywalka/dd571cff10f02c7cb05f to your computer and use it in GitHub Desktop.

Revisions

  1. jpadams revised this gist Mar 13, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion deactivate_allinone.sh
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ while read certname; do
    /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["$1"]
    /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
  2. jpadams revised this gist Mar 13, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion deactivate_allinone.sh
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@
    # ignores mcollective deactivation
    # read certnames from STDIN (one per line) and deactivate
    while read certname; do
    /bin/su - peadmin -c "/opt/puppet/bin/mco service stop pe-puppet -I $certname"
    /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
  3. jpadams revised this gist Mar 13, 2015. 1 changed file with 14 additions and 6 deletions.
    20 changes: 14 additions & 6 deletions deactivate_allinone.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,17 @@
    #! /bin/bash

    /opt/puppet/bin/puppet license 2>&1 | head - -n2
    /opt/puppet/bin/puppet node deactivate $1
    /opt/puppet/bin/puppet agent -t
    /opt/puppet/bin/puppet cert revoke $1
    # 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
    /bin/su - peadmin -c "/opt/puppet/bin/mco service stop pe-puppet -I $certname"
    /opt/puppet/bin/puppet license 2>&1 | head - -n2
    /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["$1"]
    /opt/puppet/bin/puppet cert clean $certname
    done
    /sbin/service pe-memcached restart
    /sbin/service pe-puppetserver restart
    /opt/puppet/bin/rake -f /opt/puppet/share/puppet-dashboard/Rakefile RAILS_ENV=production node:del['$1']
    /opt/puppet/bin/puppet license 2>&1 | head - -n2
    /opt/puppet/bin/puppet license 2>&1 | head - -n2
  4. jpadams created this gist Mar 13, 2015.
    9 changes: 9 additions & 0 deletions deactivate_allinone.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@

    /opt/puppet/bin/puppet license 2>&1 | head - -n2
    /opt/puppet/bin/puppet node deactivate $1
    /opt/puppet/bin/puppet agent -t
    /opt/puppet/bin/puppet cert revoke $1
    /sbin/service pe-memcached restart
    /sbin/service pe-puppetserver restart
    /opt/puppet/bin/rake -f /opt/puppet/share/puppet-dashboard/Rakefile RAILS_ENV=production node:del['$1']
    /opt/puppet/bin/puppet license 2>&1 | head - -n2