aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-03-19 17:05:32 -0400
committerJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-04-17 17:11:20 -0400
commit058ebe28086cd53f6fe86b794d6b658c95124ed7 (patch)
tree19764370d0699961401f8becc1379f0e17434c7f /manifests
parent74ce68bcf6f1fbf938e4a161f7c6305f67378b7d (diff)
downloadpuppet-backupninja-058ebe28086cd53f6fe86b794d6b658c95124ed7.tar.gz
puppet-backupninja-058ebe28086cd53f6fe86b794d6b658c95124ed7.tar.bz2
fix autoload, first attempt
Diffstat (limited to 'manifests')
-rw-r--r--manifests/client.pp106
-rw-r--r--manifests/client/defaults.pp45
-rw-r--r--manifests/client/duplicity.pp9
-rw-r--r--manifests/client/maildir.pp9
-rw-r--r--manifests/client/rdiff_backup.pp9
-rw-r--r--manifests/client/rsync.pp9
-rw-r--r--manifests/client/sys.pp19
-rw-r--r--manifests/config.pp18
-rw-r--r--manifests/cron.pp17
-rw-r--r--manifests/duplicity.pp (renamed from manifests/dup.pp)0
-rw-r--r--manifests/init.pp17
11 files changed, 117 insertions, 141 deletions
diff --git a/manifests/client.pp b/manifests/client.pp
index c41f6e7..f0531a0 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -1,49 +1,3 @@
-class backupninja::client::defaults {
- $configdir = $cfg_override ? {
- '' => "/etc/backup.d",
- default => $cfg_override,
- }
- $real_keystore = $backupkeystore ? {
- '' => "$fileserver/keys/backupkeys",
- default => $backupkeystore,
- }
- $real_keytype = $backupkeytype ? {
- '' => 'rsa',
- false => 'rsa',
- default => $backupkeytype,
- }
- $real_keydestination = $keydestination ? {
- '' => '/root/.ssh',
- default => $keydestination,
- }
- $real_keyowner = $keyowner ? {
- '' => 0,
- default => $keyowner,
- }
- $real_keygroup = $keygroup ? {
- '' => 0,
- default => $keygroup,
- }
- $real_keymanage = $keymanage ? {
- '' => true,
- default => $keymanage
- }
- $real_ssh_dir_manage = $ssh_dir_manage ? {
- '' => true,
- default => $ssh_dir_manage
- }
- if !defined(Package["backupninja"]) {
- if $backupninja_ensure_version == '' { $backupninja_ensure_version = 'installed' }
- package { 'backupninja':
- ensure => $backupninja_ensure_version
- }
- }
- file { $configdir:
- ensure => directory,
- mode => 750, owner => 0, group => 0;
- }
-}
-
class backupninja::client inherits backupninja::client::defaults {
define key(
$user = false, $host = false, $createkey=false, $installkey=false,
@@ -117,63 +71,3 @@ class backupninja::client inherits backupninja::client::defaults {
}
}
}
-
-class backupninja::client::maildir inherits backupninja::client::defaults {
-
- if !defined(Package["rsync"]) {
- if $rsync_ensure_version == '' { $rsync_ensure_version = 'installed' }
- package { 'rsync':
- ensure => $rsync_ensure_version,
- }
- }
-}
-
-class backupninja::client::rdiff_backup inherits backupninja::client::defaults {
-
- if !defined(Package["rdiff-backup"]) {
- if $rdiff_backup_ensure_version == '' { $rdiff_backup_ensure_version = 'installed' }
- package { 'rdiff-backup':
- ensure => $rdiff_backup_ensure_version,
- }
- }
-}
-
-class backupninja::client::duplicity inherits backupninja::client::defaults {
-
- if !defined(Package["duplicity"]) {
- if $duplicity_ensure_version == '' { $duplicity_ensure_version = 'installed' }
- package { 'duplicity':
- ensure => $duplicity_ensure_version,
- }
- }
-}
-
-class backupninja::client::sys inherits backupninja::client::defaults {
- case $operatingsystem {
- debian,ubuntu: {
- if !defined(Package["debconf-utils"]) {
- if $debconf_utils_ensure_version == '' { $debconf_utils_ensure_version = 'installed' }
- package { 'debconf-utils':
- ensure => $debconf_utils_ensure_version,
- }
- }
- if !defined(Package["hwinfo"]) {
- if $hwinfo_ensure_version == '' { $hwinfo_ensure_version = 'installed' }
- package { 'hwinfo':
- ensure => $hwinfo_ensure_version,
- }
- }
- }
- default: {}
- }
-}
-
-class backupninja::client::rsync inherits backupninja::client::defaults {
-
- if !defined(Package["rsync"]) {
- if $rsync_ensure_version == '' { $rsync_ensure_version = 'installed' }
- package { 'rsync':
- ensure => $rsync_ensure_version,
- }
- }
-}
diff --git a/manifests/client/defaults.pp b/manifests/client/defaults.pp
new file mode 100644
index 0000000..9dc8747
--- /dev/null
+++ b/manifests/client/defaults.pp
@@ -0,0 +1,45 @@
+class backupninja::client::defaults {
+ $configdir = $cfg_override ? {
+ '' => "/etc/backup.d",
+ default => $cfg_override,
+ }
+ $real_keystore = $backupkeystore ? {
+ '' => "$fileserver/keys/backupkeys",
+ default => $backupkeystore,
+ }
+ $real_keytype = $backupkeytype ? {
+ '' => 'rsa',
+ false => 'rsa',
+ default => $backupkeytype,
+ }
+ $real_keydestination = $keydestination ? {
+ '' => '/root/.ssh',
+ default => $keydestination,
+ }
+ $real_keyowner = $keyowner ? {
+ '' => 0,
+ default => $keyowner,
+ }
+ $real_keygroup = $keygroup ? {
+ '' => 0,
+ default => $keygroup,
+ }
+ $real_keymanage = $keymanage ? {
+ '' => true,
+ default => $keymanage
+ }
+ $real_ssh_dir_manage = $ssh_dir_manage ? {
+ '' => true,
+ default => $ssh_dir_manage
+ }
+ if !defined(Package["backupninja"]) {
+ if $backupninja_ensure_version == '' { $backupninja_ensure_version = 'installed' }
+ package { 'backupninja':
+ ensure => $backupninja_ensure_version
+ }
+ }
+ file { $configdir:
+ ensure => directory,
+ mode => 750, owner => 0, group => 0;
+ }
+}
diff --git a/manifests/client/duplicity.pp b/manifests/client/duplicity.pp
new file mode 100644
index 0000000..938ff3f
--- /dev/null
+++ b/manifests/client/duplicity.pp
@@ -0,0 +1,9 @@
+class backupninja::client::duplicity inherits backupninja::client::defaults {
+
+ if !defined(Package["duplicity"]) {
+ if $duplicity_ensure_version == '' { $duplicity_ensure_version = 'installed' }
+ package { 'duplicity':
+ ensure => $duplicity_ensure_version,
+ }
+ }
+}
diff --git a/manifests/client/maildir.pp b/manifests/client/maildir.pp
new file mode 100644
index 0000000..65f8aee
--- /dev/null
+++ b/manifests/client/maildir.pp
@@ -0,0 +1,9 @@
+class backupninja::client::maildir inherits backupninja::client::defaults {
+
+ if !defined(Package["rsync"]) {
+ if $rsync_ensure_version == '' { $rsync_ensure_version = 'installed' }
+ package { 'rsync':
+ ensure => $rsync_ensure_version,
+ }
+ }
+}
diff --git a/manifests/client/rdiff_backup.pp b/manifests/client/rdiff_backup.pp
new file mode 100644
index 0000000..9b098bf
--- /dev/null
+++ b/manifests/client/rdiff_backup.pp
@@ -0,0 +1,9 @@
+class backupninja::client::rdiff_backup inherits backupninja::client::defaults {
+
+ if !defined(Package["rdiff-backup"]) {
+ if $rdiff_backup_ensure_version == '' { $rdiff_backup_ensure_version = 'installed' }
+ package { 'rdiff-backup':
+ ensure => $rdiff_backup_ensure_version,
+ }
+ }
+}
diff --git a/manifests/client/rsync.pp b/manifests/client/rsync.pp
new file mode 100644
index 0000000..ec92b56
--- /dev/null
+++ b/manifests/client/rsync.pp
@@ -0,0 +1,9 @@
+class backupninja::client::rsync inherits backupninja::client::defaults {
+
+ if !defined(Package["rsync"]) {
+ if $rsync_ensure_version == '' { $rsync_ensure_version = 'installed' }
+ package { 'rsync':
+ ensure => $rsync_ensure_version,
+ }
+ }
+}
diff --git a/manifests/client/sys.pp b/manifests/client/sys.pp
new file mode 100644
index 0000000..c038060
--- /dev/null
+++ b/manifests/client/sys.pp
@@ -0,0 +1,19 @@
+class backupninja::client::sys inherits backupninja::client::defaults {
+ case $operatingsystem {
+ debian,ubuntu: {
+ if !defined(Package["debconf-utils"]) {
+ if $debconf_utils_ensure_version == '' { $debconf_utils_ensure_version = 'installed' }
+ package { 'debconf-utils':
+ ensure => $debconf_utils_ensure_version,
+ }
+ }
+ if !defined(Package["hwinfo"]) {
+ if $hwinfo_ensure_version == '' { $hwinfo_ensure_version = 'installed' }
+ package { 'hwinfo':
+ ensure => $hwinfo_ensure_version,
+ }
+ }
+ }
+ default: {}
+ }
+}
diff --git a/manifests/config.pp b/manifests/config.pp
index 89105b3..34e3a0e 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -18,21 +18,3 @@ define backupninja::config(
mode => 0644
}
}
-
-# Write the backupninja cron job, allowing you to specify an alternate backupninja
-# command (if you want to wrap it in any other commands, e.g. to allow it to use
-# the monkeysphere for authentication), or a different schedule to run it on.
-define backupninja::cron(
- $backupninja_cmd = '/usr/sbin/backupninja',
- $backupninja_test_cmd = $backupninja_cmd,
- $cronfile = "/etc/cron.d/backupninja",
- $min = "0", $hour = "*", $dom = "*", $month = "*",
- $dow = "*")
-{
- file { $cronfile:
- content => template('backupninja/backupninja.cron.erb'),
- owner => root,
- group => root,
- mode => 0644
- }
-}
diff --git a/manifests/cron.pp b/manifests/cron.pp
new file mode 100644
index 0000000..bd4e857
--- /dev/null
+++ b/manifests/cron.pp
@@ -0,0 +1,17 @@
+# Write the backupninja cron job, allowing you to specify an alternate backupninja
+# command (if you want to wrap it in any other commands, e.g. to allow it to use
+# the monkeysphere for authentication), or a different schedule to run it on.
+define backupninja::cron(
+ $backupninja_cmd = '/usr/sbin/backupninja',
+ $backupninja_test_cmd = $backupninja_cmd,
+ $cronfile = "/etc/cron.d/backupninja",
+ $min = "0", $hour = "*", $dom = "*", $month = "*",
+ $dow = "*")
+{
+ file { $cronfile:
+ content => template('backupninja/backupninja.cron.erb'),
+ owner => root,
+ group => root,
+ mode => 0644
+ }
+}
diff --git a/manifests/dup.pp b/manifests/duplicity.pp
index 99b64f8..99b64f8 100644
--- a/manifests/dup.pp
+++ b/manifests/duplicity.pp
diff --git a/manifests/init.pp b/manifests/init.pp
deleted file mode 100644
index fba8cc4..0000000
--- a/manifests/init.pp
+++ /dev/null
@@ -1,17 +0,0 @@
-import "client.pp"
-import "config.pp"
-import "dup.pp"
-import "labelmount.pp"
-import "maildir.pp"
-import "mysql.pp"
-import "pgsql.pp"
-import "rdiff.pp"
-import "server.pp"
-import "sh.pp"
-import "svn.pp"
-import "sys.pp"
-
-class backupninja {
-
-}
-