Ansible playbooks for deploying OpenStack.
092f606adc
We're seeing some neutron db sync failures in master branch (liberty). It looks like there may be a few issues with the way we're handling migrations: 1. We're not capturing the correct information in the 'Check last DB revision' task as the first line returned by 'neutron-db-manage history' is a header (this also means that the 'Inspect on disk neutron DB revision' task will never do what we intend). 2. We delegate 'Check last DB revision' to 'neutron_all' group, but in an ideal world this is probably only necessary on 'neutron_server'. 3. When stopping neutron server to run 'Perform a Neutron DB Upgrade', we're only stopping it on groups['neutron_server'][0], while all other neutron server containers are up servicing requests. 4. Perform a db stamp, which doesn't appear to be necessary. This change makes the following changes: 1. Bumps neutron SHA to include 43c00a9, which introduces new --expand / --contract upgrade options (otherwise, you have to specify liberty_expand@head / liberty_contract@head which may no longer work when neutron gets bumped in the future) 2. Checks if migrations have previously run, and if not runs a 'neutron-db-manage upgrade heads' 3. If migrations have previously run: a) it runs an online migration against expand alembic branch using 'neutron-db-manage upgrade --expand'. b) it stops all neutron-server services c) it runs an offline migration against contract alembic branch using 'neutron-db-manage upgrade --contract' d) it starts all neutron-server instances 4. It removes the temporary pin introduced in https://review.openstack.org/218572 as the SHA bump includes the upstream fix https://review.openstack.org/218723 TODO: Currently, we upgrade expand and contract branches (shutting down neutron-server in the proceses), even if there are no pending migrations. We need to find a clean way to check what migration we are on and compare to alembic HEADS file to see if we're up to date. Unfortunately, 'neutron-db-manage current' doesn't indicate which migration is in which alembic branch, so you would have to further grep for each migration in the neutron migrations code to determine the branch. NOTE: Liberty introduces the split alembic branches for online/offline migrations, see [1] for more information. [1] http://docs.openstack.org/developer/neutron/devref/alembic_migrations.html Change-Id: I1176b5fe12cad1ee732486ae179e76deea5623e1 Closes-Bug: #1486593 |
||
---|---|---|
doc | ||
etc | ||
playbooks | ||
scripts | ||
.gitignore | ||
.gitreview | ||
ansible-role-requirements.yml.example | ||
CONTRIBUTING.rst | ||
dev-requirements.txt | ||
development-stack.rst | ||
LICENSE.txt | ||
README.rst | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
tox.ini |
OpenStack Ansible Deployment
- date
-
2015-02-02 22:00
- tags
-
lxc, openstack, cloud, ansible
- category
-
*nix
Playbooks
There are several playbooks within that will setup hosts for use in OpenStack Cloud. The playbooks will enable LXC on hosts and provides the ability to deploy LXC containers for use within openstack.
- Plays:
-
setup-hosts.yml
Performs host setup for use with LXC in the OpenStack hosts.setup-infrastructure.yml
Performs all of the setup for all infrastructure components.setup-openstack.yml
Performs all of the setup for all of the OpenStack components.
- If you dont want to run plays individually you can simply run
setup-everything.yml
which will perform all of the setup and installation for you.
- Basic Setup:
-
- If you have any roles that you'd like to have pulled in that are
outside the scope and or replace modules within this repository please
add them to the
ansible-role-requirements.yml
file. In this file you will want to fill in the details for the role you want to pull in using standard ansible galaxy format.
- name: SuperAwesomeModule src: https://github.com/super-user/SuperAwesomeModule version: master
- Run the
./scripts/bootstrap-ansible.sh
script, which will install, pip, ansible 1.9.x, all of the required python packages, and bring in any third party ansible roles that you may want to add to the deployment. - Copy the
etc/openstack_deploy
directory to/etc/openstack_deploy
. - Fill in your
openstack_deploy/openstack_user_config.yml
,openstack_deploy/user_secrets.yml
andopenstack_deploy/user_variables.yml
files which you've just copied to your/etc/
directory. - Generate all of your random passwords executing
scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml
. - Accomplish all of the host networking that you want to use within
the deployment. See the
etc/network
directory in this repository for an example network setup. - When ready change to the
playbooks/
directory and execute your desired plays. IE:
openstack-ansible setup-everything.yml
- If you have any roles that you'd like to have pulled in that are
outside the scope and or replace modules within this repository please
add them to the
Notes
- If you run the
./scripts/bootstrap-ansible.sh
script a wrapper script will be added to your system that wraps the ansible-playbook command to simplify the arguments required to run openstack ansible plays. The name of the wrapper script is openstack-ansible. - The lxc network is created within the lxcbr0 interface.
This supports both NAT networks as well as more traditional networking.
If NAT is enabled (default) the IPtables rules will be created along
with the interface as a post-up processes. If you ever need to recreate
the rules and or restart the dnsmask process you can bounce the
interface IE:
ifdown lxcb0; ifup lxcbr0
or you can use thelxc-system-manage
command. - The tool
lxc-system-manage
is available on all lxc hosts and can assist in recreating parts of the LXC system whenever its needed. - Inventory is generated by executing the
playbooks/inventory/dynamic_inventory.py
script. This is configured in theplaybooks/ansible.cfg
file. - If you don't use the pw-token-gen.py script you will want to ensure
the permissions on /etc/openstack_deploy/user_secrets.yml are more
secure.
chmod 0600 /etc/openstack_deploy/user_secrets.yml
Bugs and Blueprints
Everything we do is in launchpad and gerrit. If you'd like to raise a bug, feature request, or are looking for ways to contribute please go to "https://launchpad.net/openstack-ansible".
Documentation
To build the docs make sure that you have installed the python
requirements as found within the dev-requirements.txt
file
and then run the following command from within the doc
directory.
make html