bbaugher / apache_zookeeper

Chef cookbook for Apache Zookeeper
MIT License
9 stars 22 forks source link

binary_url doesn't adhere to version or mirror #47

Closed optix2000 closed 7 years ago

optix2000 commented 7 years ago

Probably related to https://github.com/bbaugher/apache_zookeeper/commit/08161d4fb30a45865977779d758d3c591cf3573e

If you override version or mirror in a wrapper cookbook, the binary_url isn't changed with it.

ie zookeeper-wrapper/recipes/default.rb

include_recipe 'apache_zookeeper'

zookeeper-wrapper/attributes/default.rb

default['apache_zookeeper']['mirror'] = 'https://mirrors.ocf.berkeley.edu/apache/zookeeper/'
default['apache_zookeeper']['version'] = '3.4.10'

Results in this being rendered as the node attributes:

    apache_zookeeper: !ruby/hash-with-ivars:Chef::Node::ImmutableMash
      elements:
        install_java: true
        install_dir: "/opt/zookeeper"
        version: 3.4.10
        mirror: https://mirrors.ocf.berkeley.edu/apache/zookeeper/
        binary_url: http://archive.apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz

It looks like the render order for attributes doesn't allow binary_url to be rendered dynamically from overriding attributes while it's in attributes.rb

optix2000 commented 7 years ago

binary_url probably needs to be rendered in the recipe, with a check to see if there's an attribute override.

bbaugher commented 7 years ago

Fixed

bbaugher commented 7 years ago

Released, https://supermarket.chef.io/cookbooks/apache_zookeeper/versions/1.1.1

optix2000 commented 7 years ago

Thanks for the quick turnaround!