bbaugher / apache_zookeeper

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

Additional attribute tweaks #10

Closed lgmills closed 10 years ago

lgmills commented 10 years ago

Thanks for all your updates to this cookbook! I have a few other comments:

Attributes:

In the zookeeper_helper library, I added some additional node attributes to match the server list against; these were helpful in my chef-solo deployments on AWS EC2:

  def does_server_match_node? server
    # We check that the server value is either the node's fqdn, hostname,
    # machinename, or ipaddress, including the EC2 equivalents. We also check
    # if the value is of the form [HOST]:[PORT]:[PORT] which is also
    # valid in the case of defining quorum and leader election ports.
    server == node["fqdn"] || server.start_with?("#{node["fqdn"]}:") ||
    server == node["hostname"] || server.start_with?("#{node["hostname"]}:") ||
    server == node["ipaddress"] || server.start_with?("#{node["ipaddress"]}:") |
|
    server.start_with?("#{node["machinname"]}:") || server.start_with?("#{node["
machinename"]}:") ||
    server == node["ec2"]["public_hostname"] || server.start_with?("#{node["ec2"
]["public_hostname"]}:") ||
    server == node["ec2"]["public_ipv4"] || server.start_with?("#{node["ec2"]["p
ublic_ipv4"]}:")
  end
bbaugher commented 10 years ago
bbaugher commented 10 years ago

This has been released