summaryrefslogtreecommitdiffstats
path: root/playbooks/openshift-master/private/certificates-backup.yml
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2017-12-04 09:51:44 -0800
committerGitHub <noreply@github.com>2017-12-04 09:51:44 -0800
commit411235245c903be9e12790444f2f4cfae5ca7ef0 (patch)
treec04a172511053513a2c15ced0b703336b0afaa28 /playbooks/openshift-master/private/certificates-backup.yml
parent2eecb801febfefcc54ce01189e82e2c89027f519 (diff)
parent0b80aca421a89b10a8254f03e1339d1ddfbd54f1 (diff)
downloadopenshift-411235245c903be9e12790444f2f4cfae5ca7ef0.tar.gz
openshift-411235245c903be9e12790444f2f4cfae5ca7ef0.tar.bz2
openshift-411235245c903be9e12790444f2f4cfae5ca7ef0.tar.xz
openshift-411235245c903be9e12790444f2f4cfae5ca7ef0.zip
Merge pull request #6324 from mtnbikenc/consolidate-redeploy-certificates
Automatic merge from submit-queue. Playbook Consolidation - Redeploy Certificates This PR moves the certificate redeploy playbooks out of {byo,common}/openshift-cluster and into their respective component areas. - playbooks/openshift-etcd (redeploy-certificates.yml, redeploy-ca.yml) - playbooks/openshift-master (redeploy-certificates.yml, redeploy-openshift-ca.yml) - playbooks/openshift-node (redeploy-certificates.yml) - playbooks/openshift-hosted (redeploy-registry-certificates.yml, redeploy-router-certificates.yml) playbooks/byo/openshift-cluster/redeploy-certificates.yml was moved to playbooks/redeploy-certificates.yml Trello: https://trello.com/c/zCz6RIHM/578-2-playbook-consolidation-openshift-cluster-redeploy-certificates
Diffstat (limited to 'playbooks/openshift-master/private/certificates-backup.yml')
-rw-r--r--playbooks/openshift-master/private/certificates-backup.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/playbooks/openshift-master/private/certificates-backup.yml b/playbooks/openshift-master/private/certificates-backup.yml
new file mode 100644
index 000000000..4dbc041b0
--- /dev/null
+++ b/playbooks/openshift-master/private/certificates-backup.yml
@@ -0,0 +1,38 @@
+---
+- name: Backup and remove master cerftificates
+ hosts: oo_masters_to_config
+ any_errors_fatal: true
+ vars:
+ openshift_ca_host: "{{ groups.oo_first_master.0 }}"
+ openshift_master_count: "{{ openshift.master.master_count | default(groups.oo_masters | length) }}"
+ pre_tasks:
+ - stat:
+ path: "{{ openshift.common.config_base }}/generated-configs"
+ register: openshift_generated_configs_dir_stat
+ - name: Backup generated certificate and config directories
+ command: >
+ tar -czvf /etc/origin/master-node-cert-config-backup-{{ ansible_date_time.epoch }}.tgz
+ {{ openshift.common.config_base }}/generated-configs
+ {{ openshift.common.config_base }}/master
+ when: openshift_generated_configs_dir_stat.stat.exists
+ delegate_to: "{{ openshift_ca_host }}"
+ run_once: true
+ - name: Remove generated certificate directories
+ file:
+ path: "{{ item }}"
+ state: absent
+ with_items:
+ - "{{ openshift.common.config_base }}/generated-configs"
+ - name: Remove generated certificates
+ file:
+ path: "{{ openshift.common.config_base }}/master/{{ item }}"
+ state: absent
+ with_items:
+ - "{{ hostvars[inventory_hostname] | certificates_to_synchronize(include_keys=false, include_ca=false) }}"
+ - "etcd.server.crt"
+ - "etcd.server.key"
+ - "master.server.crt"
+ - "master.server.key"
+ - "openshift-master.crt"
+ - "openshift-master.key"
+ - "openshift-master.kubeconfig"