Sunday, August 31, 2014

Updated Windows_Pagefile Cookbook #gethchef

I modified the default.rb to separate w2012/w2012r2 and w2k8r2 for both XenServer and vCloud/vSphere with the Ohai value for [kernel][cs_info][total_physical_memory]. I have broken it down for XenServer (4gb, 6gb, 8gb, 16gb) then vCloud/vSphere (4gb, 6gb, 8gb, 16gb).

The cookbook is on GitHub.

Here is the new default.rb:

def memory
  "#{node['kernel']['cs_info']['total_physical_memory']}"
end

# splitting out based on OS vsersion and then the case statement is XenServer(4,6,8,16) then vSphere/vCloud(4,6,8,16)
if node['platform_version'] >= "6.2.9200"
  case memory
  when "4286169088"
    include_recipe "pagefile::4gb"
  when "6433652736"
    include_recipe "pagefile::6gb"
  when "8581136384"
    include_recipe "pagefile::8gb"
  when "17171070976"
    include_recipe "pagefile::16gb"
  when "4294496256"
    include_recipe "pagefile::4gb"
  when "6441979904"
    include_recipe "pagefile::6gb"
  when "8589463552"
    include_recipe "pagefile::8gb"
  when "17179398144"
    include_recipe "pagefile::16gb"
  end
else
  case memory
  when "4290367488"
    include_recipe "pagefile::4gb"
  when "6437851136"
    include_recipe "pagefile::6gb"
  when "8585334784"
    include_recipe "pagefile::8gb"
  when "17175269376"
    include_recipe "pagefile::16gb"
  when "4294500352"
    include_recipe "pagefile::4gb"
  when "6441984000"
    include_recipe "pagefile::6gb"
  when "8589467648"
    include_recipe "pagefile::8gb"
  when "17179402240"
    include_recipe "pagefile::16gb"
  end
end

No comments:

Post a Comment