Add command to run config validation

Adds the command ``kayobe overcloud service configuration validate`` to
run the ``oslo-config-validator`` on all hosts via Kolla-Ansible. The
output directory of the results is specified with the flag
``--output-dir``.

Change-Id: I5d5d16eeabe69e8659e33722165928df096b3559
This commit is contained in:
Matt Crees 2023-01-06 15:58:25 +00:00
parent ebd5799fd4
commit 4af5fd172b
4 changed files with 45 additions and 2 deletions

View File

@ -218,6 +218,17 @@ specified directory, with one subdirectory per container. This command may be
followed by ``kayobe overcloud service configuration save`` to gather the
generated configuration to the Ansible control host.
Validating Overcloud Service Configuration
==========================================
Issues can arise in Kolla Ansible deployments when incorrect options are used
in configuration files. This is because OpenStack services will ignore unknown
options. It is also important to keep on top of deprecated options that may be
removed in the future. The ``oslo-config-validator`` can be used to check both
of these. This command will run it on the OpenStack control plane services::
(kayobe) $ kayobe overcloud service configuration validate --output-dir /path/to/save/results
Performing Database Backups
===========================

View File

@ -1320,7 +1320,7 @@ class OvercloudServiceConfigurationGenerate(KayobeAnsibleMixin,
def get_parser(self, prog_name):
parser = super(OvercloudServiceConfigurationGenerate,
self).get_parser(prog_name)
group = parser.add_argument_group("Service Configuration")
group = parser.add_argument_group("Service Configuration Generate")
group.add_argument("--node-config-dir", required=True,
help="the directory to store the config files on "
"the remote node (required)")
@ -1346,6 +1346,30 @@ class OvercloudServiceConfigurationGenerate(KayobeAnsibleMixin,
extra_vars=extra_vars)
class OvercloudServiceConfigurationValidate(KayobeAnsibleMixin,
KollaAnsibleMixin, VaultMixin,
Command):
"""Runs oslo config validator on the OpenStack control plane services."""
def get_parser(self, prog_name):
parser = super(OvercloudServiceConfigurationValidate,
self).get_parser(prog_name)
group = parser.add_argument_group("Service Configuration Validate")
group.add_argument("--output-dir", required=True,
help="the directory to store the results of running"
"the config validator (required)")
return parser
def take_action(self, parsed_args):
self.app.LOG.debug("Validating overcloud service configuration")
extra_vars = {}
if parsed_args.output_dir:
extra_vars[
"service_config_validate_output_dir"] = parsed_args.output_dir
self.run_kolla_ansible_overcloud(parsed_args, "validate-config",
extra_vars=extra_vars)
class OvercloudServiceConfigurationSave(KayobeAnsibleMixin, VaultMixin,
Command):
"""Gather and save the overcloud service configuration files.
@ -1359,7 +1383,7 @@ class OvercloudServiceConfigurationSave(KayobeAnsibleMixin, VaultMixin,
def get_parser(self, prog_name):
parser = super(OvercloudServiceConfigurationSave, self).get_parser(
prog_name)
group = parser.add_argument_group("Service configuration")
group = parser.add_argument_group("Service Configuration Save")
group.add_argument("--exclude",
help="optional comma-separated list of patterns "
"matching filenames to exclude")

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds the command ``kayobe overcloud service configuration validate`` to run
the ``oslo-config-validator`` on all hosts via Kolla-Ansible.

View File

@ -70,6 +70,7 @@ kayobe.cli=
overcloud_provision = kayobe.cli.commands:OvercloudProvision
overcloud_service_configuration_save = kayobe.cli.commands:OvercloudServiceConfigurationSave
overcloud_service_configuration_generate = kayobe.cli.commands:OvercloudServiceConfigurationGenerate
overcloud_service_configuration_validate = kayobe.cli.commands:OvercloudServiceConfigurationValidate
overcloud_service_deploy = kayobe.cli.commands:OvercloudServiceDeploy
overcloud_service_deploy_containers = kayobe.cli.commands:OvercloudServiceDeployContainers
overcloud_service_destroy = kayobe.cli.commands:OvercloudServiceDestroy
@ -168,6 +169,8 @@ kayobe.cli.overcloud_service_configuration_save =
hooks = kayobe.cli.commands:HookDispatcher
kayobe.cli.overcloud_service_configuration_generate =
hooks = kayobe.cli.commands:HookDispatcher
kayobe.cli.overcloud_service_configuration_validate =
hooks = kayobe.cli.commands:HookDispatcher
kayobe.cli.overcloud_service_deploy =
hooks = kayobe.cli.commands:HookDispatcher
kayobe.cli.overcloud_service_deploy_containers =