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 now create the playbooks and roles to add the OpenStack feature of provisioning Docker compute node(s) as a hypervisor to your cloud. When creating Ansible automation code for something of this nature, I typically like to create multiple tasks broken up into separate roles. This format allows you to reuse the roles created with other playbooks. We will end up with four playbooks and six roles to automate the steps outlined in the previous section. Each role will be broken up into its own area within this section of the chapter. At the end, we will recap the playbooks consuming those roles.

Install Docker

The first role that we will create will include the tasks needed to install Docker on the new compute node(s). The name of the file will be main.yml located within the role directory named install-docker/tasks. The contents of this file will be as shown:

---

- name: Install additional packages
apt: name={{item}} state=present
with_items...