Skip to content

Commit

Permalink
Story #12096: Fix service registration when colocalisation with consu…
Browse files Browse the repository at this point in the history
…l server. (#1582)

Consul server is not bind to localhost.
  • Loading branch information
GiooDev authored Dec 13, 2023
1 parent 00d2c7b commit adcb149
Show file tree
Hide file tree
Showing 23 changed files with 22 additions and 33 deletions.
18 changes: 1 addition & 17 deletions deployment/environments/hosts-ui.example
Original file line number Diff line number Diff line change
Expand Up @@ -189,31 +189,15 @@ hosts_vitamui_consul_server
################################################################################
[vitam:children]
hosts_consul_server
hosts_ingest_external
hosts_access_external
hosts_functionnal_admin
hosts_security_internal
hosts_elasticsearch_log

# MINIMUM REQUIRED IN ZONE VITAM
[hosts_consul_server]
# EDIT: Mandatory unless [hosts_vitamui_consul_server] is defined
# Choose between [hosts_consul_server] and [hosts_vitamui_consul_server]. If both defined [hosts_vitamui_consul_server] will be used by default.

[hosts_ingest_external]
# EDIT: Mandatory

[hosts_access_external]
# EDIT: Mandatory

[hosts_functionnal_admin]
# EDIT: Mandatory

[hosts_security_internal]
# EDIT: Mandatory

[hosts_elasticsearch_log]
# EDIT: Mandatory
# EDIT: Mandatory when [hosts_vitamui_logstash] is defined


################################################################################
Expand Down
16 changes: 0 additions & 16 deletions deployment/environments/hosts.local
Original file line number Diff line number Diff line change
Expand Up @@ -206,31 +206,15 @@ hosts_vitamui_consul_server
################################################################################
[vitam:children]
hosts_consul_server
hosts_ingest_external
hosts_access_external
hosts_elasticsearch_log
hosts_functionnal_admin
hosts_security_internal

# MINIMUM REQUIRED IN ZONE VITAM
[hosts_consul_server]
localhost

[hosts_ingest_external]
localhost

[hosts_access_external]
localhost

[hosts_elasticsearch_log]
localhost

[hosts_functionnal_admin]
localhost

[hosts_security_internal]
localhost

################################################################################
# ZONE TOOLS
################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ spring:
cloud:
consul:
enabled: true
host: {{ hostvars[inventory_hostname][consul.network] if (inventory_hostname in groups['hosts_vitamui_consul_server'] or inventory_hostname in groups['hosts_consul_server']) else 'localhost' }}
discovery:
preferIpAddress: true
tags: {{ consul_tags }}
Expand Down

0 comments on commit adcb149

Please sign in to comment.