Class: Ridley::CommandContext::UnixUpdateOmnibus

Inherits:
Unix
  • Object
show all
Defined in:
lib/ridley-connectors/command_context/unix_update_omnibus.rb

Overview

Context class for generating an upgrade command for an Omnibus Chef installation on Unix based OSes

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

command, #command, template_file

Constructor Details

#initialize(options = {}) ⇒ UnixUpdateOmnibus

Returns a new instance of UnixUpdateOmnibus.



16
17
18
19
20
21
22
# File 'lib/ridley-connectors/command_context/unix_update_omnibus.rb', line 16

def initialize(options = {})
  super(options)
  options = options.reverse_merge(chef_version: "latest", prerelease: false)
  @chef_version = options[:chef_version]
  @prerelease = options[:prerelease]
  @direct_url = options[:direct_url]
end

Instance Attribute Details

#chef_versionString (readonly)

Returns:

  • (String)


8
9
10
# File 'lib/ridley-connectors/command_context/unix_update_omnibus.rb', line 8

def chef_version
  @chef_version
end

#direct_urlString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/ridley-connectors/command_context/unix_update_omnibus.rb', line 14

def direct_url
  @direct_url
end

#prereleaseBoolean (readonly)

Returns:

  • (Boolean)


11
12
13
# File 'lib/ridley-connectors/command_context/unix_update_omnibus.rb', line 11

def prerelease
  @prerelease
end

Instance Method Details

#chef_apply_commandString

Returns:

  • (String)


55
56
57
# File 'lib/ridley-connectors/command_context/unix_update_omnibus.rb', line 55

def chef_apply_command
  "chef-apply #{recipe_path}"
end

#chef_solo_commandString

Returns:

  • (String)


50
51
52
# File 'lib/ridley-connectors/command_context/unix_update_omnibus.rb', line 50

def chef_solo_command
  "chef-solo -c #{upgrade_solo_rb_path} -o upgrade_omnibus"
end

#recipe_pathString

Returns:

  • (String)


30
31
32
# File 'lib/ridley-connectors/command_context/unix_update_omnibus.rb', line 30

def recipe_path
  File.join(update_dir, "default.rb")
end

#tmp_cookbookString

Returns:

  • (String)


45
46
47
# File 'lib/ridley-connectors/command_context/unix_update_omnibus.rb', line 45

def tmp_cookbook
  File.join(tmp_cookbook_path, "upgrade_omnibus")
end

#tmp_cookbook_pathString

Returns:

  • (String)


40
41
42
# File 'lib/ridley-connectors/command_context/unix_update_omnibus.rb', line 40

def tmp_cookbook_path
  File.join(update_dir, "cookbooks")
end

#update_dirString

Returns:

  • (String)


25
26
27
# File 'lib/ridley-connectors/command_context/unix_update_omnibus.rb', line 25

def update_dir
  "/tmp"
end

#upgrade_solo_rb_pathString

Returns:

  • (String)


35
36
37
# File 'lib/ridley-connectors/command_context/unix_update_omnibus.rb', line 35

def upgrade_solo_rb_path
  File.join(update_dir, "upgrade_solo.rb")
end