parametrize backup server side dir
PROD-18191
Change-Id: I15c2cc66f0c0010408863b46c0dccf84730f31d9
diff --git a/README.rst b/README.rst
index cd9abc6..116548b 100644
--- a/README.rst
+++ b/README.rst
@@ -225,6 +225,7 @@
backup: true
initial_data:
engine: backupninja
+ home_dir: remote-backup-home-dir
source: backup-node-host
host: original-salt-master-id
diff --git a/salt/files/restore_master.sh b/salt/files/restore_master.sh
index 1407020..92b94f2 100644
--- a/salt/files/restore_master.sh
+++ b/salt/files/restore_master.sh
@@ -4,8 +4,8 @@
{%- if master.initial_data is defined %}
mkdir -p /etc/salt/pki.bak
mv /etc/salt/pki/* /etc/salt/pki.bak
-scp -r backupninja@{{ master.initial_data.source }}:/srv/backupninja/{{ master.initial_data.host }}/etc/salt/pki/pki.0/* /etc/salt/pki
+scp -r backupninja@{{ master.initial_data.source }}:{{ master.initial_data.get('home_dir', '/srv/backupninja') }}/{{ master.initial_data.host }}/etc/salt/pki/pki.0/* /etc/salt/pki
{%- if master.pillar.engine == 'reclass' or (master.pillar.engine == 'composite' and master.pillar.reclass is defined) %}
-scp -r backupninja@{{ master.initial_data.source }}:/srv/backupninja/{{ master.initial_data.host }}/srv/salt/reclass/reclass.0/* /srv/salt/reclass
+scp -r backupninja@{{ master.initial_data.source }}:{{ master.initial_data.get('home_dir', '/srv/backupninja') }}/{{ master.initial_data.host }}/srv/salt/reclass/reclass.0/* /srv/salt/reclass
{%- endif %}
{%- endif %}