From e26819ed9c00aaa426b85a800fe6d45f2119caec Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Sun, 8 Apr 2018 21:56:46 -0700 Subject: [PATCH] Add the bootstrap config for the CA --- agent/consul/config.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/agent/consul/config.go b/agent/consul/config.go index 6966b5628..df4e55e42 100644 --- a/agent/consul/config.go +++ b/agent/consul/config.go @@ -8,6 +8,7 @@ import ( "time" "github.com/hashicorp/consul/agent/consul/autopilot" + "github.com/hashicorp/consul/agent/structs" "github.com/hashicorp/consul/lib" "github.com/hashicorp/consul/tlsutil" "github.com/hashicorp/consul/types" @@ -346,6 +347,10 @@ type Config struct { // autopilot tasks, such as promoting eligible non-voters and removing // dead servers. AutopilotInterval time.Duration + + // CAConfig is used to apply the initial Connect CA configuration when + // bootstrapping. + CAConfig *structs.CAConfiguration } // CheckProtocolVersion validates the protocol version. @@ -427,6 +432,15 @@ func DefaultConfig() *Config { ServerHealthInterval: 2 * time.Second, AutopilotInterval: 10 * time.Second, + + CAConfig: &structs.CAConfiguration{ + Provider: "consul", + Config: map[string]interface{}{ + "PrivateKey": "", + "RootCert": "", + "RotationPeriod": 90 * 24 * time.Hour, + }, + }, } // Increase our reap interval to 3 days instead of 24h.