Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=9eccf2611b6bfd... Commit: 9eccf2611b6bfd92e4b15196b4744f24991a7bb8 Parent: 332db7754d6210991c34be056789aa1b33b26a0a Author: Ryan McCabe rmccabe@redhat.com AuthorDate: Tue Jul 24 13:34:35 2012 -0400 Committer: Ryan McCabe rmccabe@redhat.com CommitterDate: Tue Jul 24 18:13:09 2012 -0400
rgmanager: Add IP resource agent "prefer_interface" parameter
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.
Acked-by: Lon Hohberger lhh@redhat.com Signed-off-by: Ryan McCabe rmccabe@redhat.com --- rgmanager/src/resources/ip.sh | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-)
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() <content type="boolean"/> </parameter>
+ <parameter name="prefer_interface"> + <longdesc lang="en"> + 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. + </longdesc> + <shortdesc lang="en"> + Network interface + </shortdesc> + <content type="string"/> + </parameter> </parameters>
<actions> @@ -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
cluster-commits@lists.stg.fedorahosted.org