From 474e48b4332bb70282249da57dc09fd16569d591 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Mon, 6 Mar 2017 14:46:17 +0000 Subject: [PATCH] Separate configuration of host OS from service deployment --- README.md | 18 +++++++--- ...rules.yml => seed-introspection-rules.yml} | 0 kayobe/cli/commands.py | 35 ++++++++++--------- setup.py | 6 ++-- 4 files changed, 36 insertions(+), 23 deletions(-) rename ansible/{bifrost-introspection-rules.yml => seed-introspection-rules.yml} (100%) diff --git a/README.md b/README.md index d350cd5e9..819b4f7b5 100644 --- a/README.md +++ b/README.md @@ -112,9 +112,13 @@ address of the VM. At this point the seed services need to be deployed on the seed VM. These services include Docker and the Kolla `bifrost-deploy` container. This command will also build the image to be used to deploy the overcloud nodes using Disk -Image Builder (DIB). To deploy the seed services: +Image Builder (DIB). To configure the seed host OS: - (kayobe-venv) $ kayobe seed deploy + (kayobe-venv) $ kayobe seed host configure + +To deploy the seed services in containers: + + (kayobe-venv) $ kayobe seed service deploy After this command has completed the seed services will be active. For SSH access to the seed VM, first determine the seed VM's IP address: @@ -143,10 +147,14 @@ the seed. An inventory of servers should be configured using the (kayobe-venv) $ kayobe overcloud provision -After this command has completed the overcloud nodes have should been -provisioned with an OS image. To deploy the overcloud services: +After this command has completed the overcloud nodes should have been +provisioned with an OS image. To configure the overcloud hosts' OS: - (kayobe-venv) $ kayobe overcloud deploy + (kayobe-venv) $ kayobe overcloud host configure + +To deploy the overcloud services in containers: + + (kayobe-venv) $ kayobe overcloud service deploy Once this command has completed the overcloud nodes should have OpenStack services running in Docker containers. Kolla writes out an environment file diff --git a/ansible/bifrost-introspection-rules.yml b/ansible/seed-introspection-rules.yml similarity index 100% rename from ansible/bifrost-introspection-rules.yml rename to ansible/seed-introspection-rules.yml diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index 9b2528f54..169a8dbbc 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -129,15 +129,11 @@ class SeedVMProvision(KollaAnsibleMixin, KayobeAnsibleMixin, Command): ansible.run_playbook(parsed_args, "ansible/seed-vm.yml") -class SeedDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, Command): - """Deploy the seed node services.""" +class SeedHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, Command): + """Configure the seed node host OS.""" def take_action(self, parsed_args): - self.app.LOG.debug("Deploying seed services") - self._configure_os(parsed_args) - self._deploy_bifrost(parsed_args) - - def _configure_os(self, parsed_args): + self.app.LOG.debug("Configuring seed host OS") ansible_user = ansible.config_dump(parsed_args, host="seed", var_name="kayobe_ansible_user") playbooks = ["ansible/%s.yml" % playbook for playbook in @@ -150,13 +146,19 @@ class SeedDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, Command): "kolla-host", "docker"] ansible.run_playbooks(parsed_args, playbooks, limit="seed") - def _deploy_bifrost(self, parsed_args): + +class SeedServiceDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, Command): + """Deploy the seed services.""" + + def take_action(self, parsed_args): + self.app.LOG.debug("Deploying seed services") ansible.run_playbook(parsed_args, "ansible/kolla-bifrost.yml") # FIXME: Do this via configuration. extra_vars = {"kolla_install_type": "source", "docker_namespace": "stackhpc"} kolla_ansible.run_seed(parsed_args, "deploy-bifrost", extra_vars=extra_vars) + ansible.run_playbook(parsed_args, "ansible/seed-introspection-rules.yml") class OvercloudProvision(KollaAnsibleMixin, KayobeAnsibleMixin, Command): @@ -179,15 +181,11 @@ class OvercloudProvision(KollaAnsibleMixin, KayobeAnsibleMixin, Command): kolla_ansible.run_seed(parsed_args, "deploy-servers") -class OvercloudDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, Command): - """Deploy the overcloud services.""" +class OvercloudHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, Command): + """Configure the overcloud host OS.""" def take_action(self, parsed_args): - self.app.LOG.debug("Deploying overcloud services") - self._configure_os(parsed_args) - self._deploy_services(parsed_args) - - def _configure_os(self, parsed_args): + self.app.LOG.debug("Configuring overcloud host OS") ansible_user = ansible.config_dump(parsed_args, host="controllers[0]", var_name="kayobe_ansible_user") playbooks = ["ansible/%s.yml" % playbook for playbook in @@ -200,7 +198,12 @@ class OvercloudDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, Command): "kolla-host", "docker"] ansible.run_playbooks(parsed_args, playbooks, limit="controllers") - def _deploy_services(self, parsed_args): + +class OvercloudServiceDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, Command): + """Deploy the overcloud services.""" + + def take_action(self, parsed_args): + self.app.LOG.debug("Deploying overcloud services") playbooks = ["ansible/%s.yml" % playbook for playbook in "kolla-openstack", "swift-setup"] ansible.run_playbooks(parsed_args, playbooks) diff --git a/setup.py b/setup.py index 71f23a2ba..00849af09 100644 --- a/setup.py +++ b/setup.py @@ -39,10 +39,12 @@ setup( 'control_host_bootstrap = kayobe.cli.commands:ControlHostBootstrap', 'configuration_dump = kayobe.cli.commands:ConfigurationDump', 'kolla_ansible_run = kayobe.cli.commands:KollaAnsibleRun', - 'overcloud_deploy = kayobe.cli.commands:OvercloudDeploy', + 'overcloud_host_configure = kayobe.cli.commands:OvercloudHostConfigure', + 'overcloud_service_deploy = kayobe.cli.commands:OvercloudServiceDeploy', 'overcloud_provision = kayobe.cli.commands:OvercloudProvision', 'playbook_run = kayobe.cli.commands:PlaybookRun', - 'seed_deploy = kayobe.cli.commands:SeedDeploy', + 'seed_host_configure = kayobe.cli.commands:SeedHostConfigure', + 'seed_service_deploy = kayobe.cli.commands:SeedServiceDeploy', 'seed_vm_provision = kayobe.cli.commands:SeedVMProvision', ], },