Class: Beaker::Puppeter::Executor

Inherits:
Object
  • Object
show all
Defined in:
lib/beaker/puppeter/executor.rb

Constant Summary collapse

PUPPETER_SCRIPT_DEFAULT_VALUE =
'default'

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ Executor

Returns a new instance of Executor.



6
7
8
9
# File 'lib/beaker/puppeter/executor.rb', line 6

def initialize(host)
  @host = host
  @puppeter_ver = nil
end

Instance Method Details

#with(answers) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/beaker/puppeter/executor.rb', line 11

def with(answers)
  root = Pathname.new '.'
  answers_dir = root.join('spec')
    .join('acceptance')
    .join('answers')
  inject_ansers_to_host(answers)
  answers_file = answers_dir.join("#{@host.options[:puppeter_answers]}.yml")
  ver = infra_version
  logger.debug "Installing Puppet via #{ver} on #{@host} with #{answers_file}"
  copied = copy_answers answers_file
  on @host, "puppeter --answers #{copied} > /tmp/puppeter-script.sh"
  on @host, 'bash /tmp/puppeter-script.sh'
end