Last active
May 26, 2016 18:33
-
-
Save shortstack/4a167a883e671c31b2c41d9b3c09652d to your computer and use it in GitHub Desktop.
Deactivate old Puppet nodes
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/sh | |
nodes=`curl --silent -G 'http://localhost:8080/v4/nodes' --data-urlencode "query=[\"<\", \"report-timestamp\", \"$(date -d '-1 day' -Isec)\"]" | jq '.[].certname'` | |
for node in $nodes; do | |
puppet cert clean $node | |
puppet node deactivate $node | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment