backup_generated_certificates.yml 503 B

12345678910111213141516
  1. ---
  2. - name: Determine if generated etcd certificates exist
  3. stat:
  4. path: "{{ etcd_conf_dir }}/generated_certs"
  5. get_checksum: false
  6. get_attributes: false
  7. get_mime: false
  8. register: etcd_generated_certs_dir_stat
  9. - name: Backup generated etcd certificates
  10. command: >
  11. tar -czf {{ etcd_conf_dir }}/etcd-generated-certificate-backup-{{ ansible_date_time.epoch }}.tgz
  12. {{ etcd_conf_dir }}/generated_certs
  13. args:
  14. warn: no
  15. when: etcd_generated_certs_dir_stat.stat.exists | bool