summaryrefslogtreecommitdiff
path: root/ctdb/config/events.d/11.natgw
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-04-10 11:58:57 +1000
committerMartin Schwenke <martins@samba.org>2014-04-14 06:06:49 +0200
commit2f2421bae1a8ff46ad54f76d02e6dd1c3ffe3300 (patch)
treeb30e1aaf874c27de108ae8979172244972e16fd4 /ctdb/config/events.d/11.natgw
parentce8ac88b969bb8bb7a94e62bb6e86aec389be6ac (diff)
downloadsamba-2f2421bae1a8ff46ad54f76d02e6dd1c3ffe3300.tar.gz
ctdb-eventscripts: CTDB_NATGW_PUBLIC_* optional on slave-only nodes
Commit 4ee4925d416a86341bd76c11fa99ec9173682a1d forgot about CTDB_NATGW_SLAVE_ONLY so it introduces an incorrect failure when this is set, and CTDB_NATGW_PUBLIC_IFACE or CTDB_NATGW_PUBLIC_IP is unset. Relax the sanity check to see if CTDB_NATGW_SLAVE_ONLY is set. Update the documentation to explicitly state that CTDB_NATGW_PUBLIC_IFACE and CTDB_NATGW_PUBLIC_IP are optional and unused if CTDB_NATGW_SLAVE_ONLY is set. It would be possible to insist that CTDB_NATGW_PUBLIC_IFACE and CTDB_NATGW_PUBLIC_IFACE should be unset in that case. However, it is more reasonable to allow consistent configuration across nodes except with some nodes configured slave-only. Add tests, update infrastructure and fix a thinko in the stub's "natgwlist" implementation. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Mon Apr 14 06:06:49 CEST 2014 on sn-devel-104
Diffstat (limited to 'ctdb/config/events.d/11.natgw')
-rwxr-xr-xctdb/config/events.d/11.natgw10
1 files changed, 6 insertions, 4 deletions
diff --git a/ctdb/config/events.d/11.natgw b/ctdb/config/events.d/11.natgw
index b2a219cdebc..f925d4b7357 100755
--- a/ctdb/config/events.d/11.natgw
+++ b/ctdb/config/events.d/11.natgw
@@ -18,10 +18,12 @@ natgw_check_config ()
{
[ -r "$CTDB_NATGW_NODES" ] || \
die "error: CTDB_NATGW_NODES=${CTDB_NATGW_NODES} unreadable"
- [ -n "$CTDB_NATGW_PUBLIC_IP" ] || \
- die "Invalid configuration: CTDB_NATGW_PUBLIC_IP not set"
- [ -n "$CTDB_NATGW_PUBLIC_IFACE" ] || \
- die "Invalid configuration: CTDB_NATGW_PUBLIC_IFACE not set"
+ if [ "$CTDB_NATGW_SLAVE_ONLY" != "yes" ] ; then
+ [ -n "$CTDB_NATGW_PUBLIC_IP" ] || \
+ die "Invalid configuration: CTDB_NATGW_PUBLIC_IP not set"
+ [ -n "$CTDB_NATGW_PUBLIC_IFACE" ] || \
+ die "Invalid configuration: CTDB_NATGW_PUBLIC_IFACE not set"
+ fi
[ -n "$CTDB_NATGW_PRIVATE_NETWORK" ] || \
die "Invalid configuration: CTDB_NATGW_PRIVATE_NETWORK not set"