Skip to content

Instantly share code, notes, and snippets.

View jpadams's full-sized avatar

Jeremy Adams jpadams

View GitHub Profile
{
"title": "master",
"services": {
"filter": {
"list": [],
"time": {
"from": "now-5m",
"to": "now"
}
}
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Takes exactly 1 arg: the resolvable name of the graphite server. Exiting..."
exit 1
fi
ping -c 1 $1
if [ "$?" -ne 0 ]; then
@jpadams
jpadams / pub
Created December 4, 2014 18:09
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCpatn9tN9igrSTQ5SfOgaRULxh6gOW+Ck9g0nqL8IaWxvOZ2jCCfot5914JFY0MOGt+YGUJwF1ILlwNVE8+7X3VZUxv5K5h8bDTflbNmzh1vdfvkinEmYILP4ns1zCNWutwiWsMo93A25AnsHT8+SFkKYF/ZS3g/7J9TdYlVqFeyBNoyy/viw3EfN3fNk7g6cCGOqbNxj5OvMu8SqBOLjV8iMILSzaQ8BSXdd3Gd3ntc6je3rcpL/KihTb5X1b+3yyB22ZtlhgX0DYTfN6Xpdy/EzG1tt6vpiBFE4jXGRgJ/C56yi0mj6lZZuvGTs2y9eU6rtaUaWoAlBbPHEBr08P [email protected]
class profile::ntp ($servers_array) {
class { 'ntp':
servers => $servers_array,
}
}
class profile::apache {
---
profile::ntp::servers_array:
- pool.ntp.org
- time.apple.com
if $osfamily == 'RedHat' {
include profile::ntp
if $physicalprocessorcount > 2 {
include profile::apache
}
}
code: 81568f7c2dcbfaa72edeb0713e60e95c17e28247
data: c6c44073e170e44b6e10ec7bfa3533e97a839a83
class: 7a5e10d9750f452431fba8813bedb2818d23dc30
#!/bin/bash
declare -x PE_CERT=$(/opt/puppet/bin/puppet agent --configprint hostcert)
declare -x PE_KEY=$(/opt/puppet/bin/puppet agent --configprint hostprivkey)
declare -x PE_CA=$(/opt/puppet/bin/puppet agent --configprint localcacert)
declare -x NC_CURL_OPT="-s --cacert $PE_CA --cert $PE_CERT --key $PE_KEY --insecure"
curl $NC_CURL_OPT https://localhost:4433/classifier-api/v1/groups | python -m json.tool
curl -k --cert /etc/puppetlabs/puppet/ssl/certs/pe-internal-dashboard.pem --key /etc/puppetlabs/puppet/ssl/private_keys/pe-internal-dashboard.pem -H "Content-Type: text/pson" https://localhost:8140/production/resource_types/class | python -mjson.tool
@jpadams
jpadams / gist:2533843a32f011ee115d
Last active August 29, 2015 14:13
fun with PuppetDB and exported resources
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
curl -X GET http://localhost:8080/v3/resources?query=`urlencode '["=", "type", "File"]'`
# edit /etc/puppetlabs/puppet/environments/production/manifests/site.pp and add to node definition
@@file { '/tmp/foo':
ensure => file,
content => "Hello, I'm an exported resource!\n",
}
curl -X GET http://localhost:8080/v3/resources?query=`urlencode '["=", "type", "File"]'`