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
{:facts_format=>"pson", | |
:facts=> | |
"%7B%22name%22%3A%22kb.local%22%2C%22values%22%3A%7B%22architecture%22%3A%22x86_64%22%2C%22kernel%22%3A%22Darwin%22%2C%22domain%22%3A%22local%22%2C%22macaddress%22%3A%2240%3A6c%3A8f%3A1c%3Af2%3Aa1%22%2C%22osfamily%22%3A%22Darwin%22%2C%22operatingsystem%22%3A%22Darwin%22%2C%22facterversion%22%3A%221.7.5%22%2C%22fqdn%22%3A%22kb.local%22%2C%22hardwareisa%22%3A%22i386%22%2C%22hardwaremodel%22%3A%22x86_64%22%2C%22hostname%22%3A%22kb%22%2C%22id%22%3A%22ken%22%2C%22interfaces%22%3A%22lo0%2Cgif0%2Cstf0%2Cen0%2Cen3%2Cen4%2Cbridge0%2Cp2p0%2Cutun0%2Cfw0%2Cen2%22%2C%22ipaddress_lo0%22%3A%22127.0.0.1%22%2C%22netmask_lo0%22%3A%22255.0.0.0%22%2C%22mtu_lo0%22%3A%2216384%22%2C%22mtu_gif0%22%3A%221280%22%2C%22mtu_stf0%22%3A%221280%22%2C%22ipaddress_en0%22%3A%22192.168.1.78%22%2C%22macaddress_en0%22%3A%2214%3A10%3A9f%3Ae3%3A1e%3A51%22%2C%22netmask_en0%22%3A%22255.255.255.0%22%2C%22mtu_en0%22%3A%221500%22%2C%22macaddress_en3%22%3A%2232%3A00%3A16%3A5e%3Ab0%3A80%22%2C%22mtu_en3%22%3A%221500%22%2 |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
require 'facter' | |
uri = URI.parse("http://localhost:8080/v3/commands") | |
http = Net::HTTP.new(uri.host, uri.port) |
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
Thu Feb 27 02:46:27 +0000 2014 Puppet (debug): node supports formats: pson msgpack yaml b64_zlib_yaml raw | |
Thu Feb 27 02:46:27 +0000 2014 Puppet (debug): PROFILE [70180287682240] 1.1 Rendered result in Puppet::Network::Format[pson]: took 0.0008 seconds | |
Thu Feb 27 02:46:27 +0000 2014 Puppet (debug): PROFILE [70180287682240] 1.2 Sent response: took 0.0000 seconds | |
Thu Feb 27 02:46:27 +0000 2014 Puppet (debug): PROFILE [70180287682240] 1 Processed request GET /production/node/puppetdb1.vm: took 0.0132 seconds | |
Thu Feb 27 02:46:27 +0000 2014 Puppet (debug): Handling request: GET /production/file_metadatas/plugins?links=manage&recurse=true&ignore=.svn&ignore=CVS&ignore=.git&checksum_type=md5 | |
Thu Feb 27 02:46:27 +0000 2014 Puppet (debug): No plugins found in subpath '/etc/puppet/modules/my_pg/lib' (file / directory does not exist) | |
Thu Feb 27 02:46:27 +0000 2014 Puppet (debug): No plugins found in subpath '/etc/puppet/modules/nagios/lib' (file / directory does not exist) | |
Thu Feb 27 02:46:27 +0000 2014 Puppet (debug): N |
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
# a config.ru, for use with every rack-compatible webserver. | |
# SSL needs to be handled outside this, though. | |
# if puppet is not in your RUBYLIB: | |
# $LOAD_PATH.unshift('/opt/puppet/lib') | |
$0 = "master" | |
# if you want debugging: | |
# ARGV << "--debug" |
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
# curl -X GET http://localhost:8080/v3/facts/sshrsakey --data-urlencode 'query=["=", "value", "AAAAB3NzaC1yc2EAAAADAQABAAABAQDEgXbgntl/IexZeGTE+fXGlxmJhOwCei0rgfojZW603JkRxG6LzJ92PetnOkKU0QdwI1gkle2/WOCMXWlHSFXk+ZFomN9NmK3BvhckiIF9uVdJ6CPZCH/+CZp/HcwKWocnWfOhZ1qVL5S4qFpHMVjmDEOfTUIhTFJKEK1nU6Ugsx2Xbxf3SLk/XEF+Bo2wn6L0FLM8aF31+HzvIldgK+STRr0qdIhGN4RIPKavdG5CkUh+NSNJePWbFTF682a/qK0loiWzBigU5o3Pw4KVh7ODhpmT7iBG7r9g2XRxzkZX6Kxw/O8NdanqJXkTVFOqxPXxW4ylygCGj40AtHqUz"]' | |
[ { | |
"certname" : "puppetdb1.vm", | |
"name" : "sshrsakey", | |
"value" : "AAAAB3NzaC1yc2EAAAADAQABAAABAQDEgXbgntl/IexZeGTE+fXGlxmJhOwCei0JjbrgfojZW603JkRxG6LzJ92PetnOkKU0QdwI1gkle2/WOCMXWlHSFXk+ZFomN9NmK3BvhckiIF9uVdJ6CPZCH/+CZp/HcwKWocnWfOhZ1qVL5S4qFpHMVjmDEOfTUIhTFJKEK1nU6Ugsx2Xbxf3SLk/XEF+Bo2wn6L0FLM8aF31+HzvIldgK+STRr0qdIhGN4RIPKavdG5CkUh+NSNJePWbFTF682a/qK0loiWzBigU5o3Pw4KVh7ODhpmT7iBG7r9g2XRxzkZX6Kxw/O8NdanqJXkTVFOqxPXxW4ylygCGj40AtHqUz" | |
} ] |
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
# curl -vvv -G 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["in", "name", ["extract", "certname", ["select-resources", ["=", "tag", "asdf"]]]]' | |
* About to connect() to localhost port 8080 (#0) | |
* Trying ::1... | |
* connected | |
* Connected to localhost (::1) port 8080 (#0) | |
> GET /v3/nodes?query=%5B%22in%22%2C%20%22name%22%2C%20%5B%22extract%22%2C%20%22certname%22%2C%20%5B%22select-resources%22%2C%20%5B%22%3D%22%2C%20%22tag%22%2C%20%22asdf%22%5D%5D%5D%5D HTTP/1.1 | |
> User-Agent: curl/7.26.0 | |
> Host: localhost:8080 | |
> Accept: */* | |
> |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
require 'facter' | |
uri = URI.parse("http://localhost:8080/v3/commands/") | |
http = Net::HTTP.new(uri.host, uri.port) |
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
root@puppetdb1:/usr/lib/ruby/vendor_ruby/puppet# curl 'http://localhost:8080/v3/nodes/pg1.vm' | |
{ | |
"name" : "pg1.vm", | |
"deactivated" : null, | |
"catalog_timestamp" : "2014-02-13T00:47:23.560Z", | |
"facts_timestamp" : "2014-02-13T00:47:18.000Z", | |
"report_timestamp" : "2014-02-12T22:17:24.469Z" | |
} | |
root@puppetdb1:/usr/lib/ruby/vendor_ruby/puppet# curl 'http://localhost:8080/v3/nodes/pg1.vm/facts' | |
[ { |
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
# cat nodes.pp | |
node "puppetdb1.vm" { | |
@@sshkey{"${::fqdn}_${::ipaddress}": | |
host_aliases => [$::fqdn, $::hostname, $::ipaddress], | |
type => "rsa", | |
key => $::sshrsakey, | |
tag => $environment | |
} | |
} |
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
Vagrant.configure("2") do |config| | |
config.vm.define "centos-59-x64-vbox4210-nocm" do |v| | |
v.vm.box = "centos-59-x64-vbox4210-nocm" | |
v.vm.hostname = "centos-59-x64-vbox4210-nocm.vm" | |
v.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box" | |
end | |
config.vm.define "centos-510-x64-virtualbox-nocm" do |v| | |
v.vm.box = "centos-510-x64-virtualbox-nocm" | |
v.vm.hostname = "centos-510-x64-virtualbox-nocm" |