Class: ImageBuilder::Builders::Null

Inherits:
Base
  • Object
show all
Defined in:
lib/image_builder/builders/null.rb

Overview

Generic class doc comment

Constant Summary

Constants included from ImageBuilder

VERSION

Instance Attribute Summary collapse

Attributes inherited from Base

#name

Instance Method Summary collapse

Constructor Details

#initializeNull

Returns a new instance of Null.



16
17
18
19
20
21
22
# File 'lib/image_builder/builders/null.rb', line 16

def initialize
  @type = 'null'
  @host = '127.0.0.1'
  @port = 22
  @ssh_username = Etc.getlogin
  @ssh_private_key_file = ::File.join(::Dir.home, '.ssh', 'id_rsa')
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



8
9
10
# File 'lib/image_builder/builders/null.rb', line 8

def host
  @host
end

#portObject

Returns the value of attribute port.



12
13
14
# File 'lib/image_builder/builders/null.rb', line 12

def port
  @port
end

#ssh_passwordObject

Returns the value of attribute ssh_password.



9
10
11
# File 'lib/image_builder/builders/null.rb', line 9

def ssh_password
  @ssh_password
end

#ssh_private_key_fileObject

Returns the value of attribute ssh_private_key_file.



11
12
13
# File 'lib/image_builder/builders/null.rb', line 11

def ssh_private_key_file
  @ssh_private_key_file
end

#ssh_usernameObject

Returns the value of attribute ssh_username.



10
11
12
# File 'lib/image_builder/builders/null.rb', line 10

def ssh_username
  @ssh_username
end

#typeObject (readonly)

Returns the value of attribute type.



14
15
16
# File 'lib/image_builder/builders/null.rb', line 14

def type
  @type
end

Instance Method Details

#packer_hashObject



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/image_builder/builders/null.rb', line 24

def packer_hash
  hash = {}

  attr_to_hash(hash, :type, true)
  attr_to_hash(hash, :name, true)
  attr_to_hash(hash, :host, true)
  attr_to_hash(hash, :ssh_username, true)
  attr_to_hash(hash, :ssh_password)
  attr_to_hash(hash, :ssh_private_key_file)
  attr_to_hash(hash, :port)

  hash
end