Explorar el Código

keep pki files on restore failure

PROD-20712

Change-Id: I5f498e3a21cc3c78c313c7d3a72ecb303e7c4f61
pull/73/head
Jiri Broulik hace 6 años
padre
commit
d42281e680
Se han modificado 2 ficheros con 8 adiciones y 0 borrados
  1. +4
    -0
      salt/files/restore_master.sh
  2. +4
    -0
      salt/files/restore_minion.sh

+ 4
- 0
salt/files/restore_master.sh Ver fichero

@@ -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 Ver fichero

@@ -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 %}

Cargando…
Cancelar
Guardar