Class: Packer::Provisioner::Ansible

Inherits:
Packer::Provisioner show all
Defined in:
lib/packer/provisioners/ansible.rb

Constant Summary

Constants inherited from Packer::Provisioner

ANSIBLE, CHEF_CLIENT, CHEF_SOLO, FILE, POWERSHELL, PUPPET_MASTERLESS, PUPPET_SERVER, SALT, SHELL, VALID_PROVISIONER_TYPES, WINDOWS_RESTART, WINDOWS_SHELL

Instance Attribute Summary

Attributes inherited from DataObject

#data, #key_dependencies, #required

Instance Method Summary collapse

Methods inherited from Packer::Provisioner

#except, get_provisioner, #only, #override, #pause_before, types

Methods inherited from DataObject

#__add_array_of_array_of_strings, #__add_array_of_hashes, #__add_array_of_ints, #__add_array_of_strings, #__add_boolean, #__add_hash, #__add_integer, #__add_json, #__add_string, #__exclusive_key_error, #add_key_dependencies, #add_required, #deep_copy, #validate, #validate_key_dependencies, #validate_required

Constructor Details

#initializeAnsible

Returns a new instance of Ansible.



8
9
10
11
12
# File 'lib/packer/provisioners/ansible.rb', line 8

def initialize
  super
  self.data['type'] = ANSIBLE
  self.add_required(['playbook_file'])
end

Instance Method Details

#command(cmd) ⇒ Object



18
19
20
# File 'lib/packer/provisioners/ansible.rb', line 18

def command(cmd)
  self.__add_string('command', cmd)
end

#extra_arguments(args) ⇒ Object



22
23
24
# File 'lib/packer/provisioners/ansible.rb', line 22

def extra_arguments(args)
  self.__add_array_of_strings('extra_arguments', args)
end

#group_vars(vars) ⇒ Object



38
39
40
# File 'lib/packer/provisioners/ansible.rb', line 38

def group_vars(vars)
  self.__add_string('group_vars', vars)
end

#host_vars(vars) ⇒ Object



42
43
44
# File 'lib/packer/provisioners/ansible.rb', line 42

def host_vars(vars)
  self.__add_string('host_vars', vars)
end

#inventory_file(filename) ⇒ Object



26
27
28
# File 'lib/packer/provisioners/ansible.rb', line 26

def inventory_file(filename)
  self.__add_string('inventory_file', filename)
end

#playbook_dir(dirname) ⇒ Object



30
31
32
# File 'lib/packer/provisioners/ansible.rb', line 30

def playbook_dir(dirname)
  self.__add_string('playbook_dir', dirname)
end

#playbook_file(filename) ⇒ Object



14
15
16
# File 'lib/packer/provisioners/ansible.rb', line 14

def playbook_file(filename)
  self.__add_string('playbook_file', filename)
end

#playbook_paths(paths) ⇒ Object



34
35
36
# File 'lib/packer/provisioners/ansible.rb', line 34

def playbook_paths(paths)
  self.__add_array_of_strings('playbook_paths', paths)
end

#role_paths(paths) ⇒ Object



46
47
48
# File 'lib/packer/provisioners/ansible.rb', line 46

def role_paths(paths)
  self.__add_array_of_strings('role_paths', paths)
end

#staging_directory(dirname) ⇒ Object



50
51
52
# File 'lib/packer/provisioners/ansible.rb', line 50

def staging_directory(dirname)
  self._add_string('staging_directory', dirname)
end