Sfoglia il codice sorgente

keep pki files on restore failure

PROD-20712

Change-Id: I5f498e3a21cc3c78c313c7d3a72ecb303e7c4f61
pull/73/head
Jiri Broulik 6 anni fa
parent
commit
d42281e680
2 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. +4
    -0
      salt/files/restore_master.sh
  2. +4
    -0
      salt/files/restore_minion.sh

+ 4
- 0
salt/files/restore_master.sh Vedi File

@@ -5,6 +5,10 @@
mkdir -p /etc/salt/pki.bak
mv /etc/salt/pki/* /etc/salt/pki.bak
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
RC=$?
if [ $RC -gt 0 ]; then
mv /etc/salt/pki.bak/* /etc/salt/pki
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
{%- endif %}

+ 4
- 0
salt/files/restore_minion.sh Vedi File

@@ -7,5 +7,9 @@ mkdir -p /etc/pki/pki_ca.bak
mkdir -p /etc/pki/ca
mv /etc/pki/ca/* /etc/pki/pki_ca.bak
scp -r backupninja@{{ minion.initial_data.source }}:{{ minion.initial_data.get('home_dir', '/srv/backupninja') }}/{{ minion.initial_data.host }}/etc/pki/ca/ca.0/* /etc/pki/ca
RC=$?
if [ $RC -gt 0 ]; then
mv /etc/pki/pki_ca.bak/* /etc/pki/ca
fi
{%- endif %}
{%- endif %}

Loading…
Annulla
Salva