Skip to content

Instantly share code, notes, and snippets.

@btm
Forked from maplebed/gist:5086156
Last active December 14, 2015 12:28
Show Gist options
  • Save btm/5086184 to your computer and use it in GitHub Desktop.
Save btm/5086184 to your computer and use it in GitHub Desktop.
# If the host has ganglia in the run_list, install the mongo plugin
# In Chef 11 node.recipe? returns true for the run_list and expanded_runlist (node[:recipes])
# In Chef 10 node.recipe? returns true for the run_list and already loaded recipes (seen_recipes)
# -- I believe on Chef 10 node.recipe? does not evaluated the expanded run_list so you want node[:recipes] too
if node.recipe?("ganglia::default") or node[:recipes].include?("ganglia::default")
# Make sure we've already executed the ganglia recipe in this run to get the ganglia_python LWRP
include_recipe "ganglia::default"
ganglia_python "mongodb" do
action :enable
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment