Class: Nucleon::Action::Node::Lookup
- Inherits:
-
Object
- Object
- Nucleon::Action::Node::Lookup
- Defined in:
- lib/nucleon/action/node/lookup.rb
Class Method Summary collapse
-
.describe ⇒ Object
—————————————————————————– Info.
Instance Method Summary collapse
-
#arguments ⇒ Object
—.
-
#configure ⇒ Object
—————————————————————————– Settings.
-
#execute ⇒ Object
—————————————————————————– Operations.
Class Method Details
.describe ⇒ Object
Info
10 11 12 |
# File 'lib/nucleon/action/node/lookup.rb', line 10 def self.describe super(:node, :lookup, 565) end |
Instance Method Details
#arguments ⇒ Object
37 38 39 |
# File 'lib/nucleon/action/node/lookup.rb', line 37 def arguments [ :properties ] end |
#configure ⇒ Object
Settings
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/nucleon/action/node/lookup.rb', line 17 def configure super do register :properties, :array, [] register :context, :str, :priority do |value| success = true = [ :priority, :array, :hash ] unless .include?(value.to_sym) warn('corl.actions.lookup.errors.context', { :value => value, :options => .join(', ') }) success = false end success end register_translator :format, :json register_bool :debug, false end end |
#execute ⇒ Object
Operations
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/nucleon/action/node/lookup.rb', line 44 def execute super do |node| ensure_node(node) do translator = CORL.translator({}, settings[:format]) if settings[:properties].empty? myself.result = node.hiera_configuration(node.facts) $stderr.puts translator.generate(result) else properties = {} settings.delete(:properties).each do |property| properties[property] = node.lookup(property, nil, settings) end $stderr.puts translator.generate(properties) myself.result = properties end end end end |