Skip to content

Instantly share code, notes, and snippets.

@yureative
Created November 26, 2014 02:44
Show Gist options
  • Save yureative/ccf649f1ff175fcf1995 to your computer and use it in GitHub Desktop.
Save yureative/ccf649f1ff175fcf1995 to your computer and use it in GitHub Desktop.
Distribute Custom Ohai plugin and use it immediately with lazy block.
ohai 'reload_ec2_tags' do
plugin 'ec2/tags'
action :nothing
end
cookbook_file "#{node[:ohai][:plugin_path]}/ec2_tags.rb" do
notifies :reload, 'ohai[reload_ec2_tags]', :immediately
end
log 'Ohai plugin ec2/tags' do
message lazy { "#{node[:ec2][:tags]}" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment