Sha256: a6b41fc4057a47d61e8f4f3275deb8c66574445339e626ee84373661c3f661ff

Contents?: true

Size: 583 Bytes

Versions: 4

Compression:

Stored size: 583 Bytes

Contents

require 'rspec-system'

module RSpecSystem::Helpers
  class PuppetAgent < RSpecSystem::Helper
    name 'puppet_agent'
    properties :stdout, :stderr, :exit_code

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

      super(opts, clr, &block)
    end

    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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rspec-system-puppet-2.2.1 lib/rspec-system-puppet/helpers/puppet_agent.rb
rspec-system-puppet-2.2.0 lib/rspec-system-puppet/helpers/puppet_agent.rb
rspec-system-puppet-2.1.0 lib/rspec-system-puppet/helpers/puppet_agent.rb
rspec-system-puppet-2.0.0 lib/rspec-system-puppet/helpers/puppet_agent.rb