Make pubkey unique
This commit is contained in:
parent
36d3361397
commit
fd3074d31c
|
@ -6,7 +6,7 @@ class wmdeit_backup(
|
||||||
$backup_dir = "/srv/backup",
|
$backup_dir = "/srv/backup",
|
||||||
$backup_key_file = "/root/.ssh/backup_key",
|
$backup_key_file = "/root/.ssh/backup_key",
|
||||||
$backup_key,
|
$backup_key,
|
||||||
$mnt_server = undef
|
$mnt_server = undef,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
@ -62,19 +62,19 @@ define wmdeit_backup::scpbackup (
|
||||||
|
|
||||||
$bname = $title
|
$bname = $title
|
||||||
$backup_key_file = $wmdeit_backup::backup_key_file
|
$backup_key_file = $wmdeit_backup::backup_key_file
|
||||||
$backup_pub_key_file = "/tmp/backup_pub.pem"
|
$backup_pub_key_file = "/tmp/backup_pub-$title.pem"
|
||||||
$privkey = "/root/${title}_privkey"
|
$privkey = "/root/${title}_privkey"
|
||||||
$backup_dir = $wmdeit_backup::backup_dir
|
$backup_dir = $wmdeit_backup::backup_dir
|
||||||
$shellscript = "$backup_dir/backup-scp-$title.sh"
|
$shellscript = "$backup_dir/backup-scp-$title.sh"
|
||||||
|
|
||||||
$tdir = "$backup_dir/$dir/daily.0"
|
$tdir = "$backup_dir/$dir/daily.0"
|
||||||
|
|
||||||
exec {"pubkey":
|
exec {"pubkey$title":
|
||||||
command => "/usr/bin/openssl rsa -in $backup_key_file -pubout -out $backup_pub_key_file",
|
command => "/usr/bin/openssl rsa -in $backup_key_file -pubout -out $backup_pub_key_file",
|
||||||
}
|
}
|
||||||
|
|
||||||
file {"$shellscript":
|
file {"$shellscript":
|
||||||
require => Exec["pubkey"],
|
require => Exec["pubkey$title"],
|
||||||
mode => "700",
|
mode => "700",
|
||||||
ensure => file,
|
ensure => file,
|
||||||
content => "#!/bin/sh
|
content => "#!/bin/sh
|
||||||
|
@ -140,6 +140,7 @@ define wmdeit_backup::backup(
|
||||||
$retain_monthly = 0,
|
$retain_monthly = 0,
|
||||||
$daily_hour = 3,
|
$daily_hour = 3,
|
||||||
$daily_minute = 0,
|
$daily_minute = 0,
|
||||||
|
$backupuser = 'root',
|
||||||
|
|
||||||
) {
|
) {
|
||||||
$bname = $title
|
$bname = $title
|
||||||
|
@ -208,7 +209,7 @@ define wmdeit_backup::backup(
|
||||||
|
|
||||||
|
|
||||||
$bdirs = join ($dirs.map | String $dir| {
|
$bdirs = join ($dirs.map | String $dir| {
|
||||||
"backup root@$server:$dir\t$local_dir\n"
|
"backup $backupuser@$server:$dir\t$local_dir\n"
|
||||||
},"")
|
},"")
|
||||||
|
|
||||||
file {"$backup_dir/$bname.conf":
|
file {"$backup_dir/$bname.conf":
|
||||||
|
@ -235,3 +236,6 @@ $bdirs
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue