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.

39 lines
1.2 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 and apiserver_loadbalancer_domain_name is defined %}
  26. {% set idx = groups['etcd'] | length | int + 2 %}
  27. DNS.{{ idx | string }} = {{ apiserver_loadbalancer_domain_name }}
  28. {% endif %}
  29. {% for host in groups['etcd'] %}
  30. IP.{{ 2 * loop.index - 1 }} = {{ hostvars[host]['access_ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}
  31. IP.{{ 2 * loop.index }} = {{ hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}
  32. {% endfor %}
  33. {% set idx = groups['etcd'] | length | int * 2 + 1 %}
  34. IP.{{ idx }} = 127.0.0.1