From: Walter Huf Date: Fri, 21 Mar 2014 20:05:15 +0000 (-0500) Subject: Finds the primary ipv4 on mon nodes X-Git-Tag: v0.8.0~50^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F110%2Fhead;p=ceph-cookbooks.git Finds the primary ipv4 on mon nodes Prevents issues with clustered IPs being used in ceph.conf files Since ceph-mon doesn't bind to these ips, don't consider them as mon addrs --- diff --git a/libraries/default.rb b/libraries/default.rb index 47d0101..4f6fc03 100644 --- a/libraries/default.rb +++ b/libraries/default.rb @@ -41,7 +41,13 @@ def find_node_ip_in_network(network, nodeish = nil) end def ip_address_in_network?(ip, params, net) - ['inet', 'inet6'].include?(params['family']) && net.include?(ip) + if params['family'] == 'inet' + net.include?(ip) && params.key?('broadcast') # is primary ip on iface + elsif params['family'] == 'inet6' + net.include?(ip) + else + false + end end def ip_address_to_ceph_address(ip, params)