Skip to content

Instantly share code, notes, and snippets.

@jpadams
Last active August 29, 2015 14:13
Show Gist options
  • Save jpadams/2533843a32f011ee115d to your computer and use it in GitHub Desktop.
Save jpadams/2533843a32f011ee115d to your computer and use it in GitHub Desktop.
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"]'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment