Skip to content

Instantly share code, notes, and snippets.

@MrPink
Created March 27, 2014 11:41
Show Gist options
  • Save MrPink/9805684 to your computer and use it in GitHub Desktop.
Save MrPink/9805684 to your computer and use it in GitHub Desktop.
class Chef
class Recipe
def sensu_instance_identifier
sensu_metrics_environment_name = node[:environment][:name].gsub(/^tape_/, "").gsub(/_production$/, "_p").gsub(/_staging$/, "_s")
sensu_metrics_node_name = "#{node[:instance_role]}_#{node[:name]}".gsub(/_$/, "")
"#{sensu_metrics_environment_name}.#{sensu_metrics_node_name}".gsub(/-$/, "")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment