Merge "Add option to enable keystone in undercloud"

This commit is contained in:
Zuul 2021-09-19 23:46:36 +00:00 committed by Gerrit Code Review
commit 898a960a99
6 changed files with 30 additions and 2 deletions

View File

@ -0,0 +1,8 @@
---
features:
- Undercloud is now deployed without keystone and deploys standalone
openstack services with http_basic authentication. A new option
'enable_keystone' has been added to enable keystone in the undercloud
if required.
upgrade:
- keystone service would not be deployed by default in the undercloud.

View File

@ -55,7 +55,8 @@ class StandaloneConfig(BaseConfig):
ironic_inspector=False, mistral=False,
nova=False, novajoin=False, swift=False,
telemetry=False, validations=False,
zaqar=False, neutron=False, heat=False):
zaqar=False, neutron=False, heat=False,
keystone=True):
_opts = [
# service enablement
cfg.BoolOpt('enable_cinder',
@ -116,6 +117,9 @@ class StandaloneConfig(BaseConfig):
cfg.BoolOpt('enable_heat',
default=heat,
help=_('Whether to enable the heat service.')),
cfg.BoolOpt('enable_keystone',
default=keystone,
help=_('Whether to enable the keystone service.')),
]
return self.sort_opts(_opts)

View File

@ -71,6 +71,7 @@ _deprecated_opt_inspection_iprange = [cfg.DeprecatedOpt(
class UndercloudConfig(StandaloneConfig):
def get_undercloud_service_opts(self):
return super(UndercloudConfig, self).get_enable_service_opts(
keystone=False,
cinder=False,
heat=False,
ironic=True,

View File

@ -50,6 +50,7 @@ class TestStandaloneConfig(base.TestCase):
'enable_heat',
'enable_ironic',
'enable_ironic_inspector',
'enable_keystone',
'enable_mistral',
'enable_neutron',
'enable_nova',
@ -60,12 +61,18 @@ class TestStandaloneConfig(base.TestCase):
'enable_zaqar']
self.assertEqual(expected, [x.name for x in ret])
for x in ret:
self.assertEqual(x.default, False, "%s config not False" % x.name)
if x.name == 'enable_keystone':
self.assertEqual(x.default, True,
"%s config not True" % x.name)
else:
self.assertEqual(x.default, False,
"%s config not False" % x.name)
def test_get_service_opts_enabled(self):
ret = self.config.get_enable_service_opts(cinder=True,
frr=True,
heat=True,
keystone=True,
ironic=True,
ironic_inspector=True,
mistral=True,
@ -81,6 +88,7 @@ class TestStandaloneConfig(base.TestCase):
'enable_heat',
'enable_ironic',
'enable_ironic_inspector',
'enable_keystone',
'enable_mistral',
'enable_neutron',
'enable_nova',
@ -108,6 +116,7 @@ class TestStandaloneConfig(base.TestCase):
'enable_heat',
'enable_ironic',
'enable_ironic_inspector',
'enable_keystone',
'enable_mistral',
'enable_neutron',
'enable_nova',

View File

@ -99,6 +99,7 @@ class TestUndercloudConfig(base.TestCase):
'enable_heat',
'enable_ironic',
'enable_ironic_inspector',
'enable_keystone',
'enable_mistral',
'enable_neutron',
'enable_node_discovery',
@ -169,6 +170,7 @@ class TestUndercloudConfig(base.TestCase):
ret = self.config.get_undercloud_service_opts()
expected = {'enable_cinder': False,
'enable_frr': False,
'enable_keystone': False,
'enable_heat': False,
'enable_ironic': True,
'enable_ironic_inspector': True,

View File

@ -589,6 +589,10 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=True,
deploy_args += ['-e', os.path.join(
tht_templates, "environments/services/masquerade-networks.yaml")]
if CONF.get('enable_keystone'):
deploy_args += ['-e', os.path.join(
tht_templates, "environments/undercloud-enable-keystone.yaml")]
if CONF.get('enable_ironic'):
deploy_args += ['-e', os.path.join(
tht_templates, "environments/services/ironic.yaml")]