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

Inherits:
Step
  • Object
show all
Defined in:
lib/bolt/pal/yaml_plan/step/command.rb

Class Method Summary collapse

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