Add creation of service symlinks to restore script
Fixes: PROD-32352
Change-Id: Ifcd495d1d716b4a7e7ca80f92fb321e27f648d6c
diff --git a/salt/files/restore_master.sh b/salt/files/restore_master.sh
index 2629f42..364b0ee 100644
--- a/salt/files/restore_master.sh
+++ b/salt/files/restore_master.sh
@@ -12,5 +12,10 @@
fi
{%- if master.pillar.engine == 'reclass' or (master.pillar.engine == 'composite' and master.pillar.reclass is defined) %}
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
+[ ! -d /srv/salt/reclass/classes/service ] && mkdir -p /srv/salt/reclass/classes/service
+FORMULA_PATH=${FORMULA_PATH:-/usr/share/salt-formulas}
+for formula in ${FORMULA_PATH}/reclass/service/*; do
+ ln -s $formula /srv/salt/reclass/classes/service/`basename ${formula}`
+done
{%- endif %}
{%- endif %}