women's do it yourself: vagrant chef workshop [jan 24 2015]

22
Welcome ! Ask any of the coaches [wearing WDIY t-shirts] for any help. Tweet: @womensdiy

Upload: nishitha-ningegowda

Post on 18-Jul-2015

41 views

Category:

Software


0 download

TRANSCRIPT

Welcome !

Ask any of the coaches

[wearing WDIY t-shirts] for

any help.

Tweet: @womensdiy

What do you want to taco about?

Infrastructure As Code

Lots of Terminology!

Let’s Start With the Basics

- recipes are made of resources and applied to nodes

- today we will focus on cookbooks and recipes

Anatomy of a Resource

- type, name, action, attribute

- where do they come from?

- built into chef (package, service, directory, template, etc.)

- provided by community cookbooks (ruby_build, web_app, etc.)

- written by you!

Descriptive Not Prescriptive

- recipes should be idempotent

- recipes should be platform independent

- nodes “converge”

- chef won’t prevent you from doing it wrong

Good

Bad

Worse

Provider

- Implements resources

- Provider figures out what actions to take for

different platforms. (e.g. for a package should I

use apt, yum, or something else?)

- Figures out what (if anything) to do based on

current state

Attributes

- specific detail about a node

- allow for configurability

- come from many different places

- ohai

- environment

- cookbook

- role

- node definition

- chef has complicated order of attribute precedence

- you can use knife (a chef command line tool) to inspect attributes for a

given node

Borrow From The Community

- Always use community cookbook when possible!

- Most things you want to do have already been done (e.g. tomcat, mysql, apache)

- If you need to make modifications create a wrapper cookbook

- There are 2 main ways to borrow from the community, include a recipe or use a custom

resources

Chef Developer Tools

- Berkshelf (dependency

manager)

- Test-Kitchen (‘integration

tool for developing and

testing cookbooks’)

“Thats all well and good in theory, but how

does it work in the enterprise…?”

nishi

http://tutorials.womensdiy.com

/tutorials/4