RETIRED, CLI supporting kolla-ansible deployment project
Go to file
Borne Mace ccb508799a Add setup script for kolla-cli / kolla-ansible
Created new cli-setup.py script that automates the previously
manual process to create the directories needed for the kolla-cli
and kolla-ansible.  It also improves on the process by leaving the
globals.yml file in place in /etc/kolla and just creating a link
to the group_vars/__GLOBALS__ so that both the kolla-ansible and
kolla-cli commands will work correctly, rather than having their
functioning being mutually exclusive.  Due to kolla-ansible still
expecting to be run as root for most actions the cli_setup.py
script should also be run via sudo.

Change-Id: I5b59317b2c22d10dd82623a548b64f387b6bc9d3
2018-06-06 10:35:45 -07:00
doc Updating the cli to work against kolla-ansible 2018-04-17 09:45:35 -07:00
kolla-cli/locale Updating the cli to work against kolla-ansible 2018-04-17 09:45:35 -07:00
kolla_cli Merge "Add support for config reset command." 2018-05-25 18:53:16 +00:00
tools Add support for config reset command. 2018-05-25 11:16:02 -07:00
.gitignore Fix mypy static type checker 2018-05-17 16:12:23 -04:00
.gitreview Add a .gitreview file 2018-04-18 18:13:40 +01:00
.stestr.conf Align tests with how functional tests are handled 2018-05-16 16:13:54 -04:00
.zuul.yaml Enable py35 functional tests 2018-05-18 13:14:49 -04:00
LICENSE Adding the Apache LICENSE file, required to be included in the RPM 2015-08-27 13:39:31 -07:00
README.rst Add setup script for kolla-cli / kolla-ansible 2018-06-06 10:35:45 -07:00
babel.cfg Initial commit 2015-07-15 13:34:36 -07:00
builddocs.sh Added initial sphinx documentation support for the python api 2016-03-21 10:59:42 -07:00
cli_setup.py Add setup script for kolla-cli / kolla-ansible 2018-06-06 10:35:45 -07:00
requirements.txt Add support for config reset command. 2018-05-25 11:16:02 -07:00
setup.cfg Add support for config reset command. 2018-05-25 11:16:02 -07:00
setup.py fixed the property code to work with mainstream kolla changes. ordered property output. 2015-08-20 13:05:04 -07:00
test-requirements.txt Add support for config reset command. 2018-05-25 11:16:02 -07:00
tox.ini Add support for config reset command. 2018-05-25 11:16:02 -07:00

README.rst

Kolla-CLI
The Kolla-CLI project provides the ability to more easily manage
Kolla-Ansible deployments. It provides both a CLI and a python

API that you can use to configure and deploy OpenStack using Kolla-Ansible.

Kolla-Ansible requires that hosts, groups, and services are specified
in an inventory file. With Kolla-CLI, you can add/remove hosts, change group
associations, etc from the CLI or API. Kolla-Ansible also maintains
passwords and various configuration variables in a variety of global, group
and host files. With Kolla-CLI, you can now view and change these from the

CLI/API.

Finally, Kolla-CLI provides commands to setup the SSH keys on hosts, run

deployments and perform upgrades.

Installing

The installation process below assumes that the kolla-ansible repository exists at the same level as the kolla-cli repository. This is made clear in the cli-setup.py script which makes a relative '../' reference to the kolla-ansible repository. If your kolla-ansible directory is somewhere else then that location can be passed as an argument to the cli-setup.py script. The location on the system where the kolla-cli expects the kolla-ansible files to be and installs them to can be tweaked by setting the KOLLA_HOME and KOLLA_ETC environment variables before running the cli-setup.py script, and while running the kolla-cli command itself. The default value for KOLLA_HOME is /usr/share/kolla-ansible and the default value for KOLLA_ETC is /etc/kolla.

The following steps can be used to build / run the kolla-cli

  • install ansible and docker
  • virtualenv .venv
  • . .venv/bin/activate
  • pip install -r requirements.txt
  • python setup.py install
  • python ./cli-setup.py
  • kolla-cli

At that point you will be dropped into the kollacli shell where you can run commands like help or ? to see what commands are available and any of the sub commands can be executed directly.

Alternately you can not use the shell and just execute commands directly via >kollacli host add, etc.

If you make changes to the i18n strings (denoted by methods like _("message")) make sure to re-generate the i18n files with the >python setup.py extract_messages command and check in the files generated in openstack-kollacli.

API

To use the API, import the ClientAPI into your module:

from kolla_cli.api.client import ClientApi

Then define a global:

CLIENT = ClientApi()

And then you can use that global to execute API commands, for example, to add a host to the inventory:

CLIENT.host_add(['host_name'])

Troubleshooting

If you get an error about missing python.h install the python-dev package via apt-get or yum or whatever mechanism is appropriate for your platform.