2018-03-28 15:42:12 +00:00
|
|
|
{% set counter = {'dns': 2,'ip': 1,} %}{% macro increment(dct, key, inc=1)%}{% if dct.update({key: dct[key] + inc}) %} {% endif %}{% endmacro %}[req]
|
2016-11-09 10:44:41 +00:00
|
|
|
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'] %}
|
2018-03-28 15:42:12 +00:00
|
|
|
DNS.{{ counter["dns"] }} = {{ host }}{{ increment(counter, 'dns') }}
|
2016-11-09 10:44:41 +00:00
|
|
|
{% endfor %}
|
2018-03-28 15:42:12 +00:00
|
|
|
{% if apiserver_loadbalancer_domain_name is defined %}
|
|
|
|
DNS.{{ counter["dns"] }} = {{ apiserver_loadbalancer_domain_name }}{{ increment(counter, 'dns') }}
|
2016-11-09 10:44:41 +00:00
|
|
|
{% endif %}
|
2018-01-30 13:26:58 +00:00
|
|
|
{% for etcd_alt_name in etcd_cert_alt_names %}
|
2018-03-28 15:42:12 +00:00
|
|
|
DNS.{{ counter["dns"] }} = {{ etcd_alt_name }}{{ increment(counter, 'dns') }}
|
2018-01-30 13:26:58 +00:00
|
|
|
{% endfor %}
|
2016-11-09 10:44:41 +00:00
|
|
|
{% for host in groups['etcd'] %}
|
2018-03-28 15:42:12 +00:00
|
|
|
{% if hostvars[host]['access_ip'] is defined %}
|
|
|
|
IP.{{ counter["ip"] }} = {{ hostvars[host]['access_ip'] }}{{ increment(counter, 'ip') }}
|
|
|
|
{% endif %}
|
2019-03-05 11:04:39 +00:00
|
|
|
IP.{{ counter["ip"] }} = {{ hostvars[host]['ip'] | default(fallback_ips[host]) }}{{ increment(counter, 'ip') }}
|
2016-11-09 10:44:41 +00:00
|
|
|
{% endfor %}
|
2018-08-31 12:34:13 +00:00
|
|
|
{% for cert_alt_ip in etcd_cert_alt_ips %}
|
|
|
|
IP.{{ counter["ip"] }} = {{ cert_alt_ip }}{{ increment(counter, 'ip') }}
|
|
|
|
{% endfor %}
|
2018-03-28 15:42:12 +00:00
|
|
|
IP.{{ counter["ip"] }} = 127.0.0.1
|