Module: Beaker::DSL::Wrappers

Included in:
BeakerPuppet
Defined in:
lib/beaker-puppet/wrappers.rb

Instance Method Summary collapse

Instance Method Details

#cfacter(*args) ⇒ Object

This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.



19
20
21
22
23
24
# File 'lib/beaker-puppet/wrappers.rb', line 19

def cfacter(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  options['ENV'] ||= {}
  options[:cmdexe] = true
  Command.new('cfacter', args, options)
end

#facter(*args) ⇒ Object

This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.



8
9
10
11
12
13
# File 'lib/beaker-puppet/wrappers.rb', line 8

def facter(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  options['ENV'] ||= {}
  options[:cmdexe] = true
  Command.new('facter', args, options)
end

#hiera(*args) ⇒ Object

This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.



30
31
32
33
34
35
# File 'lib/beaker-puppet/wrappers.rb', line 30

def hiera(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  options['ENV'] ||= {}
  options[:cmdexe] = true
  Command.new('hiera', args, options)
end

#puppet(*args) ⇒ Object

This is hairy and because of legacy code it will take a bit more work to disentangle all of the things that are being passed into this catchall param.



41
42
43
44
45
46
47
48
49
# File 'lib/beaker-puppet/wrappers.rb', line 41

def puppet(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  options['ENV'] ||= {}
  options[:cmdexe] = true
  # we assume that an invocation with `puppet()` will have it's first argument
  # a face or sub command
  cmd = "puppet #{args.shift}"
  Command.new(cmd, args, options)
end