local num_nodes=0
hack_all_nodes_with ctdb_nodes_line >$nodes_file
+ # Build /etc/ctdb/nodes.ipv6
+ ctdb_nodes_line_ipv6 ()
+ {
+ [ "$ctdb_node" = 1 ] || return 0
+ echo "fc00:${NETWORK_PRIVATE_PREFIX//./:}::$(($FIRSTIP + $ip_offset))"
+ num_nodes=$(($num_nodes + 1))
+ }
+ nodes_file_ipv6="tmp/nodes.$CLUSTER.ipv6"
+ local num_nodes=0
+ hack_all_nodes_with ctdb_nodes_line_ipv6 >$nodes_file_ipv6
+
# Build UUID map
uuid_map="tmp/uuid_map.$CLUSTER"
uuid_map_line ()
echo "Setting up /etc/ctdb/nodes"
diskimage mkdir_p "/etc/ctdb"
- diskimage put "$nodes_file" "/etc/ctdb/nodes"
+ if [ "$NETWORK_STACK" = "ipv4" ] ; then
+ diskimage put "$nodes_file" "/etc/ctdb/nodes"
+ elif [ "$NETWORK_STACK" = "ipv6" ] ; then
+ diskimage put "$nodes_file_ipv6" "/etc/ctdb/nodes"
+ elif [ "$NETWORK_STACK" = "dual" ] ; then
+ diskimage put "$nodes_file" "/etc/ctdb/nodes.ipv4"
+ diskimage put "$nodes_file_ipv6" "/etc/ctdb/nodes.ipv6"
+ diskimage put "$nodes_file" "/etc/ctdb/nodes"
+ else
+ die "Error: Invalid NETWORK_STACK value \"$NETWORK_STACK\"."
+ fi
[ "$WEBPROXY" = "" ] || {
diskimage append_text "export http_proxy=$WEBPROXY" "/etc/bashrc"