From 328455ec104d92c6fbbe1f4f46a0ca3366a0317f Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 30 Jun 2017 16:13:48 +0100 Subject: [PATCH] Add control host upgrade, stop using yum on host Ansible is now a dependency of kayobe, and should either be installed in a virtualenv or in the site python packages, so we no longer need to install it via yum. Also stop running the kolla.yml playbook during control host bootstrap, as it is now run when required. --- doc/source/deployment.rst | 1 - kayobe/cli/commands.py | 25 +++++++++++-------------- setup.py | 1 + 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/doc/source/deployment.rst b/doc/source/deployment.rst index 3264fea64..cdae215f4 100644 --- a/doc/source/deployment.rst +++ b/doc/source/deployment.rst @@ -18,7 +18,6 @@ performed here include: - Install Ansible and role dependencies from Ansible Galaxy. - Generate an SSH key if necessary and add it to the current user's authorised keys. -- Configure kolla and kolla-ansible. To bootstrap the Ansible control host:: diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index cab2581d5..b48247d17 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -116,21 +116,18 @@ class ControlHostBootstrap(KayobeAnsibleMixin, VaultMixin, Command): def take_action(self, parsed_args): self.app.LOG.debug("Bootstrapping Kayobe control host") - linux_distname = platform.linux_distribution()[0] - if linux_distname == "CentOS Linux": - utils.yum_install(["epel-release"]) - else: - # On RHEL, the following should be done to install EPEL: - # sudo subscription-manager repos --enable=qci-1.0-for-rhel-7-rpms - # if ! yum info epel-release >/dev/null 2>&1 ; then - # sudo yum -y install \ - # https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - # fi - self.app.LOG.error("%s is not currently supported", linux_distname) - sys.exit(1) - utils.yum_install(["ansible"]) utils.galaxy_install("ansible/requirements.yml", "ansible/roles") - playbooks = _build_playbook_list("bootstrap", "kolla") + playbooks = _build_playbook_list("bootstrap") + self.run_kayobe_playbooks(parsed_args, playbooks) + + +class ControlHostUpgrade(KayobeAnsibleMixin, VaultMixin, Command): + """Upgrade the Kayobe control environment.""" + + def take_action(self, parsed_args): + self.app.LOG.debug("Upgrading Kayobe control host") + utils.galaxy_install("ansible/requirements.yml", "ansible/roles") + playbooks = _build_playbook_list("bootstrap") self.run_kayobe_playbooks(parsed_args, playbooks) diff --git a/setup.py b/setup.py index 3f59b1727..301b5a44f 100644 --- a/setup.py +++ b/setup.py @@ -53,6 +53,7 @@ setup( ], 'kayobe.cli': [ 'control_host_bootstrap = kayobe.cli.commands:ControlHostBootstrap', + 'control_host_upgrade = kayobe.cli.commands:ControlHostUpgrade', 'configuration_dump = kayobe.cli.commands:ConfigurationDump', 'kolla_ansible_run = kayobe.cli.commands:KollaAnsibleRun', 'overcloud_bios_raid_configure = kayobe.cli.commands:OvercloudBIOSRAIDConfigure',