Class: RSpecSystem::Helpers::PuppetAgent

Inherits:
RSpecSystem::Helper
  • Object
show all
Defined in:
lib/rspec-system-puppet/helpers/puppet_agent.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts, clr, &block) ⇒ PuppetAgent

Returns a new instance of PuppetAgent.



8
9
10
11
12
13
14
15
16
# File 'lib/rspec-system-puppet/helpers/puppet_agent.rb', line 8

def initialize(opts, clr, &block)
  # Defaults etc.
  opts = {
    :debug => false,
    :trace => true,
  }.merge(opts)

  super(opts, clr, &block)
end

Instance Method Details

#executeObject



18
19
20
21
22
23
24
25
26
# File 'lib/rspec-system-puppet/helpers/puppet_agent.rb', line 18

def execute
  node = opts[:node]

  cmd = "puppet agent -t --detailed-exitcodes"
  cmd += " --debug" if opts[:debug]
  cmd += " --trace" if opts[:trace]

  shell(:c => cmd, :n => node).to_hash
end