backup_ca_certificates.yml 373 B

123456789101112
  1. ---
  2. - name: Determine if CA certificate directory exists
  3. stat:
  4. path: "{{ etcd_ca_dir }}"
  5. register: etcd_ca_certs_dir_stat
  6. - name: Backup generated etcd certificates
  7. command: >
  8. tar -czf {{ etcd_conf_dir }}/etcd-ca-certificate-backup-{{ ansible_date_time.epoch }}.tgz
  9. {{ etcd_ca_dir }}
  10. args:
  11. warn: no
  12. when: etcd_ca_certs_dir_stat.stat.exists | bool