feat(proxy): add consul agents to proxies and register haproxy service to consul is consul is enabled

This commit is contained in:
Bertrand Lanson 2024-03-22 01:00:04 +01:00
parent 267a23317f
commit 5204358a20
4 changed files with 16 additions and 1 deletions

3
docs/consul_clusters.md Normal file
View File

@ -0,0 +1,3 @@
# Deploying a Consul cluster
This documentation explains each steps necessary to successfully deploy a Consul cluster using the ednz_cloud.hashistack ansible collection.

View File

@ -55,6 +55,7 @@ vault_service_registration_configuration:
consul: consul:
address: "127.0.0.1:8500" address: "127.0.0.1:8500"
scheme: "http" scheme: "http"
token: ""
######### #########
# plugins # plugins

View File

@ -7,3 +7,14 @@
- name: "Include ednz_cloud.deploy_keepalived" - name: "Include ednz_cloud.deploy_keepalived"
ansible.builtin.include_role: ansible.builtin.include_role:
name: ednz_cloud.deploy_keepalived name: ednz_cloud.deploy_keepalived
- name: "Register haproxy services in consul"
when: enable_consul | bool
block:
- name: "Register haproxy services in consul"
community.general.consul:
token: "{{ _consul_cluster_config.root_token.secret_id }}"
service_name: haproxy
service_port: 80
interval: 20s
http: http://localhost:9000/health