From 3fd26401e000ba619fcd3f21b006dcb0b4647850 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 5 Apr 2017 14:22:48 +0100 Subject: [PATCH] Add CLI commands to reconfigure and upgrade the overcloud services kayobe overcloud service reconfigure maps to kolla's reconfigure command. kayobe overcloud service upgrade maps to kolla's upgrade command. --- kayobe/cli/commands.py | 32 ++++++++++++++++++++++++++++++++ setup.py | 2 ++ 2 files changed, 34 insertions(+) diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index 394fece4d..6bea3e6f3 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -378,6 +378,38 @@ class OvercloudServiceDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, Command): self.run_kayobe_playbooks(parsed_args, playbooks) +class OvercloudServiceReconfigure(KollaAnsibleMixin, KayobeAnsibleMixin, + Command): + """Reconfigure the overcloud services.""" + + def take_action(self, parsed_args): + self.app.LOG.debug("Reconfiguring overcloud services") + playbooks = _build_playbook_list("kolla-ansible", "kolla-openstack", + "swift-setup") + self.run_kayobe_playbooks(parsed_args, playbooks) + for command in ["prechecks", "reconfigure"]: + self.run_kolla_ansible_overcloud(parsed_args, command) + # FIXME: Fudge to work around incorrect configuration path. + extra_vars = {"node_config_directory": parsed_args.kolla_config_path} + self.run_kolla_ansible_overcloud(parsed_args, "post-deploy", + extra_vars=extra_vars) + # Create an environment file for accessing the public API as the admin + # user. + playbooks = _build_playbook_list("public-openrc") + self.run_kayobe_playbooks(parsed_args, playbooks) + + +class OvercloudServiceUpgrade(KollaAnsibleMixin, KayobeAnsibleMixin, Command): + """Upgrade the overcloud services.""" + + def take_action(self, parsed_args): + self.app.LOG.debug("Upgrading overcloud services") + playbooks = _build_playbook_list("kolla-ansible", "kolla-openstack") + self.run_kayobe_playbooks(parsed_args, playbooks) + for command in ["prechecks", "upgrade"]: + self.run_kolla_ansible_overcloud(parsed_args, command) + + class OvercloudContainerImagePull(KollaAnsibleMixin, Command): """Pull the overcloud container images from a registry.""" diff --git a/setup.py b/setup.py index a5c4c2ca4..5a078b0df 100644 --- a/setup.py +++ b/setup.py @@ -50,6 +50,8 @@ setup( 'overcloud_post_configure = kayobe.cli.commands:OvercloudPostConfigure', 'overcloud_provision = kayobe.cli.commands:OvercloudProvision', 'overcloud_service_deploy = kayobe.cli.commands:OvercloudServiceDeploy', + 'overcloud_service_reconfigure = kayobe.cli.commands:OvercloudServiceReconfigure', + 'overcloud_service_upgrade = kayobe.cli.commands:OvercloudServiceUpgrade', 'physical_network_configure = kayobe.cli.commands:PhysicalNetworkConfigure', 'playbook_run = kayobe.cli.commands:PlaybookRun', 'seed_container_image_build = kayobe.cli.commands:SeedContainerImageBuild',