Skip to content

Instantly share code, notes, and snippets.

Ken Barber kbarber

Block or report user

Report or block kbarber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:991b8d738495c0fed05bf806d1422b73
set base-url
kernel ${base-url}/coreos\_production\_pxe.vmlinuz initrd=coreos\_production\_pxe\_image.cpio.gz coreos.first\_boot=1 coreos.config.url=
initrd ${base-url}/coreos\_production\_pxe\_image.cpio.gz
View facts-master
Branch pdb-809 (master basically) with 1 node of facts:
Expanded display is used automatically.
Timing is on.
Null display is "<<NULL>>".
Hash Join (cost=689.44..711.69 rows=72 width=730) (actual time=3.193..3.810 rows=102 loops=1)
Hash Cond: (fs.certname =
View gist:17b1748831b234e7b835
lein test :only com.puppetlabs.puppetdb.test.http.facts/factset-queries
FAIL in (factset-queries) (facts.clj:892)
Testing version :v4 factset queries should return appropriate results
expected: (= (into {} (first responses)) {"facts" {"my_structured_fact" {"a" 1, "b" 3.14, "c" ["a" "b" "c"], "d" {"n" ""}, "e" "1", "f" nil}, "domain" "", "uptime_seconds" "4000", "test#~delimiter" "foo"}, "timestamp" (to-string current-time), "environment" "DEV", "certname" "foo1"})
actual: (not (= {"facts" {"test#~delimiter" "foo", "uptime_seconds" "4000", "domain" "", "my_structured_fact" {"b" 3.14, "a" 1, "e" "1", "d" {"n" ""}, "f" nil, "c" ["a" "b" "c"]}}, "timestamp" "2014-07-31T23:27:45.298Z", "environment" "DEV", "certname" "foo1"} {"facts" {"uptime_seconds" "4000", "domain" "", "test#~delimiter" "foo", "my_structured_fact" {"d" {"n" ""}, "f" nil, "e" "1", "a" 1, "b" 3.14, "c" ["a" "b" "c"]}}, "timestamp" "2014-07-31T23:27:45.297Z", "environment" "DEV", "certname" "foo1"}))
lein test :o
View gist:683548d370ece5dba7e0
# curl -G 'http://localhost:8080/v4/factsets' --data-urlencode 'query=["in", "certname", ["extract", "certname", ["select-facts", ["and", ["=", "name", "operatingsystem"], ["=", "value", "Darwin"]]]]]'
[ {
"facts" : {
"ipaddress_en2" : "",
"kernel" : "Darwin",
"macaddress_bridge0" : "42:6c:8f:c1:8e:00",
"kernelrelease" : "13.3.0",
"network_vmnet8" : "",
"is_pe" : false,
"sp_serial_number" : "C02K50H1DKQ5",
View gist:c6941099bea07096361e
# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: File[/tmp/foo] { require => Package[foobar1] }, because Package[foobar1] doesn't seem to be in the catalog
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
root@puppetdb1:/etc/puppet/manifests# curl 'http://localhost:8080/v4/reports'
[ {
"hash" : "24274701699ddee1b538ffb8400d0b17bf911405",
"puppet-version" : "3.6.2",
View gist:36cdac8c52767dee7c03
2014-07-10 18:14:00,049 ERROR [c.p.p.command] [d2a06fe2-64d1-40ff-ab5b-c8c38b2f5f4e] [replace catalog] Retrying after attempt 4, due to: clojure.lang.ExceptionInfo: Value does not match schema: {:producer-timestamp (not (instance? java.lang.String a-java.sql.Timestamp))} {:schema {:name java.lang.String, :version java.lang.String, :environment (maybe java.lang.String), :transaction-uuid (maybe java.lang.String), :producer-timestamp (maybe java.lang.String), :edges (either [{Any Any}] #{{Any Any}}), :resources (either [{Any Any}] {Any {Any Any}})}, :value {:resources ({:tags ["stage"], :type "Stage", :title "main", :parameters {"alias" ["main"], "name" "main"}, :exported false} {:tags ["class" "file"], :file "/Users/ken/.puppet/manifests/site.pp", :type "File", :title "/tmp", :line 1, :parameters {"ensure" "directory"}, :exported false} {:tags ["class"], :type "Class", :title "main", :parameters {"alias" ["main"], "name" "main"}, :exported false} {:tags ["class" "file"], :file "/Users/ken/.puppet/manifests/sit
View gist:640f708a478c688b40e9
# curl 'http://localhost:8080/v4/nodes?query=\["=","certname","puppetdb1.vm"\]'
[ {
"deactivated" : null,
"report-environment" : "production",
"certname" : "puppetdb1.vm",
"facts-timestamp" : "2014-07-05T18:50:19.413Z",
"facts-environment" : "production",
"catalog-timestamp" : "2014-07-05T13:32:33.554Z",
"report-timestamp" : "2014-07-05T18:50:18.633Z",
"catalog-environment" : "production"
View gist:0b3b0685f09d2a2ac20d
diff --git a/puppet/lib/puppet/indirector/catalog/puppetdb.rb b/puppet/lib/puppet/indirector/catalog/puppetdb.rb
index 6bcb50a..7202539 100644
--- a/puppet/lib/puppet/indirector/catalog/puppetdb.rb
+++ b/puppet/lib/puppet/indirector/catalog/puppetdb.rb
@@ -12,6 +12,8 @@ class Puppet::Resource::Catalog::Puppetdb < Puppet::Indirector::REST
def save(request)
+ require 'pp'
+ Puppet.warning(request.instance.pretty_inspect)
View gist:eb870d1363d7d2d666ed
inet6 sets RES_USE_INET6 in _res.options. This has the
effect of trying a AAAA query before an A query inside
the gethostbyname(3) function, and of mapping IPv4
responses in IPv6 "tunneled form" if no AAAA records
are found but an A record set exists.
View gist:62c0fa6ebbe3dc8b89f9
[ken@kb puppetdb]# PGDATA=~/Library/Application\ Support/Postgres93/var/ pg_ctl status
pg_ctl: server is running (PID: 73637)
ruby-1.9.3-p547@puppetdb (git)-[1.6.x]
[ken@kb puppetdb]# curl 'http://localhost:8080/v3/facts/facterversion'
[ {
"certname" : "anawdlxglhmtoaxywidwginvgyeeqwcslixvmerweuzsefktyk",
"name" : "facterversion",
"value" : "1.7.3"
} ]% ruby-1.9.3-p547@puppetdb (git)-[1.6.x]
You can’t perform that action at this time.