User Tools

Site Tools


khaleesi_guide

This is an old revision of the document!


Khaleesi Guide

Overview

The purpose of this guide is to walk through necessary steps to install and run Khaleesi in order to control Foreman nodes and use Tempest.

Khaleesi is an Ansible framework used to run RDO CI. It contains the necessary playbooks, roles, and libraries in order to control Foreman nodes and install/execute Tempest on a node.


Installation

Khaleesi can be installed on your provisioning server. First you need EPEL and some other packages:

sudo rpm -i http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

sudo yum -y install python-pip python-virtualenv gcc git

sudo yum -y install python-keystoneclient python-novaclient python-glanceclient python-neutronclient python-keystoneclient

Now clone Khaleesi where you like:

git clone -b foreman https://github.com/trozet/khaleesi.git

Khaleesi recommeds using a virtual environment provided by python-virtualenv. Follow these steps to setup your virtualenv:

virtualenv venv
source venv/bin/activate
pip install ansible
cd khaleesi
cd tools/ksgen
python setup.py develop
cd ../..

From the above you can see that "source venv/bin/activate" will activate your virtual environment. Simply use deactivate to exit. Now we need to create a default Ansible config:

cat > ansible.cfg << EOF
[defaults]
host_key_checking = False
roles_path = ./roles
library = ./library:$VIRTUAL_ENV/share/ansible/
lookup_plugins = ./plugins/lookups
EOF

Configuration

Khaleesi uses a ksgen_settings.yml file for directing Khaleesi's execution. It is a YAML file that contains variables and topology information. This file can either be edited manually or can be autogenerated using another project called khaleesi-settings.

For our purposes it is easier to just modify an existing ksgen_settings file. Please use this as a template: https://gist.github.com/trozet/c5bde608822d8e6b063a. The configuration make look like a lot at first, but you only need to modify two pieces:

Modify External Network

You will notice part of the config that looks like this:

  public_allocation_end: 10.2.84.71
  skip:
    files: null
    tests: null
  public_allocation_start: 10.2.84.51
  physnet: physnet1
  use_custom_repo: false
  public_subnet_cidr: 10.2.84.0/24
  public_subnet_gateway: 10.2.84.1

Simply modify these IP addresses and subnets to match your external Public network that will provide Neutron external network access. You can also just leave these alone and Tempest will still run while failing the external network test cases.

Modify Inventory

The second piece of the configuration you need to change is the nodes dictionary. This configuration provides your Host inventory to ansible:

nodes:
  compute:
    name: oscompute11.ci.com
    hostname: oscompute11.ci.com
    type: compute
    ansible_ssh_pass: "Op3nStack"
    admin_password: ""
    groups:
    - compute
    - foreman_nodes
    - puppet
    - rdo
    - neutron
  tempest:
    name: tempest
    hostname: tempest1.ci.com
    remote_user: ""
    type: tempest
    ansible_ssh_pass: "Op3nStack"
    admin_password: ""
    groups:
    - tempest
    - foreman_nodes
    - puppet
    - rdo
    - neutron
  controller:
    name: oscontroller1.ci.com
    hostname: oscontroller1.ci.com
    type: controller
    ansible_ssh_pass: "Op3nStack"
    admin_password: "octopus"
    groups:
    - controller
    - foreman_nodes
    - puppet
    - rdo
    - neutron

Simply replace the hostnames with the hostnames of your nodes in Foreman. The "ansible_ssh_pass" is the ssh password to your provisioned hosts, and admin_password is the password for admin within your OpenStack context.

You also need to make sure that your provisioning server can access your your hosts via their FQDN. Therefore it is necessary to add them to /etc/hosts:

[root@foreman-server /]# cat /etc/hosts
10.2.84.4  tempest1.ci.com tempest1
10.2.84.3  oscontroller1.ci.com oscontroller1
10.2.84.5  oscompute11.ci.com oscompute11
khaleesi_guide.1426001398.txt.gz · Last modified: 2015/03/10 15:29 by Tim Rozet