Book Image

OpenStack Administration with Ansible

By : Walter Bentley
Book Image

OpenStack Administration with Ansible

By: Walter Bentley

Overview of this book

Most organizations are seeking methods to improve business agility because they have realized just having a cloud is not enough. Being able to improve application deployments, reduce infrastructure downtime, and eliminate daily manual tasks can only be accomplished through some sort of automation. Packed with real-world OpenStack administrative tasks, this book will walk you through working examples and explain how these tasks can be automated using one of the most popular open source automation tools—Ansible. We will start with a brief overview of OpenStack and Ansible and highlight some best practices. Each chapter will provide an introduction to handling various Cloud Operator administration tasks such as creating multiple users/tenants, setting up Multi-Tenant Isolation, customizing your clouds quotas, taking instance snapshots, evacuating compute hosts for maintenance, and running cloud health checks, and a step-by-step tutorial on how to automate these tasks with Ansible.
Table of Contents (18 chapters)
OpenStack Administration with Ansible
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

Coding the playbook and roles


In this section, we will create a playbook and role that will set up a tenant to use the enabled multi-tenant isolation functionality within your OpenStack cloud. To leverage this task, you must have completed the pre-configuration steps outlined in the preceding section. We will not cover these steps in the role being created next. However, we will take the steps outlined two sections earlier, automate them so that you only need to supply a few variable values, and then execute only one command.

Before getting started, here is another brief outline of the tasks we will have to do:

  1. Create a new tenant.

  2. Create new host aggregate.

  3. Add hosts to new host aggregate.

  4. Update host aggregate metadata.

  5. Create custom flavor to include tenant filter.

  6. Apply volume type quotas (optional).

In this case we will focus solely on creating a role, we can start with the main.yml file within the role directory named tenant-isolation/tasks. The initial contents of this file will look similar...