Class: ForemanAnsibleCore::CommandCreator

Inherits:
Object
  • Object
show all
Defined in:
lib/foreman_ansible_core/runner/command_creator.rb

Overview

Creates the actual command to be passed to foreman_tasks_core to run

Instance Method Summary collapse

Constructor Details

#initialize(inventory_file, playbook_file, options = {}) ⇒ CommandCreator

Returns a new instance of CommandCreator.



6
7
8
9
10
11
# File 'lib/foreman_ansible_core/runner/command_creator.rb', line 6

def initialize(inventory_file, playbook_file, options = {})
  @options = options
  @playbook_file = playbook_file
  @inventory_file = inventory_file
  command
end

Instance Method Details

#commandObject



13
14
15
16
17
18
19
# File 'lib/foreman_ansible_core/runner/command_creator.rb', line 13

def command
  parts = [environment_variables]
  parts << 'ansible-playbook'
  parts.concat(command_options)
  parts << @playbook_file
  parts
end