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.
This commit is contained in:
Mark Goddard 2017-06-30 16:13:48 +01:00
parent 896bd163ff
commit 328455ec10
3 changed files with 12 additions and 15 deletions

View File

@ -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::

View File

@ -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)

View File

@ -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',