summaryrefslogtreecommitdiff
path: root/manifests/backup.pp
diff options
context:
space:
mode:
authorMarc Fournier <marc.fournier@camptocamp.com>2011-11-15 13:05:20 +0100
committerMarc Fournier <marc.fournier@camptocamp.com>2011-11-15 13:05:20 +0100
commitd132bb2ffbb6f6d5a148db1aa0ad2f3645a3971c (patch)
treed8f8e04000f0f07f81eba371e73ecb857f140e54 /manifests/backup.pp
parent50c15a548af9fdc22b6e0d30ef24c9df7688678c (diff)
file renaming to be compliant with recommended module structure.
Diffstat (limited to 'manifests/backup.pp')
-rw-r--r--manifests/backup.pp38
1 files changed, 38 insertions, 0 deletions
diff --git a/manifests/backup.pp b/manifests/backup.pp
new file mode 100644
index 0000000..6baea1d
--- /dev/null
+++ b/manifests/backup.pp
@@ -0,0 +1,38 @@
+class couchdb::backup {
+
+ include couchdb::params
+
+ # used in ERB templates
+ $bind_address = $couchdb::params::bind_address
+ $port = $couchdb::params::port
+ $backupdir = $couchdb::params::backupdir
+
+ file {$couchdb::params::backupdir:
+ ensure => directory,
+ mode => 755,
+ require => Package["couchdb"],
+ }
+
+ file { "/usr/local/sbin/couchdb-backup.py":
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 755,
+ content => template("couchdb/couchdb-backup.py.erb"),
+ require => [ File[$couchdb::params::backupdir], Exec["install python-couchdb"] ],
+ }
+
+ cron { "couchdb-backup":
+ command => "/usr/local/sbin/couchdb-backup.py 2> /dev/null",
+ hour => 3,
+ minute => 0,
+ require => File["/usr/local/sbin/couchdb-backup.py"],
+ }
+
+ exec {"install python-couchdb":
+ command => "easy_install couchdb",
+ require => Package["python-setuptools"],
+ unless => "grep -q CouchDB-0.8-py2.5.egg /usr/lib/python2.5/site-packages/easy-install.pth"
+ }
+
+}