Skip to content

Instantly share code, notes, and snippets.

file "/etc/chef/validation.pem" do
action :delete
backup false
only_if { File.size?("/etc/chef/client.pem") > 0 }
end
# Chef Client Config File
require 'ohai'
require 'json'
o = Ohai::System.new
o.all_plugins
chef_config = JSON.parse(o[:ec2][:userdata])
if chef_config.kind_of?(Array)
chef_config = chef_config[o[:ec2][:ami_launch_index]]