ansible-roles/roles/consul/defaults/main.yml

90 lines
2.9 KiB
YAML
Raw Normal View History

2022-07-21 01:00:17 +02:00
---
# Version of consul to deploy
consul_version: 1.12.3
# URL from where the consul archive will be downloaded
consul_archive_url: https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_linux_amd64.zip
# Expected sha256 of the archive
consul_archive_sha256: 620a47cfba34bdf918b4c3238d22f6318b29403888cfd927c6006a4ac1b1c9f6
# user account under which consul will run (will be created if needed)
consul_user: consul
# Root directory where consul will be installed
consul_root_dir: /opt/consul
# List of consul servers name or IP
consul_servers: []
# List of services exposed by consul, the ports they use, and the list of IP
# for which the service is accessible at the firewall level (if iptables_manage == True)
2022-07-23 13:00:16 +02:00
consul_base_services:
2022-07-21 01:00:17 +02:00
dns:
2022-07-23 13:00:16 +02:00
port: "{{ consul_conf.ports.dns | default(8600) }}"
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp,udp]
2022-07-23 13:00:16 +02:00
http:
port: "{{ consul_conf.ports.http | default(8500) }}"
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp]
2022-07-23 13:00:16 +02:00
https:
port: "{{ consul_conf.ports.https | default(8501) }}"
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp]
2022-07-23 13:00:16 +02:00
grpc:
port: "{{ consul_conf.ports.groc | default(8502) }}"
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp]
2022-07-23 13:00:16 +02:00
serf_lan:
port: "{{ consul_conf.ports.serf_lan | default(8301) }}"
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp,udp]
2022-07-23 13:00:16 +02:00
serf_wan:
port: "{{ consul_conf.ports.serf_wan | default(8302) }}"
2022-07-21 01:00:17 +02:00
src_ip: []
2022-07-23 13:00:16 +02:00
proto: [tcp,udp]
server:
port: "{{ consul_conf.ports.server | default(8300) }}"
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp]
sidecar_proxy:
2022-07-23 13:00:16 +02:00
port: "{{ consul_conf.ports.sidecar_proxy_min | default(21000) }}:{{ consul_conf.ports.sidecar_proxy_max | default(21255) }}"
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp]
2022-07-23 13:00:16 +02:00
consul_extra_services: {}
consul_services: "{{ consul_base_services | combine(consul_extra_services, recursive=True) }}"
2022-07-21 01:00:17 +02:00
# Consul configuration (which will be converted to JSON)
# The configuration is splited in a base conf and an extra conf, so you can override part of the config easily
consul_base_conf:
node_name: "{{ inventory_hostname }}"
data_dir: "{{ consul_root_dir }}/data"
client_addr: 0.0.0.0
log_level: INFO
bind_addr: 0.0.0.0
advertise_addr: "{{ ansible_default_ipv4.address }}"
retry_join: "{{ consul_servers }}"
bootstrap_expect: "{{ consul_servers | length }}"
server: "{{ (inventory_hostname in consul_servers) | ternary(True, False) }}"
ui_config:
enabled: "{{ (inventory_hostname in consul_servers) | ternary(True, False) }}"
connect:
enabled: "{{ (inventory_hostname in consul_servers) | ternary(True, False) }}"
2022-07-23 14:00:15 +02:00
performance:
raft_multiplier: 1
2022-07-21 01:00:17 +02:00
# For example
# consul_extra_conf:
# datacenter: my-dc
# domain: dev.example.org
# encrypt: WSnGbK30nI6K/xk9w+AAtk0Y3RMXKoAlsj4VEICqi0I=
# ui_config:
# enabled: False
consul_extra_conf: {}
# Host conf is just another level of configuration override
consul_host_conf: {}
# Merge all the conf
consul_conf: "{{ consul_base_conf | combine(consul_extra_conf, recursive=True) | combine(consul_host_conf, recursive=True) }}"