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
| If you have ever done *anything* with Puppet templates, you know how ugly it is to debug. | |
| This Gist will help improve debugging and reduce guesswork. The main problem I always run into when debugging | |
| ERB templates is grokking variable access. | |
| I have included two code snippets: | |
| - erb-dump.pp # Puppet manifest | |
| - erb-dump.yaml.erb # ERB template to dump the entire namespace available to the template to /tmp/erb-dump.yaml | |
| - erb-dump.rb # loads the yaml dump into a usable ruby hash |
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 'net/http' | |
| require 'json' | |
| apiKey ='APIKEYHERE' | |
| params = { :apikey => apiKey } | |
| instances = {} | |
| counter = 0 |
NewerOlder