Skip to content

Commit

Permalink
Add control host upgrade, stop using yum on host
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
markgoddard committed Jul 11, 2017
1 parent 896bd16 commit 328455e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
1 change: 0 additions & 1 deletion doc/source/deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
25 changes: 11 additions & 14 deletions kayobe/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
],
'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',
Expand Down

0 comments on commit 328455e

Please sign in to comment.