Download - WebLogic Hackathon: Introduction to Puppet & Chef

Transcript
Page 1: WebLogic Hackathon: Introduction to Puppet & Chef

1 | 10 1 | 28

Simon Haslam & Ronald van Luttikhuizen

December 1st | UKOUG Tech 2013

Super Sunday | WebLogic Hackathon

Introduction to Puppet & Chef

Page 2: WebLogic Hackathon: Introduction to Puppet & Chef

2 | 10 2 | 28

Agenda

Configuration management

● Intro, How it was & How it can be

Real world case

Puppet

Chef

Intro to the Hands-on-Labs

Page 3: WebLogic Hackathon: Introduction to Puppet & Chef

3 | 10 3 | 28

• Automated installations and rollbacks • Inject environment variables, smoke-testing

• Automated builds, tests, and packaging from version control • Central archiving in (artifact) repository

• Automated provisioning of middleware • High frequency of changes to images (e.g. patches)

• Automated provisioning of OS-ready images • Low frequency of changes to images

Configuration management | introduction

Machine Provisioning

Server & Middleware Provisioning

Application Building & Packaging

Application Deployment

Page 4: WebLogic Hackathon: Introduction to Puppet & Chef

4 | 10 4 | 28

Configuration management | the traditional way

Artisan server crafting

Boring

Stressful

Error-prone

Time-consuming

Non-scalable & expensive

Page 5: WebLogic Hackathon: Introduction to Puppet & Chef

5 | 10 5 | 28

Configuration management | how it can be

Automated configuration

management Describe a system once, apply as often

as you want

Automate the repetitive

Focus on improvements and “real”

problems as admin

Predictable results

(Near) real-time provisioning

Page 6: WebLogic Hackathon: Introduction to Puppet & Chef

6 | 10 6 | 28

Configuration management | how it can be

Infrastructure as code & DevOps

Eliminate tedious and repetitive work

Configurations are defined in a machine- and OS-independent domain

language so the manifests are portable and can be reused

Keep servers in sync and know what is running on what server

Configuration can be used as documentation: since configuration is

applied by the documentation is always up-to-date

Configuration can be version controlled and managed the same way you

manage other code

Page 7: WebLogic Hackathon: Introduction to Puppet & Chef

7 | 10 7 | 28

WLS, OSB, SOA Suite Database Server

Operating System

WebLogic

OSB

SOA Suite

Domain creation

Initial Domain

setup

Operating system

Database

software

Database

creation

SOA Suite

Repository

40

X Total actions

13

8

10

10

40

40

30

5

8

YUM + Packages / JVM /

Ulimits / Kernel / User /

Group / Directories

WebLogic / BSU /

NodeManager

OSB / OPatch

SOA Suite / OPatch

Create Domain

Logs / Security / JMS /

WebApps / DataSources /

Resource Adapters

Source: Roll Out a Complete Oracle Fusion Middleware Env in Less than 10min by Edwin Biemond

Page 8: WebLogic Hackathon: Introduction to Puppet & Chef

8 | 10 8 | 28

Automation

Automating repetitive steps is nothing new

● OS tools (jumpstart, kickstart, shell scripts, etc., etc.)

But…

● provisioning more environments than ever (cloudy)

● very complex multi-tier environments

New breed tools to standardise such a process

● platform-agnostic

● centralised

● fashionable

Page 9: WebLogic Hackathon: Introduction to Puppet & Chef

9 | 10 9 | 28

Puppet

Page 10: WebLogic Hackathon: Introduction to Puppet & Chef

10 | 10 10 | 28

Puppet Example | Apache HTTP Server

package { "httpd":

name => "httpd.x86_64",

ensure => "present",

}

file { "http.conf":

path => "/etc/httpd/conf/httpd.conf",

owner => root,

group => root,

mode => 0644,

source => "puppet:///modules/apache/httpd.conf",

require => Package["httpd"],

}

service { "httpd":

ensure => running,

enable => true,

subscribe => File["http.conf"],

}

Manifests

Resources

● Name

● Attributes and

values

Ordering and

dependencies

Page 11: WebLogic Hackathon: Introduction to Puppet & Chef

11 | 10 11 | 28

More on Puppet | building blocks

Manifests

Variables and (custom) facts

Node declarations

Classes and Modules

Defined resource types

Templates

Console

if $operatingsystem == 'CentOS'

node 'www1.example.com' {

include common

include apache

}

node 'db1.example.com' {

include common

include mysql

}

file { "http.conf":

path => "/etc/httpd/conf/httpd.conf",

owner => 'root',

group => 'root',

mode => '0644',

content => template('config/httpd.erb'),

}

Page 12: WebLogic Hackathon: Introduction to Puppet & Chef

12 | 10 12 | 28

More on Puppet | console

Page 13: WebLogic Hackathon: Introduction to Puppet & Chef

13 | 10 13 | 28

More on Puppet | products, price, etc.

Enterprise vs. Open Source

Puppet Forge

Market presence

Pricing (27-nov-2013)

Page 14: WebLogic Hackathon: Introduction to Puppet & Chef

14 | 10 14 | 28

More on Puppet | runtime

Versus

Page 15: WebLogic Hackathon: Introduction to Puppet & Chef

15 | 10 15 | 28

If you want to know more about Puppet …

Page 16: WebLogic Hackathon: Introduction to Puppet & Chef

16 | 10 16 | 28

Chef

Page 17: WebLogic Hackathon: Introduction to Puppet & Chef

17 | 10 17 | 28

Chef architecture

Central Chef Server

Multiple Administrators

One Repository

Page 18: WebLogic Hackathon: Introduction to Puppet & Chef

18 | 10 18 | 28

Chef| terminology

Node, Server, Workstation

Chef-client asks Chef-server about the policy for the node

Resources: a component and the desired state

Recipes: describe resources and desired state

Cookbooks: sets of recipes grouped together, also includes templates

and source files etc

Run List: recipes from cookbooks you want to run

Role: type of node

Page 19: WebLogic Hackathon: Introduction to Puppet & Chef

19 | 10 19 | 28

Example Recipe

paca

Policy says package

should be installed

This service should be

enabled on reboot, and

must be running

Template specifies the

contents required

Source: Chef Fundamentals Webinar 1 #LEARNCHEF

Page 20: WebLogic Hackathon: Introduction to Puppet & Chef

20 | 10 20 | 28

Open Source Chef Console

I couldn’t find a screenshot of enterprise one!

Page 21: WebLogic Hackathon: Introduction to Puppet & Chef

21 | 10 21 | 28

Configuration Drift

Not just used for initial installation

Chef’s policies means it knows desired state

Chef client runs periodically on node & checks state against policy

Page 22: WebLogic Hackathon: Introduction to Puppet & Chef

22 | 10 22 | 28

Chef in the wild

Enterprise vs. Open Source

Community & Popularity

Pricing (30-nov-2013)

Page 23: WebLogic Hackathon: Introduction to Puppet & Chef

23 | 10 23 | 28

More about Chef

Page 24: WebLogic Hackathon: Introduction to Puppet & Chef

24 | 10 24 | 28

Labs & Competition

Page 25: WebLogic Hackathon: Introduction to Puppet & Chef

25 | 10 25 | 28

Lab| intro

Teams of 3

Choose your poison

Setup & preparation

Hello World

Provision JDK 7

Provision WLS 12c

Page 26: WebLogic Hackathon: Introduction to Puppet & Chef

26 | 10 26 | 28

Lab

VM

controller

JDK 7 WLS 12c

Browser

pro

visi

on

ing

pro

vision

ing

dashboard

VM

agent

JDK 7 WLS 12c pro

visi

on

ing

pro

vision

ing

VM

agent

JDK 7 WLS 12c pro

visi

on

ing

pro

vision

ing

Page 27: WebLogic Hackathon: Introduction to Puppet & Chef

27 | 10 27 | 28

Lab| eternal glory

Best Puppet team !!!

Best Chef team !!!

Best overall team !!!

Prize: Short interview with OTN @ 17.30

Page 28: WebLogic Hackathon: Introduction to Puppet & Chef

28 | 10 28 | 28

Thank you!

Ronald van Luttikhuizen [email protected]

Simon Haslam [email protected]