From 96f5917011e38f3df4e9b3973c7f5923be675e8d Mon Sep 17 00:00:00 2001 From: absolutelightning Date: Mon, 19 Jun 2023 21:07:34 +0530 Subject: [PATCH] some fixes for windows ca pem file --- templates/consul-client-agent.tftpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/consul-client-agent.tftpl b/templates/consul-client-agent.tftpl index 10da868..7162684 100644 --- a/templates/consul-client-agent.tftpl +++ b/templates/consul-client-agent.tftpl @@ -14,6 +14,7 @@ $CONSUL_CERTS_PATH="C:\${consul_folder}\${consul_certs_folder}" $ENVOY_PATH="C:\${envoy_folder}" $HASHICUPS_PATH="C:\${hashicups_folder}" $FAKESERVICE_PATH="C:\Fake" +$CA_PEM_FILE_PATH="C:\${consul_folder}\${consul_config_folder}\ca.pem" New-Item -type directory $CONSUL_PATH New-Item -type directory $CONSUL_CONFIG_PATH @@ -61,7 +62,7 @@ $tokenConfig = @{"agent"="${consul_token}"} $grpcConfig = @{"grpc"= 8502} $consulJsonConfig | Add-Member -Type NoteProperty -Name 'ports' -value $grpcConfig $consulJsonConfig.Acl | Add-Member -Type NoteProperty -Name 'tokens' -value $tokenConfig -$consulJsonConfig.ca_file = $CONSUL_CONFIG_PATH + "\ca.pem" +$consulJsonConfig.Tls.Defaults | Add-Member -Type NoteProperty -Name 'ca_file' -value $CA_PEM_FILE_PATH -Force $consulJsonConfig | ConvertTo-Json -Depth 6 | Set-Content consul.json $serviceJson = Get-Content .\service.json -Raw | ConvertFrom-Json