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 | |
# GIST_URL: https://gist.github.com/natemccurdy/65676368168708810c29 | |
# Get the list of classes that the Puppetserver knows about. | |
# https://docs.puppetlabs.com/puppet/latest/reference/http_api/http_environments.html | |
CERT="$(puppet agent --configprint hostcert)" | |
CACERT="$(puppet agent --configprint localcacert)" | |
PRVKEY="$(puppet agent --configprint hostprivkey)" | |
OPTIONS="--cert ${CERT} --cacert ${CACERT} --key ${PRVKEY}" | |
MASTER="$(puppet agent --configprint server)" |
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 | |
# GIST_URL: https://gist.github.com/natemccurdy/13e3b2d8477dbd6bd01d | |
# Run this on a puppetserver to delete its JRuby pools to clear their cache. | |
# A response of "HTTP/1.1 204 No Content" means it worked. | |
# | |
# https://docs.puppetlabs.com/puppetserver/latest/admin-api/v1/jruby-pool.html | |
CONFDIR="$(puppet master --configprint confdir)" | |
CERT="$(puppet master --confdir "${CONFDIR}" --configprint hostcert)" |
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 | |
# GIST_URL: https://gist.github.com/natemccurdy/fb01fac7eba615fa8056 | |
# Trigger the update-classes endpoint of the Puppet Node Classifier. | |
# This will update the list of classes available to the NC. | |
#https://docs.puppetlabs.com/pe/latest/nc_update_classes.html#post-v1update-classes | |
CONFDIR="$(puppet master --configprint confdir)" | |
CERT="$(puppet master --confdir "${CONFDIR}" --configprint hostcert)" | |
CACERT="$(puppet master --confdir "${CONFDIR}" --configprint localcacert)" |
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 | |
# GIST_URL: https://gist.github.com/b68497e1769c16e8fab0 | |
# Get the timestamp of the last class update in the Node Classifier. | |
# This can be run from any Puppet Master or the Puppet Console. | |
# https://docs.puppetlabs.com/pe/latest/nc_last_class_update.html | |
CONFDIR="$(puppet master --configprint confdir)" | |
CERT="$(puppet master --confdir "${CONFDIR}" --configprint hostcert)" | |
CACERT="$(puppet master --confdir "${CONFDIR}" --configprint localcacert)" |
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 | |
# GIST_URL: https://gist.github.com/natemccurdy/df8a2ca00f3783e7931e | |
# This script searches the puppetserver API for all known classes that match ^pe_.* | |
# Adjust the search pattern to tailor this script to your particular search pattern. | |
# Set variables for the curl. | |
CERT="/etc/puppetlabs/puppet/ssl/certs/pe-internal-classifier.pem" | |
KEY="/etc/puppetlabs/puppet/ssl/private_keys/pe-internal-classifier.pem" | |
CACERT="/etc/puppetlabs/puppet/ssl/certs/ca.pem" |
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 | |
# GIST_URL: https://gist.github.com/natemccurdy/797fa9128b7eef1f07be | |
# This script can be run to manually trigger Code Manager to deploy code from your control-repo. This sort of | |
# thing is neccesary when, for example: | |
# - You've turned on Code Manager but have not yet made an RBAC token. | |
# - You want to pull down the latest version of a Puppetfile module without pushing to your GMS. | |
# - Something has broken the post-receive hook on your GMS that would've triggered Code Manager. | |
# - Syntax errors in your Puppetfile prevent you from retrieving those fixes to that Puppetfile. | |
# - Puppetserver has crashed due to file-sync issues between code and code-staging. | |
# - Code Manager can't deploy your code for various reasons that are hard to track down. |
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
# This example shows how to automatically populate the SSH known_hosts file | |
# on a node so that SSH'ing to the node won't ask you to verify it's fingerprint. | |
# This requires a version of Facter that uses structure facts. | |
# Node 'foo' exports its public HOST KEY. | |
node 'foo' { | |
@@sshkey { $::clientcert: | |
ensure => present, | |
host_aliases => [$::ipaddress], |
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
# This will disable the windows firewall | |
# | |
# Requires: puppetlabs/registry | |
# | |
class profile::windows::disable_firewall { | |
registry::value { 'Disable DomainProfile firewall': | |
key => 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile', | |
value => 'EnableFirewall', | |
data => '0', |
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
inventory do | |
format "%25s: %15s [ %s / %s ]" | |
fields { [ | |
identity, | |
facts["ipaddress"], | |
facts["memoryfree"], | |
facts["memorysize"] | |
] } | |
end |
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
<html> | |
<head> | |
<style> | |
.blink { | |
animation: blink 1s steps(5, start) infinite; | |
-webkit-animation: blink 1s steps(5, start) infinite; | |
} | |
@keyframes blink { | |
to { | |
visibility: hidden; |