Initial invirt-cluster-config package for configuring cman and clvm 0.0.1
authorEvan Broder <broder@mit.edu>
Tue, 4 Nov 2008 09:09:27 +0000 (04:09 -0500)
committerEvan Broder <broder@mit.edu>
Tue, 4 Nov 2008 09:09:27 +0000 (04:09 -0500)
svn path=/trunk/packages/invirt-cluster-config/; revision=1520

cluster.conf.mako [new file with mode: 0644]
cman.mako [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/invirt-cluster-config.init [new file with mode: 0644]
debian/invirt-cluster-config.install [new file with mode: 0644]
debian/invirt-cluster-config.postinst [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/transform_lvm.conf.invirt [new file with mode: 0755]

diff --git a/cluster.conf.mako b/cluster.conf.mako
new file mode 100644 (file)
index 0000000..44b1541
--- /dev/null
@@ -0,0 +1,12 @@
+<%
+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
diff --git a/cman.mako b/cman.mako
new file mode 100644 (file)
index 0000000..9bd9a00
--- /dev/null
+++ b/cman.mako
@@ -0,0 +1,4 @@
+<%
+import os
+%>\
+NODENAME="${os.uname()[1].split('.')[0]}"
\ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..6fe4f3e
--- /dev/null
@@ -0,0 +1,5 @@
+invirt-cluster-config (0.0.1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Evan Broder <broder@mit.edu>  Sat, 01 Nov 2008 15:43:41 -0400
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..81fba8b
--- /dev/null
@@ -0,0 +1,14 @@
+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
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..381dc35
--- /dev/null
@@ -0,0 +1,17 @@
+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.
diff --git a/debian/invirt-cluster-config.init b/debian/invirt-cluster-config.init
new file mode 100644 (file)
index 0000000..49e720a
--- /dev/null
@@ -0,0 +1,16 @@
+#!/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"
diff --git a/debian/invirt-cluster-config.install b/debian/invirt-cluster-config.install
new file mode 100644 (file)
index 0000000..ac5cb1c
--- /dev/null
@@ -0,0 +1,2 @@
+cluster.conf.mako etc/cluster
+cman.mako etc/default
\ No newline at end of file
diff --git a/debian/invirt-cluster-config.postinst b/debian/invirt-cluster-config.postinst
new file mode 100644 (file)
index 0000000..4939055
--- /dev/null
@@ -0,0 +1,40 @@
+#!/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
+
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..4597cfa
--- /dev/null
@@ -0,0 +1,8 @@
+#!/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
diff --git a/debian/transform_lvm.conf.invirt b/debian/transform_lvm.conf.invirt
new file mode 100755 (executable)
index 0000000..faa7592
--- /dev/null
@@ -0,0 +1,6 @@
+#!/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;