slapruner: Add support for script to run after resiliency import (one script per partition)

parent 669e28e8
......@@ -52,7 +52,7 @@ mode = 0644
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/runner-import.sh.jinja2
download-only = true
md5sum = bd2df050fd40c3f31f29cc9daebebfe3
md5sum = f7594f522e7350d5394c7ae3c058154c
filename = runner-import.sh.jinja2
mode = 0644
......
......@@ -31,12 +31,24 @@ restore_element {{ directory['backup'] }}/etc/ {{ directory['etc'] }} config.js
cp -r {{ directory['backup'] }}/etc/.??* {{ directory['etc'] }};
{{ curl_binary }} --insecure -vg6L --max-time 5 {{ backend_url }}/isSRReady;
if [ -e $srv_directory/runner-import-restore ]; then
touch $srv_directory/runner-import-restore
chmod +x $srv_directory/runner-import-restore
fi
# Invoke arbitrary script to perform specific restoration
# procedure.
runner_import_restore=$srv_directory/runner-import-restore
if [ ! -e "$runner_import_restore" ]; then
touch $runner_import_restore
chmod +x $runner_import_restore
fi
echo "Running $runner_import_restore script..."
$srv_directory/runner-import-restore
# Invoke defined scripts for each partition inside of slaprunner
for partition in $srv_directory/runner/instance/slappart*/
do
script=$partition/srv/runner-import-restore
if [ -e "$script" ]; then
echo "Running $script script..."
$script
fi
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment