Skip to content

Instantly share code, notes, and snippets.

@smbambling
Last active November 5, 2015 12:36
Show Gist options
  • Save smbambling/59e90704f68b2f515a26 to your computer and use it in GitHub Desktop.
Save smbambling/59e90704f68b2f515a26 to your computer and use it in GitHub Desktop.
Snippet used with puppetserver irb to get info
require 'irb/completion'
require 'puppet'
Puppet.settings.preferred_run_mode = :agent # or whatever section you need
Puppet.settings.initialize_global_settings(["--config=/the/config/file"])
Puppet.settings.initialize_app_defaults(
Puppet::Settings.app_defaults_for_run_mode(Puppet.run_mode)
)
Puppet.push_context(Puppet.base_context(Puppet.settings))
p Puppet.lookup(:environments).list.map {|env| env.to_s }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment