elasticsearch/cookbook-elasticsearch — pull request #245 by ti-mo (2014-10-10 08:07:17+00:00)
Title: Moved download_url compilation to the default recipe to allow overriding

Overriding certain attributes from wrapper cookbook attributes didn't work. I know this cookbook implements a customization strategy, but it was also ineffective in this case, let me explain why.

As you can see in the patch below, compilation of elasticsearch.filename and elasticsearch.download_url happens during interpretation of the attributes of this cookbook, which _always_ happens before interpretation of the caller's attributes. This is not mentioned in the official Chef docs, but this article explains it quite clearly: [Chef Blog](https://www.getchef.com/blog/2013/12/03/doing-wrapper-cookbooks-right/)

Specifying default.version, normal.version or override.version in a wrapper cookbook always led to the following values (with 1.3.4 for example):
* :version - 1.3.4
* :download_url - https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.12.tar.gz
* :filename - elasticsearch-0.90.12.tar.gz

This would lead to Ark downloading 0.90.12, saving it as elasticsearch-1.3.4.tar.gz and installing it under /usr/local/elasticsearch-1.3.4. Time was wasted finding out why ES wouldn't upgrade. :) This patch fixes this behaviour.