Created
September 3, 2012 18:55
-
-
Save jedi4ever/3612278 to your computer and use it in GitHub Desktop.
Puppet faces experiment - from within ruby
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
require 'puppet' | |
require 'puppet/face' | |
# List available faces | |
Puppet::Face.faces | |
# >>> => [:status, :plugin, :man, :help, :resource, :catalog, :node, :file, :config, :certificate_revocation_list, :resource_type, :parser, :module, :instrumentation_data, :facts, :certificate, :key, :certificate_request, :report, :instrumentation_probe, :ca, :secret_agent, :instrumentation_listener] | |
# List possible actions | |
Puppet::Face[:module,:current].actions | |
# >>> [:build, :changes, :generate, :install, :list, :search, :uninstall, :upgrade] | |
# Invoke an installation | |
Puppet::Face[:model,:current].install('yum', { :target_dir => 'lalal', :ignore_dependencies => true}) | |
# Get the available options for a face action | |
Puppet::Face[:module,:current].get_action(:install).options | |
=> [:force, :target_dir, :ignore_dependencies, :modulepath, :version, :environment] | |
# Get more info about an option | |
Puppet::Face[:module,:current].get_action(:install).get_option(:force).description | |
=> "Force overwrite of existing module, if any.\n" | |
Puppet::Face[:module,:current].get_action(:install).get_option(:force).required? | |
=> false | |
Puppet::Face[:module,:current].get_action(:install).get_option(:modulepath).takes_argument? | |
=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment