In this recipe, we simply run a series of Ansible Playbooks that lay down the infrastructure needed on top of our six Ubuntu 14.04 LTS hosts, and then install all of the software required to run a highly available OpenStack installation.
Ansible uses SSH and Python to execute the Playbooks that describe how to install and configure software on distributed systems. Its lightweight design with very few dependencies makes it perfect to install OpenStack across our many Ubuntu hosts.
It is important that the previous two recipes, Automating OpenStack installations using Ansible – host configuration and Automating OpenStack installations using Ansible – Playbook configuration, have been followed, that all the configured networks are working as expected, and that the relevant configuration files are edited to suit the upcoming installation. If not, please log in to the Logging host where the Ansible OpenStack Deployment has been configured.
Now that we have a set of configuration files in /etc/openstack_deploy
that our Ansible Playbooks will look for and understand, we can begin the installation of OpenStack by following these steps:
cd /opt/os-ansible-deployment scripts/bootstrap-ansible.sh
openstack-ansible
that we will use to run the Playbooks. The first Playbook to run is the setup-hosts.yml
file. This is run by executing the following commands:cd /opt/os-ansible-deployment/playbooks openstack-ansible setup-hosts.yml
We will get an output that will be familiar to anyone running Ansible and give verbose information during the running of the Playbooks.
openstack-ansible haproxy-install.yml
openstack-ansible setup-infrastructure.yml
openstack-ansible setup-openstack.yml
ssh
command to connect to a utility container as follows:grep utility /etc/hosts
Identify one of them to connect using the ssh
command to the following:
ssh controller-01_utility_container-88105269
Source in the OpenStack credentials and use the environment as usual:
. openrc
Ansible is a very powerful yet lightweight system that runs Playbooks over SSH to install and configure software. It is perfect for installing OpenStack that lays down software across the many number of nodes.
A number of Playbooks are run, and they are listed as follows:
setup-hosts.yml
: This installs and configures the LXC containers across our nodes, which will be the targets for the installation of the various OpenStack services in the environment.haproxy-install.yml
: This allows us to use HA Proxy for our installation. As we are running a set of three controllers, we need a Load Balancer to allow the services to communicate correctly in our environment.setup-infrastructure.yml
: This installs all the ancillary services such, as MariaDB, Galera, memcached, and RabbitMQ.setup-openstack.yml
: This installs all the OpenStack services required to give a complete, production-ready installation on our environment.Should any of the Playbooks fail, a shortcut to fix just the necessary parts can be achieved by specifying --limit @/root/{playbook}.retry
(omitting the .yml
extension). Ansible is very verbose in its output and will inform you when this is possible, as shown here:
This environment has been configured so that Glance uses the local filesystem for the uploaded images to be used in OpenStack. As we have installed a cluster of three Glance image servers, it is assumed that images will be uploaded to Glance using the --location <IMAGE_URL>
flag. This flag tells Glance to fetch the image from the IMAGE_URL
provided rather than store the image locally. Adjust the /etc/openstack_deploy/user_variables.yml
file as described in the previous recipe to choose a different storage option for Glance to suit your environment.
This installation involved a number of Playbooks that configured our host, installed extra services, and then installed OpenStack. There is a wrapper script that can be used that covers all of these steps in one command. This can be achieved by running the following command instead:
cd /opt/os-ansible-deployment scripts/run-playbooks.sh
Note that by splitting up the installation, we can fix specific Playbook issues as well as having a chance for HA Proxy to be configured correctly. It is therefore prudent to use the preceding Playbook when setting up a test environment on a single host.