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.



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

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.



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

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.



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

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.



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

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