You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.4 KiB

  1. [req]
  2. req_extensions = v3_req
  3. distinguished_name = req_distinguished_name
  4. [req_distinguished_name]
  5. [ v3_req ]
  6. basicConstraints = CA:FALSE
  7. keyUsage = nonRepudiation, digitalSignature, keyEncipherment
  8. subjectAltName = @alt_names
  9. [ ssl_client ]
  10. extendedKeyUsage = clientAuth, serverAuth
  11. basicConstraints = CA:FALSE
  12. subjectKeyIdentifier=hash
  13. authorityKeyIdentifier=keyid,issuer
  14. subjectAltName = @alt_names
  15. [ v3_ca ]
  16. basicConstraints = CA:TRUE
  17. keyUsage = nonRepudiation, digitalSignature, keyEncipherment
  18. subjectAltName = @alt_names
  19. authorityKeyIdentifier=keyid:always,issuer
  20. [alt_names]
  21. DNS.1 = localhost
  22. {% for host in groups['etcd'] %}
  23. DNS.{{ 1 + loop.index }} = {{ host }}
  24. {% endfor %}
  25. {% if loadbalancer_apiserver is defined %}
  26. {% set idx = groups['etcd'] | length | int + 2 %}
  27. DNS.{{ idx | string }} = {{ apiserver_loadbalancer_domain_name }}
  28. {% endif %}
  29. {% set idx = groups['etcd'] | length | int + 3 %}
  30. {% for etcd_alt_name in etcd_cert_alt_names %}
  31. DNS.{{ idx + 1 + loop.index }} = {{ etcd_alt_name }}
  32. {% endfor %}
  33. {% for host in groups['etcd'] %}
  34. IP.{{ 2 * loop.index - 1 }} = {{ hostvars[host]['access_ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}
  35. IP.{{ 2 * loop.index }} = {{ hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}
  36. {% endfor %}
  37. {% set idx = groups['etcd'] | length | int * 2 + 1 %}
  38. IP.{{ idx }} = 127.0.0.1