2016-11-09 10:44:41 +00:00
|
|
|
[req]
|
|
|
|
req_extensions = v3_req
|
|
|
|
distinguished_name = req_distinguished_name
|
|
|
|
|
|
|
|
[req_distinguished_name]
|
|
|
|
|
|
|
|
[ v3_req ]
|
|
|
|
basicConstraints = CA:FALSE
|
|
|
|
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
|
|
|
subjectAltName = @alt_names
|
|
|
|
|
|
|
|
[ ssl_client ]
|
|
|
|
extendedKeyUsage = clientAuth, serverAuth
|
|
|
|
basicConstraints = CA:FALSE
|
|
|
|
subjectKeyIdentifier=hash
|
|
|
|
authorityKeyIdentifier=keyid,issuer
|
|
|
|
subjectAltName = @alt_names
|
|
|
|
|
|
|
|
[ v3_ca ]
|
|
|
|
basicConstraints = CA:TRUE
|
|
|
|
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
|
|
|
|
subjectAltName = @alt_names
|
|
|
|
authorityKeyIdentifier=keyid:always,issuer
|
|
|
|
|
|
|
|
[alt_names]
|
|
|
|
DNS.1 = localhost
|
|
|
|
{% for host in groups['etcd'] %}
|
|
|
|
DNS.{{ 1 + loop.index }} = {{ host }}
|
|
|
|
{% endfor %}
|
2017-11-23 16:15:48 +00:00
|
|
|
{% if loadbalancer_apiserver is defined %}
|
2017-02-27 11:01:09 +00:00
|
|
|
{% set idx = groups['etcd'] | length | int + 2 %}
|
2016-11-09 10:44:41 +00:00
|
|
|
DNS.{{ idx | string }} = {{ apiserver_loadbalancer_domain_name }}
|
|
|
|
{% endif %}
|
2018-01-09 11:37:34 +00:00
|
|
|
{% set idx = groups['etcd'] | length | int + 3 %}
|
2018-01-30 13:26:58 +00:00
|
|
|
{% for etcd_alt_name in etcd_cert_alt_names %}
|
2018-01-09 11:37:34 +00:00
|
|
|
DNS.{{ idx + 1 + loop.index }} = {{ etcd_alt_name }}
|
2018-01-30 13:26:58 +00:00
|
|
|
{% endfor %}
|
2016-11-09 10:44:41 +00:00
|
|
|
{% for host in groups['etcd'] %}
|
|
|
|
IP.{{ 2 * loop.index - 1 }} = {{ hostvars[host]['access_ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}
|
|
|
|
IP.{{ 2 * loop.index }} = {{ hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}
|
|
|
|
{% endfor %}
|
|
|
|
{% set idx = groups['etcd'] | length | int * 2 + 1 %}
|
|
|
|
IP.{{ idx }} = 127.0.0.1
|