From bb64cf4455beb6156003644908923eddb797fdbb Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Fri, 29 Jan 2021 13:56:46 -0700 Subject: [PATCH] Add auth_token_lifetime to undercloud.conf The undercloud currently defines the auth token life time in the undercloud.yaml environment in tripleo-heat-templates. At certain scale, it makes sense to increase this so we should make it a top level configuration item. Change-Id: Ibf917826a2d6b2662215c58c9dd8ec8007e57881 (cherry picked from commit 438e53ad4e31ff88421e1b7070dbb9f097bcd359) --- ...th-token-expiration-configuration-6159d733f09e1b6e.yaml | 6 ++++++ tripleoclient/config/undercloud.py | 7 +++++++ tripleoclient/tests/config/test_config_undercloud.py | 2 ++ tripleoclient/v1/undercloud_config.py | 1 + 4 files changed, 16 insertions(+) create mode 100644 releasenotes/notes/undercloud-auth-token-expiration-configuration-6159d733f09e1b6e.yaml diff --git a/releasenotes/notes/undercloud-auth-token-expiration-configuration-6159d733f09e1b6e.yaml b/releasenotes/notes/undercloud-auth-token-expiration-configuration-6159d733f09e1b6e.yaml new file mode 100644 index 000000000..f5c21eefb --- /dev/null +++ b/releasenotes/notes/undercloud-auth-token-expiration-configuration-6159d733f09e1b6e.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Adds `auth_token_lifetime` to undercloud.conf with a default of 14400. This + configuration option exposes the keystone token expirataion as a top level + configuration since it may need to be increased to handle larger clouds. diff --git a/tripleoclient/config/undercloud.py b/tripleoclient/config/undercloud.py index 12fdb25c6..9eb48ac76 100644 --- a/tripleoclient/config/undercloud.py +++ b/tripleoclient/config/undercloud.py @@ -374,6 +374,13 @@ class UndercloudConfig(StandaloneConfig): help=(_('Ironic network interface implementation to ' 'use by default.')) ), + cfg.StrOpt('auth_token_lifetime', + default=14400, + help=(_( + 'Authentication token expiration time in ' + 'seconds. Note reducing this can have impacts on ' + 'long running undercloud processes.')) + ), ] return self.sort_opts(_base_opts + _opts) diff --git a/tripleoclient/tests/config/test_config_undercloud.py b/tripleoclient/tests/config/test_config_undercloud.py index 5ad322d1e..a3432d42e 100644 --- a/tripleoclient/tests/config/test_config_undercloud.py +++ b/tripleoclient/tests/config/test_config_undercloud.py @@ -26,6 +26,7 @@ class TestUndercloudConfig(base.TestCase): def test_get_base_opts(self): ret = self.config.get_base_opts() expected = ['additional_architectures', + 'auth_token_lifetime', 'certificate_generation_ca', 'clean_nodes', 'cleanup', @@ -84,6 +85,7 @@ class TestUndercloudConfig(base.TestCase): def test_get_opts(self): ret = self.config.get_opts() expected = ['additional_architectures', + 'auth_token_lifetime', 'certificate_generation_ca', 'clean_nodes', 'cleanup', diff --git a/tripleoclient/v1/undercloud_config.py b/tripleoclient/v1/undercloud_config.py index 365b27b6f..09ba82820 100644 --- a/tripleoclient/v1/undercloud_config.py +++ b/tripleoclient/v1/undercloud_config.py @@ -73,6 +73,7 @@ PARAMETER_MAPPING = { 'local_subnet': 'UndercloudCtlplaneLocalSubnet', 'enable_routed_networks': 'UndercloudEnableRoutedNetworks', 'local_interface': 'NeutronPublicInterface', + 'auth_token_lifetime': 'TokenExpiration', } SUBNET_PARAMETER_MAPPING = {