etcd.conf.j2 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. {% macro initial_cluster() -%}
  2. {% for host in etcd_peers | default([]) -%}
  3. {% if loop.last -%}
  4. {{ hostvars[host].etcd_hostname }}={{ etcd_peer_url_scheme }}://{{ hostvars[host].etcd_ip }}:{{ etcd_peer_port }}
  5. {%- else -%}
  6. {{ hostvars[host].etcd_hostname }}={{ etcd_peer_url_scheme }}://{{ hostvars[host].etcd_ip }}:{{ etcd_peer_port }},
  7. {%- endif -%}
  8. {% endfor -%}
  9. {% endmacro -%}
  10. ETCD_NAME={{ etcd_hostname }}
  11. ETCD_LISTEN_PEER_URLS={{ etcd_listen_peer_urls }}
  12. ETCD_DATA_DIR={{ etcd_data_dir }}
  13. #ETCD_WAL_DIR=
  14. #ETCD_SNAPSHOT_COUNT=10000
  15. ETCD_HEARTBEAT_INTERVAL=500
  16. ETCD_ELECTION_TIMEOUT=2500
  17. ETCD_LISTEN_CLIENT_URLS={{ etcd_listen_client_urls }}
  18. #ETCD_MAX_SNAPSHOTS=5
  19. #ETCD_MAX_WALS=5
  20. #ETCD_CORS=
  21. #[cluster]
  22. ETCD_INITIAL_ADVERTISE_PEER_URLS={{ etcd_initial_advertise_peer_urls }}
  23. {% if etcd_is_thirdparty %}
  24. # TODO: This needs to be altered to support the correct etcd instances
  25. ETCD_INITIAL_CLUSTER={{ etcd_hostname}}={{ etcd_initial_advertise_peer_urls }}
  26. ETCD_INITIAL_CLUSTER_STATE={{ etcd_initial_cluster_state }}
  27. ETCD_INITIAL_CLUSTER_TOKEN=thirdparty-etcd-cluster-1
  28. {% else %}
  29. {% if etcd_initial_cluster is defined and etcd_initial_cluster %}
  30. ETCD_INITIAL_CLUSTER={{ etcd_initial_cluster }}
  31. {% else %}
  32. ETCD_INITIAL_CLUSTER={{ initial_cluster() }}
  33. {% endif %}
  34. ETCD_INITIAL_CLUSTER_STATE={{ etcd_initial_cluster_state }}
  35. ETCD_INITIAL_CLUSTER_TOKEN={{ etcd_initial_cluster_token }}
  36. #ETCD_DISCOVERY=
  37. #ETCD_DISCOVERY_SRV=
  38. #ETCD_DISCOVERY_FALLBACK=proxy
  39. #ETCD_DISCOVERY_PROXY=
  40. {% endif %}
  41. ETCD_ADVERTISE_CLIENT_URLS={{ etcd_advertise_client_urls }}
  42. #ETCD_STRICT_RECONFIG_CHECK=false
  43. #ETCD_AUTO_COMPACTION_RETENTION=0
  44. #ETCD_ENABLE_V2=true
  45. ETCD_QUOTA_BACKEND_BYTES={{ etcd_quota_backend_bytes }}
  46. #[proxy]
  47. #ETCD_PROXY=off
  48. #ETCD_PROXY_FAILURE_WAIT=5000
  49. #ETCD_PROXY_REFRESH_INTERVAL=30000
  50. #ETCD_PROXY_DIAL_TIMEOUT=1000
  51. #ETCD_PROXY_WRITE_TIMEOUT=5000
  52. #ETCD_PROXY_READ_TIMEOUT=0
  53. #[security]
  54. {% if etcd_url_scheme == 'https' -%}
  55. ETCD_TRUSTED_CA_FILE={{ etcd_ca_file }}
  56. ETCD_CLIENT_CERT_AUTH=true
  57. ETCD_CERT_FILE={{ etcd_cert_file }}
  58. ETCD_KEY_FILE={{ etcd_key_file }}
  59. {% endif -%}
  60. #ETCD_AUTO_TLS=false
  61. {% if etcd_peer_url_scheme == 'https' -%}
  62. ETCD_PEER_TRUSTED_CA_FILE={{ etcd_peer_ca_file }}
  63. ETCD_PEER_CLIENT_CERT_AUTH=true
  64. ETCD_PEER_CERT_FILE={{ etcd_peer_cert_file }}
  65. ETCD_PEER_KEY_FILE={{ etcd_peer_key_file }}
  66. {% endif -%}
  67. #ETCD_PEER_AUTO_TLS=false
  68. #[logging]
  69. ETCD_DEBUG={{ etcd_debug | default(false) | bool | string }}
  70. {% if etcd_log_package_levels is defined %}
  71. ETCD_LOG_PACKAGE_LEVELS={{ etcd_log_package_levels }}
  72. {% endif %}
  73. #[profiling]
  74. #ETCD_ENABLE_PPROF=false
  75. #ETCD_METRICS=basic
  76. #
  77. #[auth]
  78. #ETCD_AUTH_TOKEN=simple