Class: Bolt::PAL::YamlPlan::Step::Command

Inherits:
Bolt::PAL::YamlPlan::Step show all
Defined in:
lib/bolt/pal/yaml_plan/step/command.rb

Constant Summary

Constants inherited from Bolt::PAL::YamlPlan::Step

STEP_KEYS

Instance Attribute Summary

Attributes inherited from Bolt::PAL::YamlPlan::Step

#body

Class Method Summary collapse

Methods inherited from Bolt::PAL::YamlPlan::Step

allowed_keys, create, #evaluate, #initialize, parse_code_string, #transpile, validate, validate_puppet_code

Constructor Details

This class inherits a constructor from Bolt::PAL::YamlPlan::Step

Class Method Details

.option_keysObject



8
9
10
# File 'lib/bolt/pal/yaml_plan/step/command.rb', line 8

def self.option_keys
  Set['catch_errors', 'env_vars', 'run_as']
end

.required_keysObject



12
13
14
# File 'lib/bolt/pal/yaml_plan/step/command.rb', line 12

def self.required_keys
  Set['command', 'targets']
end

.validate_step_keys(body, number) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/bolt/pal/yaml_plan/step/command.rb', line 16

def self.validate_step_keys(body, number)
  super

  if body.key?('env_vars') && ![Hash, String].include?(body['env_vars'].class)
    raise StepError.new('env_vars key must be a hash or evaluable string', body['name'], number)
  end
end