Update to 2022-08-01 19:00

This commit is contained in:
Daniel Berteaud 2022-08-01 19:00:22 +02:00
parent d168e21fb8
commit 8179fd8b6b
3 changed files with 36 additions and 8 deletions

View File

@ -23,6 +23,9 @@ consul_base_conf:
log_level: INFO
bind_addr: 0.0.0.0
# Recursive DNS resolver to which non authoritative queries will be sent
recursors: "{{ ansible_dns.nameservers }}"
# Address that is advertised to the other nodes
advertise_addr: "{{ ansible_default_ipv4.address }}"
# You can also advertise the WAN addr
@ -34,6 +37,12 @@ consul_base_conf:
# Node name, which should be uniq in the region. Default is the hostname
# node_name: nomade-fr-zone-c
# Arbitrary metadata
# node_meta:
# instance_type: t2.medium
# env: staging
node_meta: {}
# 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=
@ -49,6 +58,9 @@ consul_base_conf:
performance:
raft_multiplier: 1
telemetry:
prometheus_retention_time: 1h
consul_extra_conf: {}
consul_host_conf: {}
consul_conf: "{{ consul_base_conf | combine(consul_extra_conf, recursive=True) | combine(consul_host_conf, recursive=True) }}"

View File

@ -7,6 +7,6 @@
owner: root
group: "{{ consul_user }}"
mode: 0640
#validate: consul validate %s
validate: consul validate -config-format=hcl %s
notify: restart consul
tags: consul

View File

@ -13,6 +13,12 @@ datacenter = "{{ consul_conf.datacenter }}"
node_name = {{ consul_conf.node_name }}
{% endif %}
node_meta {
{% for meta in consul_conf.node_meta.keys() | list %}
{{ meta }} = "{{ consul_conf.node_meta[meta] }}"
{% endfor %}
}
ports {
{% for service in consul_services.keys() | list %}
{% if service not in ['sidecar', 'expose'] and consul_services[service].port is defined %}
@ -24,19 +30,19 @@ ports {
{% endfor %}
}
bootstrap_expect = {{ consul_conf.bootstrap_expect }}
performance {
raft_multiplier = {{ consul_conf.performance.raft_multiplier }}
}
retry_join = [
{% for server in consul_servers %}
"{{ server }}",
{% endfor %}
]
server = {{ consul_conf.server | ternary('true', 'false') }}
{% if consul_conf.server %}
server = true
bootstrap_expect = {{ consul_conf.bootstrap_expect }}
performance {
raft_multiplier = {{ consul_conf.performance.raft_multiplier }}
}
{% endif %}
{% if consul_conf.encrypt is defined %}
encrypt = "{{ consul_conf.encrypt }}"
@ -45,3 +51,13 @@ encrypt = "{{ consul_conf.encrypt }}"
ui_config {
enabled = {{ consul_conf.ui_config.enabled | ternary('true', 'false') }}
}
recursors = [
{% for dns in consul_conf.recursors %}
"{{ dns }}",
{% endfor %}
]
telemetry {
prometheus_retention_time = "{{ consul_conf.telemetry.prometheus_retention_time }}"
}