]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Merge branch 'master' of git+ssh://puppet.debian.org/srv/puppet.debian.org/git/dsa...
authorMartin Zobel-Helas <zobel@debian.org>
Sat, 16 Jun 2012 10:30:50 +0000 (12:30 +0200)
committerMartin Zobel-Helas <zobel@debian.org>
Sat, 16 Jun 2012 10:30:50 +0000 (12:30 +0200)
* 'master' of git+ssh://puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet:
  Drop bacula-sd-pgsql for really-real
  Drop bacula-sd-pgsql for real
  Add bacula::storage to beethoven
  Nicer syntax
  Add template
  Fix up git URL
  Drop unneeded package
  Add storage daemon class
  Put db port and address into configuration too
  Add address too
  Set $client to make per-client config more readable
  Add per-client config
  Use $name rather than $client, syntax, syntax, syntax
  Moar typos
  Typo
  Generate per-client configs for bacula. Hopefully
  Move storage to beethoven
  Add boito
  bertali

manifests/site.pp
modules/bacula/manifests/bacula.pp
modules/bacula/manifests/director.pp
modules/bacula/manifests/storage.pp [new file with mode: 0644]
modules/bacula/templates/bacula-dir.conf.erb
modules/bacula/templates/bacula-sd.conf.erb [new file with mode: 0644]
modules/bacula/templates/per-client.conf.erb [new file with mode: 0644]
modules/debian-org/misc/local.yaml

index 6123122491d6661c7e8a7f66b40a7a283110f8fe..07bc8eab7957a7c960cb62410ea9216ccac336a5 100644 (file)
@@ -44,6 +44,10 @@ node default {
                include bacula::director
        }
 
+       if $::hostname == 'beethoven' {
+               include bacula::storage
+       }
+
        if $::kernel == Linux {
                include linux
                if $::kvmdomain {
index 3724c1bfa3c7b64df9ba8d6c97f7fbe4690c6e4e..3cf9b6742f335ab0a0a7d0e5fc536af1f010038c 100644 (file)
@@ -12,13 +12,16 @@ class bacula {
 
   $bacula_director_address  = "dinis.debian.org"
   $bacula_director_port     = 9101
-  $bacula_storage_address   = "jommeli.debian.org"
+  $bacula_storage_address   = "beethoven.debian.org"
   $bacula_storage_port      = 9103
   $bacula_client_port       = 9102
+  $bacula_db_address        = "danzi.debian.org"
+  $bacula_db_port           = 5433
 
   $bacula_backup_path       = "/srv/backup.debian.org/bacula"
 
   $bacula_director_secret   = hmac("/etc/puppet/secret", "bacula-dir-$hostname")
+  $bacula_db_secret         = hmac("/etc/puppet/secret", "bacula-db-$hostname")
   $bacula_storage_secret    = hmac("/etc/puppet/secret", "bacula-sd-$hostname")
   $bacula_client_secret     = hmac("/etc/puppet/secret", "bacula-fd-$hostname")
   $bacula_monitor_secret    = hmac("/etc/puppet/secret", "bacula-monitor-$hostname")
index 4540615135d98e13a1040fc8be5e41631a656a41..40720b7496c7ff8f05fd2e99354fed44ab4d5f6b 100644 (file)
@@ -34,4 +34,23 @@ class bacula::director inherits bacula {
       path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
       refreshonly => true;
   }
+
+  define bacula_client() {
+    # These must be kept in sync with the settings in bacula.pp
+    $bacula_client_name       = "${name}-fd"
+    $bacula_client_secret     = hmac("/etc/puppet/secret", "bacula-fd-${name}")
+    $client = $name
+
+    file {
+      "/etc/bacula/conf.d/${name}.conf":
+      content => template("bacula/per-client.conf.erb"),
+      mode => 440,
+      group => bacula,
+      notify  => Exec["bacula-director restart"]
+      ;
+    }
+  }
+  $allhosts = keys($site::allnodeinfo)
+
+  bacula_client { $allhosts: }
 }
diff --git a/modules/bacula/manifests/storage.pp b/modules/bacula/manifests/storage.pp
new file mode 100644 (file)
index 0000000..5ed32b9
--- /dev/null
@@ -0,0 +1,28 @@
+class bacula::storage inherits bacula {
+
+  package {
+    "bacula-sd": ensure => installed;
+  }
+
+  service {
+    "bacula-sd":
+      ensure => running,
+      enable => true,
+      hasstatus => true,
+      ;
+  }
+  file {
+    "/etc/bacula/bacula-sd.conf":
+      content => template("bacula/bacula-sd.conf.erb"),
+      mode => 640,
+      group => bacula,
+      notify  => Exec["bacula-sd restart"]
+      ;
+  }
+
+  exec {
+    "bacula-sd restart":
+      path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
+      refreshonly => true;
+  }
+}
index 9549b25ec830ac4e395c063ab846fe7edfc11d2e..a1444a6277108d9e48f1d6b9ed28885334e5cf32 100644 (file)
@@ -95,7 +95,11 @@ Schedule {
 ########################################################################
 Catalog {
   Name = MyCatalog
-  dbname = bacula; DB Address = ""; dbuser = "bacula"; dbpassword = "s3kr1t"
+  dbname = bacula;
+  DB Address = "<%= bacula_db_address %>";
+  DB Port = <%= bacula_db_port %>;
+  dbuser = "bacula";
+  dbpassword = "<%= bacula_db_secret %>"
 }
 
 ########################################################################
diff --git a/modules/bacula/templates/bacula-sd.conf.erb b/modules/bacula/templates/bacula-sd.conf.erb
new file mode 100644 (file)
index 0000000..ee1dd1c
--- /dev/null
@@ -0,0 +1,45 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+#  For Bacula release 5.0.1 (24 February 2010) -- debian 5.0.4
+
+Storage {
+  Name = <%= bacula_storage_name %>
+  SDPort = <%= bacula_storage_port %>
+  WorkingDirectory = "/var/lib/bacula"
+  Pid Directory = "/var/run/bacula"
+  Maximum Concurrent Jobs = 21
+  SDAddress = <%= bacula_storage_address %>
+}
+
+# List Directors who are permitted to contact Storage daemon
+#
+Director {
+  Name = <%= bacula_director_name %>
+  Password = "<%= bacula_storage_secret %>"
+}
+
+
+# To connect, the Director's bacula-dir.conf must have the
+#  same Name and MediaType.
+#
+Device {
+  Name = <%= bacula_filestor_device %>
+  Media Type = <%= bacula_filestor_name %>
+  Archive Device = <%= bacula_backup_path %>
+  LabelMedia = yes;
+  Random Access = Yes;
+  AutomaticMount = yes;
+  RemovableMedia = no;
+  AlwaysOpen = no;
+  Maximum Network Buffer Size = 65536
+}
+
+# Send all messages to the Director,
+# mount messages also are sent to the email address
+#
+Messages {
+  Name = Standard
+  director = <%= bacula_director_name %> = all
+}
diff --git a/modules/bacula/templates/per-client.conf.erb b/modules/bacula/templates/per-client.conf.erb
new file mode 100644 (file)
index 0000000..e844425
--- /dev/null
@@ -0,0 +1,36 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+#  For Bacula release 5.0.1 (24 February 2010) -- debian 5.0.4
+
+Job {
+  Name = "Backup <%= client %>"
+  JobDefs = "Standardbackup"
+  Client = <%= bacula_client_name %>
+}
+
+Job {
+  Name = "Restore <%= client %>"
+  Type = Restore
+  Client= <%= bacula_client_name %>
+  FileSet = "Standard Set"
+  Storage = <%= bacula_filestor_name %>
+  Pool = <%= bacula_pool_name %>
+  Differential Backup Pool = <%= bacula_pool_name %>diff
+  Incremental Backup Pool = <%= bacula_pool_name %>inc
+  Messages = Standard
+  Where = /var/tmp/bacula-restores
+}
+
+# Client (File Services) to backup
+Client {
+  Name = <%= bacula_client_name %>
+  Address = <%= client %>
+  FDPort = <%= bacula_client_port %>
+  Catalog = MyCatalog
+  Password = "<%= bacula_client_secret %>"
+  File Retention = 30 days            # 30 days
+  Job Retention = 6 months            # six months
+  AutoPrune = yes                     # Prune expired Jobs/Files
+}
index 848462a80b750a9391b209256ec1c23f9f314d71..755bbc6890a0156b83f2cbd7e8619c35dafaded5 100644 (file)
@@ -16,9 +16,11 @@ nameinfo:
   bellini.debian.org: Vincenzo Salvatore Carmelo Francesco Bellini (November 3rd, 1801 - September 23rd, 1835)
   bendel.debian.org: Franz Bendel (March 23, 1833 - July 3, 1874)
   berlioz.debian.org: Hector Berlioz (December 11th, 1803 - March 8th, 1869)
+  bertali.debian.org: Antonio Bertali (March 1605 - 17 April 1669)
   biber.debian.org: Heinrich Ignaz Franz von Biber (August 12th, 1664 - May 3rd, 1704)
   bizet.debian.org: Georges Bizet, (October 25th, 1838 - June 3rd, 1875)
   blavet.debian.org: Michel Blavet (March 13, 1700 - October 28, 1768)
+  boiti.debian.org: Arrigo Boito (February 24th, 1842 - June 10th, 1918)
   brahms.debian.org: Johannes Brahms (May 7th, 1833 - April 3rd, 1897)
   busoni.debian.org: Ferruccio Dante Michelangiolo Benvenuto Busoni (April 1st, 1866 - July 27th, 1924)
   chopin.debian.org: Frédéric Chopin (March 1st, 1810 - October 17th, 1849)