Method: ChefApply::Action::InstallChef#train_to_mixlib

Defined in:
lib/chef_apply/action/install_chef.rb

#train_to_mixlib(platform) ⇒ Object



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/chef_apply/action/install_chef.rb', line 77

def train_to_mixlib(platform)
  opts = {
    platform_version: platform.release,
    platform: platform.name,
    architecture: platform.arch,
    product_name: "chef",
    product_version: :latest,
    channel: :stable,
    platform_version_compatibility_mode: true,
  }
  case platform.name
  when /mac_os_x/
    if platform.release.to_i >= 17
      opts[:platform_version] = "10.13"
    else
      raise NotImplementedError
    end
  when /windows/
    opts[:platform] = "windows"
  when "redhat", "centos"
    opts[:platform] = "el"
  when "suse"
    opts[:platform] = "sles"
  when "solaris"
    opts[:platform] = "solaris2"
  when "aix"
    opts[:platform] = "aix"
  when "amazon"
    opts[:platform] = "el"
    if platform.release.to_i > 2010 # legacy Amazon version 1
      opts[:platform_version] = "6"
    else
      opts[:platform_version] = "7"
    end
  end
  opts
end