summaryrefslogtreecommitdiffstats
path: root/manifests/xml.pp
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2013-09-07 16:20:29 -0400
committerJames Shubin <james@shubin.ca>2013-09-07 16:20:29 -0400
commit4345cf9e625259585f7f8541e08c0e79a914e78c (patch)
tree83dd170ca9286fe32943f1ea41cecf893531ccc1 /manifests/xml.pp
parent64aaaf3b0160ac50d22bbdd73725de53bab668a8 (diff)
downloadpuppet-gluster-4345cf9e625259585f7f8541e08c0e79a914e78c.tar.gz
puppet-gluster-4345cf9e625259585f7f8541e08c0e79a914e78c.tar.xz
puppet-gluster-4345cf9e625259585f7f8541e08c0e79a914e78c.zip
Add proper ping/status checks before volume creation.
This adds proper (optional) ping checks with fping and gluster peer status checks to ensure the peer are available before a volume create command. This required rewriting of the xml.py hack which helps puppet interface with the xml formatted gluster cli output. In addition, downstream commands such as volume::property gained checks to ensure the volume was present beforehand. While it is not obvious, it should be noted that because of the distributed nature of glusterfs, more than one puppet run will be required for complete deployment. With these patches, individual runs shouldn't ever end in temporary error as they used too.
Diffstat (limited to 'manifests/xml.pp')
-rw-r--r--manifests/xml.pp42
1 files changed, 42 insertions, 0 deletions
diff --git a/manifests/xml.pp b/manifests/xml.pp
new file mode 100644
index 0000000..5335cc3
--- /dev/null
+++ b/manifests/xml.pp
@@ -0,0 +1,42 @@
+# Simple? gluster module by James
+# Copyright (C) 2012-2013+ James Shubin
+# Written by James Shubin <james@shubin.ca>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+class gluster::xml {
+ include gluster::vardir
+
+ package { 'python-lxml': # for parsing gluster xml output
+ ensure => present,
+ }
+
+ #$vardir = $::gluster::vardir::module_vardir # with trailing slash
+ $vardir = regsubst($::gluster::vardir::module_vardir, '\/$', '')
+
+ file { "${vardir}/xml.py":
+ source => 'puppet:///modules/gluster/xml.py',
+ owner => root,
+ group => nobody,
+ mode => 700, # u=rwx
+ backup => false, # don't backup to filebucket
+ ensure => present,
+ require => [
+ Package['python-lxml'],
+ File["${vardir}/"],
+ ],
+ }
+}
+
+# vim: ts=8