etcd.conf.j2 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. {% macro initial_cluster() -%}
  2. {% for host in groups[etcd_peers_group] -%}
  3. {% if loop.last -%}
  4. {{ host }}={{ etcd_peer_url_scheme }}://{{ etcd_host_int_map[host].interface.ipv4.address }}:{{ etcd_peer_port }}
  5. {%- else -%}
  6. {{ host }}={{ etcd_peer_url_scheme }}://{{ etcd_host_int_map[host].interface.ipv4.address }}:{{ etcd_peer_port }},
  7. {%- endif -%}
  8. {% endfor -%}
  9. {% endmacro -%}
  10. {% if groups[etcd_peers_group] and groups[etcd_peers_group] | length > 1 %}
  11. ETCD_NAME={{ inventory_hostname }}
  12. ETCD_LISTEN_PEER_URLS={{ etcd_listen_peer_urls }}
  13. {% else %}
  14. ETCD_NAME=default
  15. {% endif %}
  16. ETCD_DATA_DIR={{ etcd_data_dir }}
  17. #ETCD_SNAPSHOT_COUNTER=10000
  18. ETCD_HEARTBEAT_INTERVAL=500
  19. ETCD_ELECTION_TIMEOUT=2500
  20. ETCD_LISTEN_CLIENT_URLS={{ etcd_listen_client_urls }}
  21. #ETCD_MAX_SNAPSHOTS=5
  22. #ETCD_MAX_WALS=5
  23. #ETCD_CORS=
  24. {% if groups[etcd_peers_group] and groups[etcd_peers_group] | length > 1 %}
  25. #[cluster]
  26. ETCD_INITIAL_ADVERTISE_PEER_URLS={{ etcd_initial_advertise_peer_urls }}
  27. ETCD_INITIAL_CLUSTER={{ initial_cluster() }}
  28. ETCD_INITIAL_CLUSTER_STATE={{ etcd_initial_cluster_state }}
  29. ETCD_INITIAL_CLUSTER_TOKEN={{ etcd_initial_cluster_token }}
  30. #ETCD_DISCOVERY=
  31. #ETCD_DISCOVERY_SRV=
  32. #ETCD_DISCOVERY_FALLBACK=proxy
  33. #ETCD_DISCOVERY_PROXY=
  34. {% endif %}
  35. ETCD_ADVERTISE_CLIENT_URLS={{ etcd_advertise_client_urls }}
  36. #[proxy]
  37. #ETCD_PROXY=off
  38. #[security]
  39. {% if etcd_url_scheme == 'https' -%}
  40. ETCD_CA_FILE={{ etcd_ca_file }}
  41. ETCD_CERT_FILE={{ etcd_cert_file }}
  42. ETCD_KEY_FILE={{ etcd_key_file }}
  43. {% endif -%}
  44. {% if etcd_peer_url_scheme == 'https' -%}
  45. ETCD_PEER_CA_FILE={{ etcd_peer_ca_file }}
  46. ETCD_PEER_CERT_FILE={{ etcd_peer_cert_file }}
  47. ETCD_PEER_KEY_FILE={{ etcd_peer_key_file }}
  48. {% endif -%}