Google Cloud Platform Blog
Using Ansible to Automate Google Compute Engine
Monday, May 5, 2014
Today's guest post comes from Michael Dehaan, the original author of Ansible and CTO of Ansible, Inc.
Ansible
is an easy to use IT automation platform that provides the ability to deploy applications, configure systems, and orchestrate complex workflows. Ansible has had support for Google Cloud Platform for about a year, and we’d like to share a bit of information about how to use it.
Examples are available in our
Google Cloud Platform Guide
-- as well as several “gc” prefixed modules in our
Cloud Module Index
.
Users have a lot of choices in picking how they want to manage their cloud infrastructure. When automating in the cloud, some of the most important things to consider are dealing with the challenges of the management stack itself, and how the management stack interacts and scales as the nature of cloud deployments increase in complexity. Not only do you need a system that is easy to maintain, but also a system where the automation content is easy to write and evolve.
Ansible is designed around SSH because SSH is cloud native -- which works well with Google Cloud Platform in many ways.
By using SSH to manage your nodes, there are no additional daemons to install, or security packages to manage. SSH keys can be easily injected upon virtual machine instantiation. No additional resources are consumed on remote nodes, and there’s never the problem of a management agent “falling over” and the user not having a way to automate the box. There are no additional open ports, and when a box is not being managed by Ansible, nothing extra is running. Ansible enables this not by logging into your boxes and running commands, but by connecting to them over SSH to transfer modules, run them, and parse out responses. It then cleans up after itself leaving nothing behind but logs.
One of Ansible’s main focuses is around application deployment of complex multi-tier applications. This includes not only cloud provisioning (as illustrated in the Compute Engine guide) but also working with zero-downtime rolling updates involving load-balanced infrastructure -- which there is also an Ansible module for the
Compute Engine Load-Balancer
. Instances can either be updated in place, or new machines can be spun up and added to load balancers while others are spun down. Additionally storage and networking can be worked with as well.
Another way that Ansible integrates with Compute Engine, also as documented in the
Google Cloud Platform Guide
, is the ability to query inventory dynamically from the Google cloud. In getting the most out of cloud, it’s important to treat instances as cattle, not pets. Having groups of machines sorted by tag, rather than instance hostnames, greatly decreases management complexity as scale changes.
If you’d like to find out more about Ansible generally, see
docs.ansible.com
, and also explore some of the community roles found at
galaxy.ansible.com
. Ansible Galaxy is a site where users can create and share automation roles with each other, which can help jumpstart new deployments.
If you have specific questions about Ansible and Compute Engine, you may wish to join the
Ansible Project Google Group
.
-Contributed by Michael DeHaan, original author of Ansible, and CTO of Ansible, Inc.
No comments :
Post a Comment
Don't Miss Next '17
Use promo code NEXT1720 to save $300 off general admission
REGISTER NOW
Free Trial
GCP Blogs
Big Data & Machine Learning
Kubernetes
GCP Japan Blog
Labels
Announcements
56
Big Data & Machine Learning
91
Compute
156
Containers & Kubernetes
36
CRE
7
Customers
90
Developer Tools & Insights
80
Events
34
Infrastructure
24
Management Tools
39
Networking
18
Open Source
105
Partners
63
Pricing
24
Security & Identity
23
Solutions
16
Stackdriver
19
Storage & Databases
111
Weekly Roundups
16
Archive
2017
Feb
Jan
2016
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2015
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2014
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2013
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2012
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2011
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2010
Dec
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2009
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2008
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Feed
Subscribe by email
Technical questions? Check us out on
Stack Overflow
.
Subscribe to
our monthly newsletter
.
Google
on
Follow @googlecloud
Follow
Follow
No comments :
Post a Comment