eventscripts: Clarify that CTDB_NATGW_DEFAULT_GATEWAY is optional
authorMartin Schwenke <martin@meltin.net>
Fri, 7 Mar 2014 03:14:16 +0000 (14:14 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Wed, 26 Mar 2014 05:57:36 +0000 (16:57 +1100)
This has been implied since the command to add the route has had
errors redirected to /dev/null.  If infrastucture (e.g. ADS, DNS) is
on the same network as CTDB_NATGW_PUBLIC_IP then no route is
necessary.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(Imported from commit d88ace388e7a5a9e04d0d0c7f3e55edc16d8771b)

config/events.d/11.natgw
doc/ctdb.7.xml
doc/ctdbd.conf.5.xml

index 4d58ed2425a0b314596ad17ece13febaa5f19768..b97eca5e302391e0b9520d502c81de761914cfb4 100755 (executable)
@@ -69,7 +69,9 @@ natgw_set_master ()
        -d $ctdb_natgw_public_ip_host -j REJECT 2>/dev/null
 
     ip addr add $CTDB_NATGW_PUBLIC_IP dev $CTDB_NATGW_PUBLIC_IFACE
-    ip route add 0.0.0.0/0 metric 10 via $CTDB_NATGW_DEFAULT_GATEWAY >/dev/null 2>/dev/null
+    if [ -n "$CTDB_NATGW_DEFAULT_GATEWAY" ] ; then
+       ip route add 0.0.0.0/0 metric 10 via $CTDB_NATGW_DEFAULT_GATEWAY
+    fi
 }
 
 natgw_set_slave ()
index 989a28070c3162eade7d843f103bc8164453d0af..d6403000246cd40ee8c5c8c90599b9575ef398ba 100644 (file)
@@ -635,11 +635,12 @@ CTDB_NATGW_DEFAULT_GATEWAY=10.0.0.1
        <varname>CTDB_NATGW_PUBLIC_IP</varname> on the configured public
        interfaces <varname>CTDB_NATGW_PUBLIC_IFACE</varname> and acts as
        a router, masquerading outgoing connections from slave nodes
-       via this IP address.  It also establishes a fallback default
-       route to the configured default gateway
-       <varname>CTDB_NATGW_DEFAULT_GATEWAY</varname> with a metric of 10.
-       A metric 10 route is used so it can co-exist with other
-       default routes that may be available.
+       via this IP address.  If
+       <varname>CTDB_NATGW_DEFAULT_GATEWAY</varname> is set then it
+       also establishes a fallback default route to the configured
+       this gateway with a metric of 10.  A metric 10 route is used
+       so it can co-exist with other default routes that may be
+       available.
       </para>
 
       <para>
index d80bda6960feeefcb55e81a1372a3f2958e55a47..6d164f6cfcde1f59aa284bd3976c42888fe87de2 100644 (file)
          <listitem>
            <para>
              IPADDR is an alternate network gateway to use on the NAT
-             gateway master node.  A fallback default route is added
-             via this network gateway.
+             gateway master node.  If set, a fallback default route
+             is added via this network gateway.
            </para>
            <para>
-             No default.
+             No default.  Setting this variable is optional - if not
+             set that no route is created on the NAT gateway master
+             node.
            </para>
          </listitem>
        </varlistentry>