Last active
November 5, 2015 12:36
-
-
Save smbambling/59e90704f68b2f515a26 to your computer and use it in GitHub Desktop.
Snippet used with puppetserver irb to get info
This file contains 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
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