infrastructure automation with chef & ansible

Post on 13-Apr-2017

2.036 Views

Category:

Software

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

INFRASTRUCTURE AUTOMATIONWITH CHEF & ANSIBLE

Tips & tools for automating your web infrastructure.

Waqar Alamgir @wajrcshttps://github.com/waqar-alamgir/tutorials/tree/master/vagrant-lamp-ansible

Here’s What I’m Going To Talk To You About! What is Infrastructure and why you should

automate it? Typical Infrastructure Benefits CMS/ Automation Chef / Terminologies / Disadvantages Ansible / Disadvantages Demo Summary Questions

Meet this IT GUY & Service Provider

Why you should automate your web infrastructure All of your configuration information is in

one place. You can spin up perfectly configured

servers instantly. You can change things in one place and

have them propagate through your entire system.

You can create dev and test environments, that are exact replicas of your production.

Infrastructure A high performance, reliable, and secure integrated technology infrastructure for managing multiple hosted applications by Application Service Providers.

Application infrastructure, comprised of application servers, web servers, and often database servers, is a core component in most network architectures.

Typical Infrastructure

Benefits Technical benefits:

Continuous software delivery Less complex problems to fix Faster resolution of problems

Business benefits: Faster delivery of features More stable operating environments More time available to add value (rather than

fix/maintain)

PHP Nginx Redis PostgreSQL Gearman

My Typical Project

Configuration Management Software Ansible Chef Puppet SaltStack CFEngine Juju many others

What is Chef?

“Reality-based automation for the cloud.”

“Infrastructure as Code.”“A global view of your system as opposed to

local one”

TerminologiesChef Server? Central storage for all your chef config. Stores all your git repo stuff as structured

data in json. Uses CouchDB for storage and quering Hosted Chef free for up to 5 nodes – then

you should host it yourself.

TerminologiesKnife?Command line tool to interface between your local code repo and your chef server.

TerminologiesNodes?Servers in your system.

TerminologiesRoles?A nice way of abstracting what a node does and what should be installed on it. i.e. A webserver role A database role

Open up firewall for front-end severs.

TerminologiesCookbooks?The base unit of configuration, so you would have a cookbook for nginx, postgres, gunicorn, etc.

TerminologiesRecipes?A computer program that runs cookbooksMostly written in Ruby or Python

Chef Infrastructure

Chef Infrastructure

Chef disadvantages You need to know Ruby (infrastructure as

code) Need to install Chef Client on nodes Chef Client can be broken (example,

Rubygems Sandbox in 11/12 versions) Different teams with different approaches Documentation is not perfect Too many tools and options

Who is Using Chef Facebook, with over 20K instances Yahoo! IGN Nordstrom Dream Host Target Bloomberg

Ansible Runs locally (push model, like Chef Solo) Client-less (need only Python) YAML configs, "command to infrastructure" Huge community Ansible Tower for more automation

Ansible Infrastructure

Ansible disadvantages Bad team workflow Small flexibility in coding Poor development testing Limited support for Windows

(from 1.7 can use winrm, but still not perfect and small amount of modules)

Who is Using Ansible Twitter Apple NASA CISCO Juniper HootSuit

Demo Application - LAMP StackProvision Theme

Common system level tools MySQL, Memcached, Beanstalk Web tools as Apache, PHP

Demo Application - LAMP Stack

Demo Application - LAMP Stack

Demo Application - LAMP Stack

To Sum it all up…. You should really, really, really use

something for server configuration. Chef: Ruby code to infrastructure. Ansible: YAML commands to infrastructure,

with no clients.

top related