feat: enabling changing ip for consul client (#383)
- enable ability to set consul client bind/advertise ip Reviewed-on: #383
This commit is contained in:
parent
62aade77ff
commit
8f5d102945
@ -37,6 +37,7 @@ profiles::ssh::sign::principals:
|
|||||||
- "%{facts.networking.interfaces.enp3s0.ip}"
|
- "%{facts.networking.interfaces.enp3s0.ip}"
|
||||||
|
|
||||||
# configure consul service
|
# configure consul service
|
||||||
|
profiles::consul::client::host_addr: "%{hiera('networking_loopback0_ip')}"
|
||||||
consul::services:
|
consul::services:
|
||||||
incus:
|
incus:
|
||||||
service_name: 'incus'
|
service_name: 'incus'
|
||||||
|
|||||||
@ -11,6 +11,7 @@ class profiles::consul::client (
|
|||||||
Stdlib::Absolutepath $data_dir = '/opt/consul',
|
Stdlib::Absolutepath $data_dir = '/opt/consul',
|
||||||
Array[Hash] $node_rules = [],
|
Array[Hash] $node_rules = [],
|
||||||
Hash $ports = {},
|
Hash $ports = {},
|
||||||
|
Stdlib::IP::Address $host_addr = $facts['networking']['ip'],
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if $facts['enc_role'] != $members_role {
|
if $facts['enc_role'] != $members_role {
|
||||||
@ -42,8 +43,8 @@ class profiles::consul::client (
|
|||||||
'log_level' => 'INFO',
|
'log_level' => 'INFO',
|
||||||
'node_name' => $facts['networking']['fqdn'],
|
'node_name' => $facts['networking']['fqdn'],
|
||||||
'retry_join' => $servers_array,
|
'retry_join' => $servers_array,
|
||||||
'bind_addr' => $::facts['networking']['ip'],
|
'bind_addr' => $host_addr,
|
||||||
'advertise_addr' => $::facts['networking']['ip'],
|
'advertise_addr' => $host_addr,
|
||||||
'enable_script_checks' => true,
|
'enable_script_checks' => true,
|
||||||
'ports' => $ports,
|
'ports' => $ports,
|
||||||
'acl' => {
|
'acl' => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user