From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan McCabe Date: Tue, 24 Jul 2012 13:37:08 -0400 Subject: [Cluster-devel] [PATCH] rgmanager: Add IP "interface" parameter In-Reply-To: <500A3476.7090304@redhat.com> References: <20120712172325.GA117794@redhat.com> <4FFF9F36.2040007@redhat.com> <50008044.6070102@redhat.com> <5001CE68.5060302@redhat.com> <5009C876.502@redhat.com> <500A3476.7090304@redhat.com> Message-ID: <20120724173708.GA26700@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Sat, Jul 21, 2012 at 06:47:50AM +0200, Fabio M. Di Nitto wrote: > On 07/20/2012 11:07 PM, Lon Hohberger wrote: > > Sure; that's fine. > > > > prefer_interface="" > > > > maybe? "If more than one match, use this one, otherwise, use the one > > that matches" > > Yes that sounds a lot better than force_* :) > > Thanks > Fabio Works for me. New patch: This patch adds a "prefer_interface" parameter for IP resources. The interface must already be configured and active. This parameter should be used only when at least two active interfaces have IP addresses on the same subnet and it's necessary to specify which particular interface should be used. Signed-off-by: Ryan McCabe --- rgmanager/src/resources/ip.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rgmanager/src/resources/ip.sh b/rgmanager/src/resources/ip.sh index 38d1ab9..bbd85f3 100755 --- a/rgmanager/src/resources/ip.sh +++ b/rgmanager/src/resources/ip.sh @@ -132,6 +132,15 @@ meta_data() + + + The network interface to which the IP address should be added. The interface must already be configured and active. This parameter should be used only when at least two active interfaces have IP addresses on the same subnet and it is desired to have the IP address added to a particular interface. + + + Network interface + + + @@ -587,6 +596,10 @@ ipv6() fi if [ "$1" = "add" ]; then + if [ -n "$OCF_RESKEY_prefer_interface" ] && \ + [ "$OCF_RESKEY_prefer_interface" != $dev ]; then + continue + fi ipv6_same_subnet $ifaddr_exp/$maskbits $addr_exp if [ $? -ne 0 ]; then continue @@ -670,6 +683,10 @@ ipv4() fi if [ "$1" = "add" ]; then + if [ -n "$OCF_RESKEY_prefer_interface" ] && \ + [ "$OCF_RESKEY_prefer_interface" != $dev ]; then + continue + fi ipv4_same_subnet $ifaddr/$maskbits $addr if [ $? -ne 0 ]; then continue -- 1.7.10.4