Module: Beaker::DSL::Helpers::FacterHelpers
- Defined in:
- lib/beaker/dsl/helpers/facter_helpers.rb
Overview
Methods that help you interact with your facter installation, facter must be installed for these methods to execute correctly
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
50 51 52 |
# File 'lib/beaker/dsl/helpers/facter_helpers.rb', line 50 def fact(name, opts = {}) fact_on(default, name, opts) end |
#fact_on(host, name, opts = {}) ⇒ Object
Get a facter fact from a provided host
39 40 41 42 43 44 45 46 |
# File 'lib/beaker/dsl/helpers/facter_helpers.rb', line 39 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 |