Add restore scipts
This commit is contained in:
parent
0efbffb808
commit
9917613fc4
3 changed files with 32 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
||||||
|
#!/usr/bin/expect
|
||||||
|
set nodename [lindex $argv 0]
|
||||||
|
set enc_password [lindex $argv 1]
|
||||||
|
|
||||||
|
spawn dsmc restore /opt/backup-test/ /opt/restore-target/ -asnodename=$nodename -subdir=yes
|
||||||
|
expect -exact "Action [1,2,3,A] : "
|
||||||
|
send -- "$enc_password\r"
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
nodename=$1
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
restoretarget=/opt/restore-target
|
||||||
|
rm /opt/restore-target/*
|
||||||
|
|
||||||
|
enc_password=$(eyaml decrypt -f /etc/hiera/data/local.eyaml --pkcs7-private-key=/etc/hiera/eyaml/private_key.pkcs7.pem --pkcs7-public-key=/etc/hiera/eyaml/public_certkey.pkcs7.pem | awk '/^baas2_restoretest_encryption_password: /{print $2}')
|
||||||
|
|
||||||
|
/opt/baas2/run-restore.expect $nodename $enc_password
|
|
@ -20,6 +20,20 @@ class net::baas2_restoretest(
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file { '/opt/baas2/run-restore.expect':
|
||||||
|
ensure => 'file',
|
||||||
|
mode => '0755',
|
||||||
|
owner => 'root',
|
||||||
|
content => file('net/baas2_restoretest/run-restore.expect')
|
||||||
|
}
|
||||||
|
|
||||||
|
file { '/opt/baas2/validate-backup-files':
|
||||||
|
ensure => 'file',
|
||||||
|
mode => '0755',
|
||||||
|
owner => 'root',
|
||||||
|
content => file('net/baas2_restoretest/validate-backup-files')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $node_type == 'backupnode' {
|
if $node_type == 'backupnode' {
|
||||||
|
|
Loading…
Add table
Reference in a new issue