summaryrefslogtreecommitdiffstats
path: root/roles/openshift_master_certificates
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@redhat.com>2017-01-16 11:41:56 -0500
committerAndrew Butcher <abutcher@redhat.com>2017-01-16 16:16:01 -0500
commitb30c15b83937e45b7b3356ef4cb6e93c9203ff68 (patch)
treec1bd2399f23de71ae18498cb966804b24f95c68c /roles/openshift_master_certificates
parentb01d19b5a37330c4b3fea5f1f54efd6ef0e207c0 (diff)
downloadopenshift-b30c15b83937e45b7b3356ef4cb6e93c9203ff68.tar.gz
openshift-b30c15b83937e45b7b3356ef4cb6e93c9203ff68.tar.bz2
openshift-b30c15b83937e45b7b3356ef4cb6e93c9203ff68.tar.xz
openshift-b30c15b83937e45b7b3356ef4cb6e93c9203ff68.zip
Create individual serving cert and loopback kubeconfig for additional masters.
Deprecates use of 'create-master-certs' for generating master serving certificate and loopback kubeconfig in order to reference the first master's CA serial file.
Diffstat (limited to 'roles/openshift_master_certificates')
-rw-r--r--roles/openshift_master_certificates/tasks/main.yml44
1 files changed, 28 insertions, 16 deletions
diff --git a/roles/openshift_master_certificates/tasks/main.yml b/roles/openshift_master_certificates/tasks/main.yml
index e9b7de330..118a04d8f 100644
--- a/roles/openshift_master_certificates/tasks/main.yml
+++ b/roles/openshift_master_certificates/tasks/main.yml
@@ -39,31 +39,43 @@
when: master_certs_missing | bool and inventory_hostname != openshift_ca_host
delegate_to: "{{ openshift_ca_host }}"
-- file:
- src: "{{ openshift_master_config_dir }}/{{ item }}"
- dest: "{{ openshift_master_generated_config_dir }}/{{ item }}"
- state: hard
- with_items:
- - ca.crt
- - ca.key
- - ca.serial.txt
- when: master_certs_missing | bool and inventory_hostname != openshift_ca_host
- delegate_to: "{{ openshift_ca_host }}"
-
-- name: Create the master certificates if they do not already exist
+- name: Create the master server certificate
command: >
- {{ openshift.common.client_binary }} adm create-master-certs
+ {{ openshift.common.client_binary }} adm ca create-server-cert
{% for named_ca_certificate in openshift.master.named_certificates | default([]) | oo_collect('cafile') %}
--certificate-authority {{ named_ca_certificate }}
{% endfor %}
--hostnames={{ openshift.common.all_hostnames | join(',') }}
- --master={{ openshift.master.api_url }}
- --public-master={{ openshift.master.public_api_url }}
- --cert-dir={{ openshift_master_generated_config_dir }}
+ --cert={{ openshift_master_generated_config_dir }}/master.server.crt
+ --key={{ openshift_master_generated_config_dir }}/master.server.key
+ --signer-cert={{ openshift_ca_cert }}
+ --signer-key={{ openshift_ca_key }}
+ --signer-serial={{ openshift_ca_serial }}
--overwrite=false
when: master_certs_missing | bool and inventory_hostname != openshift_ca_host
delegate_to: "{{ openshift_ca_host }}"
+- name: Generate the master client config
+ command: >
+ {{ openshift.common.client_binary }} adm create-api-client-config
+ {% for named_ca_certificate in openshift.master.named_certificates | default([]) | oo_collect('cafile') %}
+ --certificate-authority {{ named_ca_certificate }}
+ {% endfor %}
+ --certificate-authority={{ openshift_ca_cert }}
+ --client-dir={{ openshift_master_generated_config_dir }}
+ --groups=system:masters,system:openshift-master
+ --master={{ openshift.master.api_url }}
+ --public-master={{ openshift.master.public_api_url }}
+ --signer-cert={{ openshift_ca_cert }}
+ --signer-key={{ openshift_ca_key }}
+ --signer-serial={{ openshift_ca_serial }}
+ --user=system:openshift-master
+ --basename=openshift-master
+ args:
+ creates: "{{ openshift_master_generated_config_dir }}/openshift-master.kubeconfig"
+ when: master_certs_missing | bool and inventory_hostname != openshift_ca_host
+ delegate_to: "{{ openshift_ca_host }}"
+
- file:
src: "{{ openshift_master_config_dir }}/{{ item }}"
dest: "{{ openshift_master_generated_config_dir }}/{{ item }}"