Richard Jones' Log

Tue, 10 Nov 2015
Horizon development with openstack-ansible

Previously, I had written about getting openstack-ansible (was "OSAD") up and running as a development stack for Horizon to target. Things changed slightly since then, so I thought I'd write a small update post.

Mostly, follow the OSA quick start guide as-is, with a small change:

# Update repository information and install git
apt-get update && apt-get install -y git

# Clone the OSA repository
git clone https://github.com/openstack/openstack-ansible /opt/openstack-ansible

# Bootstrap the env
cd /opt/openstack-ansible
./scripts/bootstrap-ansible.sh
./scripts/bootstrap-aio.sh
At this point, we deviate from the instructions because we need to edit the configuration to expose all of the service URLs in the service catalog through the external IP address, rather than just the public URLs. This is necessary because OSA only uses the external address for the public URLs, but Horizon requires access to the admin URLs also.
# Set the internal address to the external
sed -i "s/internal_lb_vip_address:.*/internal_lb_vip_address: \"{{ external_lb_vip_address }}\"/" \
  /etc/openstack_deploy/openstack_user_config.yml​

Now we're going to edit the configuration so we don't set up all those unnecessary services. Open /etc/openstack_deploy/openstack_user_config.yml in an editor and turn off the Horizon container creation by editing:

os-infra_hosts:
  aio1:
    # Horizon is set to multiple to test clustering. This test only requires x2.
    affinity:
      horizon_container: 2
    ip: 172.29.236.100

to:

os-infra_hosts:
  aio1:
    # Horizon is set to multiple to test clustering. This test only requires x2.
    affinity:
      horizon_container: 0
    ip: 172.29.236.100

Similar edits can be made to reduce the size of the Galera and RabbitMQ clusters from 3 to 1 in the "galera_container" and "rabbit_mq_container" settings.

Now we can continue on and create the stack:

scripts/run-playbooks.sh

The stack will be empty (no networks, flavours or images) so to add some, I run:

pushd playbooks
openstack-ansible os-tempest-install.yml
popd

A Keystone endpoint will be created on port 5000 on the public IP of the host you set OSAD up on. This is the HAProxy (load-balancer) endpoint, so it's there no matter how many actual Keystones are set up by the OSAD setup.

The final step is to edit the Horizon configuration (local_settings.py) for that endpoint and to also hard-set the Keystone API version:

OPENSTACK_API_VERSIONS = {
    "identity": 3,
}

Oh, and if you're wondering what your admin password is, it's here:

# grep admin_pass /etc/openstack_deploy/user_secrets.yml
heat_stack_domain_admin_password: [some random string]
keystone_auth_admin_password: [some other random string]

To log in as "admin" you need that second password. You can edit that value to something of your own choosing after the "scripts/bootstrap-aio.sh" step above.