--- /dev/null
+<%
+from invirt.config import structs as cfg
+%>\
+<?xml version="1.0"?>
+<cluster name="invirt" config_version="1">
+ <cman />
+ <clusternodes>
+% for id, host in enumerate(cfg.hosts):
+ <clusternode name="${host.hostname.split('.')[0]}-internal" nodeid="${id + 1}" />
+% endfor
+ </clusternodes>
+</cluster>
\ No newline at end of file
--- /dev/null
+<%
+import os
+%>\
+NODENAME="${os.uname()[1].split('.')[0]}"
\ No newline at end of file
--- /dev/null
+invirt-cluster-config (0.0.1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Evan Broder <broder@mit.edu> Sat, 01 Nov 2008 15:43:41 -0400
--- /dev/null
+Source: invirt-cluster-config
+Section: servers
+Priority: extra
+Maintainer: Invirt project <invirt@mit.edu>
+Build-Depends: cdbs, debhelper (>= 5), config-package-dev, lvm2
+Standards-Version: 3.8.0
+
+Package: invirt-cluster-config
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, invirt-base,
+ invirt-storage-config, cman, clvm
+Description: Cluster configuration for the Invirt project
+ This package should be installed on all Invirt host machines to
+ configure Redhat Clustering and clustering LVM
--- /dev/null
+This software was written for the XVM project <xvm@mit.edu>
+of the MIT Student Information Processing Board.
+
+Copyright :
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+On Debian systems, the complete text of the GNU General Public License
+can be found in the file /usr/share/common-licenses/GPL.
--- /dev/null
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides: invirt-cluster-config
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Invirt clustering configuration
+# Description: Configure Redhat clustering and clustering LVM
+### END INIT INFO
+
+PACKAGE=invirt-cluster-config
+GEN_FILES=(/etc/default/cman /etc/cluster/cluster.conf)
+
+. /lib/init/config-init.sh
+config_init "$1"
--- /dev/null
+cluster.conf.mako etc/cluster
+cman.mako etc/default
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+# postinst script for #PACKAGE#
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+case "$1" in
+ configure)
+ invoke-rc.d cman restart
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
--- /dev/null
+#!/usr/bin/make -f
+
+DEB_DIVERT_EXTENSION = .invirt
+DEB_TRANSFORM_FILES_invirt-cluster-config += \
+ /etc/lvm/lvm.conf.invirt
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/config-package.mk
--- /dev/null
+#!/usr/bin/perl -0p
+s/^( *locking_type = )1.*$/$1 = 2/m or die;
+s/^( *fallback_to_clustered_locking = ).*$/$1 = 0/m or die;
+s/^( *fallback_to_local_locking = ).*$/$1 = 0/m or die;
+s/^( *)# *(locking_library.*)$/$1$2/m or die;
+s/^( *)# *(library_dir.*)$/$1$2/m or die;