--- # 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) consul_base_services: dns: port: "{{ consul_conf.ports.dns | default(8600) }}" src_ip: [] proto: [tcp,udp] http: port: "{{ consul_conf.ports.http | default(8500) }}" src_ip: [] proto: [tcp] https: port: "{{ consul_conf.ports.https | default(8501) }}" src_ip: [] proto: [tcp] grpc: port: "{{ consul_conf.ports.groc | default(8502) }}" src_ip: [] proto: [tcp] serf_lan: port: "{{ consul_conf.ports.serf_lan | default(8301) }}" src_ip: [] proto: [tcp,udp] serf_wan: port: "{{ consul_conf.ports.serf_wan | default(8302) }}" src_ip: [] proto: [tcp,udp] server: port: "{{ consul_conf.ports.server | default(8300) }}" src_ip: [] proto: [tcp] sidecar_proxy: port: "{{ consul_conf.ports.sidecar_proxy_min | default(21000) }}:{{ consul_conf.ports.sidecar_proxy_max | default(21255) }}" src_ip: [] proto: [tcp] consul_extra_services: {} consul_services: "{{ consul_base_services | combine(consul_extra_services, recursive=True) }}" # 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) }}" performance: raft_multiplier: 1 # 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) }}"