Class: MCollective::Util::Playbook::Tasks::Base

Inherits:
Object
  • Object
show all
Includes:
MCollective::Util::Playbook::TemplateUtil
Defined in:
lib/mcollective/util/playbook/tasks/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MCollective::Util::Playbook::TemplateUtil

#__template_process_string, #__template_resolve, #t

Constructor Details

#initialize(playbook) ⇒ Base

Returns a new instance of Base.



11
12
13
14
15
16
# File 'lib/mcollective/util/playbook/tasks/base.rb', line 11

def initialize(playbook)
  @playbook = playbook
  @fail_ok = false

  startup_hook
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/mcollective/util/playbook/tasks/base.rb', line 6

def description
  @description
end

#fail_ok=(value) ⇒ Object (writeonly)

Sets the attribute fail_ok

Parameters:

  • value

    the value to set the attribute fail_ok to.



7
8
9
# File 'lib/mcollective/util/playbook/tasks/base.rb', line 7

def fail_ok=(value)
  @fail_ok = value
end

Instance Method Details

#from_hash(properties) ⇒ Object

Raises:

  • (StandardError)


38
39
40
# File 'lib/mcollective/util/playbook/tasks/base.rb', line 38

def from_hash(properties)
  raise(StandardError, "from_hash not implemented", caller)
end

#runObject

Raises:

  • (StandardError)


30
31
32
# File 'lib/mcollective/util/playbook/tasks/base.rb', line 30

def run
  raise(StandardError, "run not implemented", caller)
end

#run_task(result) ⇒ Object



24
25
26
27
28
# File 'lib/mcollective/util/playbook/tasks/base.rb', line 24

def run_task(result)
  validate_configuration!

  result.timed_run(self)
end

#startup_hookObject



18
# File 'lib/mcollective/util/playbook/tasks/base.rb', line 18

def startup_hook; end

#to_sObject



20
21
22
# File 'lib/mcollective/util/playbook/tasks/base.rb', line 20

def to_s
  "#<%s description: %s>" % [self.class, t(description)]
end

#validate_configuration!Object

Raises:

  • (StandardError)


34
35
36
# File 'lib/mcollective/util/playbook/tasks/base.rb', line 34

def validate_configuration!
  raise(StandardError, "validate_configuration! not implemented", caller)
end