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

189 lines
5.6 KiB
YAML
Raw Normal View History

2022-07-21 01:00:17 +02:00
---
# 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
2022-09-04 14:00:17 +02:00
# List of Unix group which will be consul admins
# Used for example to grant access to cli cert with ACL
consul_admin_groups: "{{ system_admin_groups | default([]) }}"
2023-07-26 19:00:19 +02:00
# An optional CONSUL_HTTP_TOKEN to use to take a snapshot of raft logs during pre-backup
# for example:
# consul_backup_token: 1677848e-1fcd-b24a-6fb0-56b503d75651
# or a more advanced use
# # consul_backup_token: $(VAULT_TOKEN=$(cat /run/vault_agent/vault.token) vault read -field=secret_id consul/creds/admin ttl=1m)
2022-08-11 11:00:17 +02:00
2022-07-21 01:00:17 +02:00
# List of consul servers name or IP
consul_servers: []
2022-08-01 16:00:18 +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:
client_addr: 0.0.0.0
log_level: INFO
bind_addr: 0.0.0.0
2022-08-01 19:00:22 +02:00
# Recursive DNS resolver to which non authoritative queries will be sent
recursors: "{{ ansible_dns.nameservers }}"
2022-08-09 16:00:17 +02:00
# Domain handled by consul, on which services will be published
# All queries in this domain are assumed to be handled by Consul and will not be recursively resolved
# domain: consul.
# An optional alternative domain
# alt_domain: consul.example.org.
2022-08-01 16:00:18 +02:00
# Address that is advertised to the other nodes
advertise_addr: "{{ ansible_default_ipv4.address }}"
# You can also advertise the WAN addr
# advertise_addr_wan: x.x.x.x
# You can define the datacenter in which this agent is running. The default value is dc1
# datacenter: dc1
2022-08-11 11:00:17 +02:00
# When several DC are used, one must be set as the primary. This DC will be used as the
# source for ACL replication
# primary_datacenter: dc1
2022-08-01 16:00:18 +02:00
# Node name, which should be uniq in the region. Default is the hostname
2022-08-09 17:00:15 +02:00
# node_name: consule-fr-zone-c
2022-08-01 16:00:18 +02:00
2022-08-01 19:00:22 +02:00
# Arbitrary metadata
# node_meta:
# instance_type: t2.medium
# env: staging
node_meta: {}
2022-08-01 16:00:18 +02:00
# Optional encryption key for the gossip protocol
# You can generate one with cinsul keygen. The key should be the same on all the members
# encrypt: WSnGbK30nI6K/xk9w+AAtk0Y3RMXKoAlsj4VEICqi0I=
retry_join: "{{ consul_servers }}"
bootstrap_expect: "{{ consul_servers | length }}"
2022-08-09 17:00:15 +02:00
server: "{{ (inventory_hostname in consul_servers | map('regex_replace', ':\\d+$', '')) | ternary(True, False) }}"
2022-08-01 16:00:18 +02:00
ui_config:
2022-08-09 17:00:15 +02:00
enabled: "{{ (inventory_hostname in consul_servers | map('regex_replace', ':\\d+$', '')) | ternary(True, False) }}"
2022-08-01 16:00:18 +02:00
performance:
raft_multiplier: 1
2022-08-01 19:00:22 +02:00
telemetry:
prometheus_retention_time: 1h
2022-08-01 22:00:30 +02:00
connect:
2022-08-11 12:00:16 +02:00
# Enable consul service mesh on servers
2022-08-09 17:00:15 +02:00
enabled: "{{ (inventory_hostname in consul_servers | map('regex_replace', ':\\d+$', '')) | ternary(True, False) }}"
2023-07-05 19:00:07 +02:00
# ca_provider: vault
ca_config:
# address: https://active.vault.service.consul:8200
root_pki_path: pki/root
intermediate_pki_path: pki/connect
#auth_method:
# approle:
# role_id: XXXX
# secret_id: YYYY
2022-08-01 22:00:30 +02:00
2022-08-11 12:00:16 +02:00
acl:
enabled: False
# The default_policy is also used for intentions in the service mesh
default_policy: deny
2022-09-06 18:00:22 +02:00
enable_token_persistence: True
# You can set tokens used by the agent
# tokens:
# default: ab47bc38-d97f-19af-93a5-17b528d154c9
# agent: 5459979a-3f23-8b1f-ff8a-2478856e9216
tokens: {}
2022-08-11 12:00:16 +02:00
2022-09-04 14:00:17 +02:00
tls:
# No TLS will be stup unless this is set to True
enabled: False
# Default TLS settings
defaults:
ca_file: "{{ consul_root_dir }}/tls/ca.crt"
cert_file: "{{ consul_root_dir }}/tls/consul.crt"
key_file: "{{ consul_root_dir }}/tls/consul.key"
verify_incoming: True
verify_outgoing: True
# TLS settings for interal RPC
internal_rpc:
verify_server_hostname: True
2022-08-01 16:00:18 +02:00
consul_extra_conf: {}
consul_host_conf: {}
consul_conf: "{{ consul_base_conf | combine(consul_extra_conf, recursive=True) | combine(consul_host_conf, recursive=True) }}"
# For example
# consul_extra_conf:
# datacenter: my-dc
# domain: dev.example.org
# encrypt: WSnGbK30nI6K/xk9w+AAtk0Y3RMXKoAlsj4VEICqi0I=
# ui_config:
# enabled: False
2022-07-21 01:00:17 +02:00
# 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-08-01 16:00:18 +02:00
port: 8600
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp,udp]
2022-07-23 13:00:16 +02:00
http:
2022-08-01 16:00:18 +02:00
port: 8500
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp]
2022-07-23 13:00:16 +02:00
https:
2022-08-01 16:00:18 +02:00
port: 8501
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp]
2022-07-23 13:00:16 +02:00
grpc:
2022-08-01 16:00:18 +02:00
port: 8502
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp]
2022-11-16 14:00:10 +01:00
grpc_tls:
port: 8503
src_ip: []
proto: [tcp]
2022-07-23 13:00:16 +02:00
serf_lan:
2022-08-01 16:00:18 +02:00
port: 8301
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp,udp]
2022-07-23 13:00:16 +02:00
serf_wan:
2022-08-01 16:00:18 +02:00
port: 8302
2022-07-21 01:00:17 +02:00
src_ip: []
2022-07-23 13:00:16 +02:00
proto: [tcp,udp]
server:
2022-08-01 16:00:18 +02:00
port: 8300
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp]
2022-08-01 16:00:18 +02:00
sidecar:
port: 21000:21255
src_ip: []
proto: [tcp]
expose:
port: 21500:21755
2022-07-21 01:00:17 +02:00
src_ip: []
proto: [tcp]
2022-07-23 13:00:16 +02:00
consul_extra_services: {}
2022-08-01 16:00:18 +02:00
consul_host_services: {}
consul_services: "{{ consul_base_services | combine(consul_extra_services, recursive=True) | combine(consul_host_services, recursive=True) }}"
2023-04-11 15:00:42 +02:00
# Services can be manually registered on the catalog
# consul_extra_catalog_services:
# service-id:
# name: my-service
# address: 10.1.0.26
# port: 8080
consul_base_catalog_services: {}
consul_extra_catalog_services: {}
consul_host_catalog_services: {}
consul_catalog_services: "{{ consul_base_catalog_services | combine(consul_extra_catalog_services, recursive=True) | combine(consul_host_catalog_services, recursive=True) }}"
2024-01-10 10:00:38 +01:00
# Control memory of the service
consul_memory_high: 1024M
consul_memory_max: 1200M