New version of salt-formula from Saltstack
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

16 lines
765B

  1. #!/bin/sh
  2. {%- from "salt/map.jinja" import master with context %}
  3. {%- if master.initial_data is defined %}
  4. mkdir -p /etc/salt/pki.bak
  5. mv /etc/salt/pki/* /etc/salt/pki.bak
  6. 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
  7. RC=$?
  8. if [ $RC -gt 0 ]; then
  9. mv /etc/salt/pki.bak/* /etc/salt/pki
  10. fi
  11. {%- if master.pillar.engine == 'reclass' or (master.pillar.engine == 'composite' and master.pillar.reclass is defined) %}
  12. 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
  13. {%- endif %}
  14. {%- endif %}