certificates-backup.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. register: openshift_generated_configs_dir_stat
  11. - name: Backup generated certificate and config directories
  12. command: >
  13. tar -czvf /etc/origin/master-node-cert-config-backup-{{ ansible_date_time.epoch }}.tgz
  14. {{ openshift.common.config_base }}/generated-configs
  15. {{ openshift.common.config_base }}/master
  16. when: openshift_generated_configs_dir_stat.stat.exists
  17. delegate_to: "{{ openshift_ca_host }}"
  18. run_once: true
  19. - name: Remove generated certificate directories
  20. file:
  21. path: "{{ item }}"
  22. state: absent
  23. with_items:
  24. - "{{ openshift.common.config_base }}/generated-configs"
  25. - name: Remove generated certificates
  26. file:
  27. path: "{{ openshift.common.config_base }}/master/{{ item }}"
  28. state: absent
  29. with_items:
  30. - admin.crt
  31. - admin.key
  32. - admin.kubeconfig
  33. - aggregator-front-proxy.crt
  34. - aggregator-front-proxy.key
  35. - aggregator-front-proxy.kubeconfig
  36. - front-proxy-ca.crt
  37. - front-proxy-ca.key
  38. - master.kubelet-client.crt
  39. - master.kubelet-client.key
  40. - master.proxy-client.crt
  41. - master.proxy-client.key
  42. - service-signer.crt
  43. - service-signer.key
  44. - etcd.server.crt
  45. - etcd.server.key
  46. - master.server.crt
  47. - master.server.key
  48. - openshift-master.crt
  49. - openshift-master.key
  50. - openshift-master.kubeconfig