This file contains 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
diff --git a/lib/puppet/node/environment.rb b/lib/puppet/node/environment.rb | |
index fc36c35..be04a90 100644 | |
--- a/lib/puppet/node/environment.rb | |
+++ b/lib/puppet/node/environment.rb | |
@@ -57,6 +57,7 @@ class Puppet::Node::Environment | |
def self.clear | |
@seen.clear | |
+ self.current = nil | |
end |
This file contains 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
$topscope_array = ['a'] | |
$topscope_string = 'a' | |
node default { | |
$array = ['a'] | |
$string = 'a' | |
include foo | |
notify { "node array is $array (should be a)": } | |
notify { "node string is $string (should be a)": } | |
} |
This file contains 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
{ | |
"command": "deactivate node", | |
"payload": "\"the_node_name\"", | |
"version": 1 | |
} |
This file contains 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
class print_result($result,$input){ | |
$answer = $result ? { | |
s1 => even, | |
s2 => odd, | |
} | |
notify { "The input $input is $answer": } | |
} | |
define dfa($state,$original_input,$input,$rules,$callback) { | |
$first = inline_template("<%= input[0] %>") |
This file contains 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
curl -H 'Accept: application/json' http://<puppetdb>:8080/v2/metrics/mbean/com.puppetlabs.puppetdb.command%3Atype%3Dglobal%2Cname%3Dprocessing-time | |
/v2/metrics/mbean/com.puppetlabs.puppetdb.scf.storage%3Atype%3Ddefault%2Cname%3Dgc-catalogs-time | |
/v2/metrics/mbean/com.puppetlabs.puppetdb.scf.storage%3Atype%3Ddefault%2Cname%3Dgc-params-time | |
/v2/metrics/mbean/com.puppetlabs.puppetdb.scf.storage%3Atype%3Ddefault%2Cname%3Dreplace-catalog-time |
This file contains 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
["and", | |
["=", "type", "Package"], | |
["?:", | |
["in", "certname", | |
["extract", "certname", | |
["select-facts", | |
["and", ["=", "name", "kernelrelease"], ["=", "value", "3.2.0-3-amd64"]]]]] | |
["=", "title", "linux-headers-3.2.0-3-amd64"], | |
["=", "title", "linux-headers-3.2.0-2-amd64"]]] |
This file contains 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
SELECT nspname || '.' || relname AS "relation", | |
pg_size_pretty(pg_relation_size(C.oid)) AS "size" | |
FROM pg_class C | |
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) | |
WHERE nspname NOT IN ('pg_catalog', 'information_schema') | |
ORDER BY pg_relation_size(C.oid) DESC | |
LIMIT 20; |
This file contains 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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'json' | |
raise "Specify at least one epic" if ARGV.empty? | |
def make_request(client, url) | |
request = Net::HTTP::Get.new(url) | |
request.basic_auth ENV['JIRA_USERNAME'], ENV['JIRA_PASSWORD'] |
This file contains 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
WITH inactive_nodes | |
AS (SELECT certname | |
FROM certnames | |
WHERE ( deactivated IS NOT NULL | |
OR expired IS NOT NULL )) | |
SELECT reports.certname AS certname, | |
Encode(reports.hash :: bytea, 'hex') AS hash, | |
reports.end_time AS end_time, | |
reports.noop AS noop, | |
report_statuses.status AS status, |
This file contains 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
FROM alpine:latest | |
RUN apk --update add ruby ruby-json ruby-io-console openssh gcc ruby-dev make musl-dev libffi-dev curl tar | |
RUN gem install bolt --no-ri --no-rdoc | |
WORKDIR /var/lib/bolt | |
RUN mkdir package service | |
RUN curl -s https://forge.puppet.com/v3/files/puppetlabs-package-0.1.5.tar.gz | tar zxf - --strip-components=1 -C package --wildcards '*/tasks' | |
RUN curl -s https://forge.puppet.com/v3/files/puppetlabs-service-0.1.3.tar.gz | tar zxf - --strip-components=1 -C service --wildcards '*/tasks' |