Module: Beaker::DSL::Helpers::Facter
- Defined in:
- lib/beaker-facter/helpers.rb,
lib/beaker-facter.rb,
lib/beaker-facter/version.rb
Overview
Methods that help you interact with your facter installation, facter must be installed for these methods to execute correctly
Defined Under Namespace
Modules: Version
Instance Method Summary collapse
-
#fact(name, opts = {}) ⇒ Object
Get a facter fact from the default host.
-
#fact_on(host, name, opts = {}) ⇒ Object
Get a facter fact from a provided host.
Instance Method Details
#fact(name, opts = {}) ⇒ Object
Get a facter fact from the default host
82 83 84 |
# File 'lib/beaker-facter/helpers.rb', line 82 def fact(name, opts = {}) fact_on(default, name, opts) end |
#fact_on(host, name, opts = {}) ⇒ Object
Get a facter fact from a provided host
71 72 73 74 75 76 77 78 |
# File 'lib/beaker-facter/helpers.rb', line 71 def fact_on(host, name, opts = {}) result = on host, facter(name, opts) if result.kind_of?(Array) result.map { |res| res.stdout.chomp } else result.stdout.chomp end end |