certificates-backup.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ---
  2. - name: Backup and remove master cerftificates
  3. hosts: oo_masters_to_config
  4. any_errors_fatal: true
  5. roles:
  6. - openshift_facts
  7. pre_tasks:
  8. - stat:
  9. path: "{{ openshift.common.config_base }}/generated-configs"
  10. get_checksum: false
  11. get_attributes: false
  12. get_mime: false
  13. register: openshift_generated_configs_dir_stat
  14. - name: Backup generated certificate and config directories
  15. command: >
  16. tar -czvf /etc/origin/master-node-cert-config-backup-{{ ansible_date_time.epoch }}.tgz
  17. {{ openshift.common.config_base }}/generated-configs
  18. {{ openshift.common.config_base }}/master
  19. when: openshift_generated_configs_dir_stat.stat.exists
  20. delegate_to: "{{ openshift_ca_host }}"
  21. run_once: true
  22. - name: Remove generated certificate directories
  23. file:
  24. path: "{{ item }}"
  25. state: absent
  26. with_items:
  27. - "{{ openshift.common.config_base }}/generated-configs"
  28. - name: Remove generated certificates
  29. file:
  30. path: "{{ openshift.common.config_base }}/master/{{ item }}"
  31. state: absent
  32. with_items:
  33. - admin.crt
  34. - admin.key
  35. - admin.kubeconfig
  36. - aggregator-front-proxy.crt
  37. - aggregator-front-proxy.key
  38. - aggregator-front-proxy.kubeconfig
  39. - front-proxy-ca.crt
  40. - front-proxy-ca.key
  41. - master.kubelet-client.crt
  42. - master.kubelet-client.key
  43. - master.proxy-client.crt
  44. - master.proxy-client.key
  45. - service-signer.crt
  46. - service-signer.key
  47. - etcd.server.crt
  48. - etcd.server.key
  49. - master.server.crt
  50. - master.server.key
  51. - openshift-master.crt
  52. - openshift-master.key
  53. - openshift-master.kubeconfig