aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--manifests/nodes.pp4
-rw-r--r--modules/blog/manifests/init.pp28
-rwxr-xr-xmodules/blog/templates/backup_blog-db.sh8
-rw-r--r--modules/blog/templates/blogs_vhosts.conf9
4 files changed, 47 insertions, 2 deletions
diff --git a/manifests/nodes.pp b/manifests/nodes.pp
index 1653867f..7c9f63f1 100644
--- a/manifests/nodes.pp
+++ b/manifests/nodes.pp
@@ -147,6 +147,7 @@ node krampouezh {
include default_mageia_server_no_smtp
include postfix::secondary_smtp
include blog::base
+ include blog::db_backup
include mysql::server
include dns::server
timezone::timezone { "Europe/Paris": }
@@ -164,7 +165,8 @@ node champagne {
#
include default_mageia_server
timezone::timezone { "Europe/Paris": }
- include blog::champagne
+ include blog::files-bots
+ #include blog::files_backup
include planet
include websites::static
}
diff --git a/modules/blog/manifests/init.pp b/modules/blog/manifests/init.pp
index d3640638..dcaff643 100644
--- a/modules/blog/manifests/init.pp
+++ b/modules/blog/manifests/init.pp
@@ -10,7 +10,7 @@ class blog {
}
}
- class champagne inherits base {
+ class files-bots inherits base {
package { ['wget','php-mysql']:
ensure => installed
}
@@ -55,4 +55,30 @@ class blog {
mode => 644,
}
}
+ class db_backup inherits base {
+ file { "/var/lib/blog/backup/db":
+ ensure => directory,
+ owner => root,
+ group => root,
+ mode => 644,
+ }
+
+ file { "backup_blog-db":
+ path => "/usr/local/bin/backup_blog-db.sh",
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 755,
+ content => template("blog/backup_blog-db.sh")
+ }
+
+ cron { root:
+ user => root,
+ day => '*',
+ hour => '23',
+ minute => '42',
+ command => "/usr/local/bin/backup_blog-db.sh",
+ require => [File["backup_blog-db"]],
+ }
+ }
}
diff --git a/modules/blog/templates/backup_blog-db.sh b/modules/blog/templates/backup_blog-db.sh
new file mode 100755
index 00000000..57ebec86
--- /dev/null
+++ b/modules/blog/templates/backup_blog-db.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Initialization
+PATH_TO_FILE=${PATH_TO_FILE:-/var/lib/blog/backup/db}
+for locale in de el en es fr it nl pl pt ro ru tr
+do
+ /usb/bin/mysqldump --add-drop-table -h localhost blog_$locale | bzip2 -c > $PATH_TO_FILE/mageia_$locale.bak.sql.bz2
+done
diff --git a/modules/blog/templates/blogs_vhosts.conf b/modules/blog/templates/blogs_vhosts.conf
index b4a91396..48b6d9ad 100644
--- a/modules/blog/templates/blogs_vhosts.conf
+++ b/modules/blog/templates/blogs_vhosts.conf
@@ -5,3 +5,12 @@
Options FollowSymlinks
Options +Indexes
</Directory>
+# Add a permanent redirection for 'pt' as it was 'pt-br' before
+# Add a permanent redirection for '/*' as it's now '/en/' for english blog
+# TO BE REMOVE in May, 1st (?)
+<IfModule mod_alias.c>
+ Redirect permanent /pt-br/ /pt/
+ Redirect permanent /wp-content/uploads/ /en/wp-content/uploads/
+ Redirect permanent /wp-includes/images/ /en/wp-includes/images/
+ RedirectMatch permanent ^/?$ /en/
+</IfModule>