using puppet and cobbler to automate your infrastructure

89
Using Puppet and Cobbler to Automate Your Infrastructure Phillip J. Windley, Ph.D Founder and CTO Kynetx www.kynetx.com 1 Monday, October 12, 2009

Upload: phil-windley

Post on 15-Jan-2015

10.591 views

Category:

Technology


1 download

DESCRIPTION

Using tools to automate your infrastructure will let you sleep through the night. In addition, you'll have o hire fewer people, scale to meet demand more quickly, and make fewer mistakes.

TRANSCRIPT

Page 1: Using Puppet and Cobbler to Automate Your Infrastructure

Using Puppet and Cobbler to Automate Your InfrastructurePhillip J. Windley, Ph.DFounder and CTOKynetxwww.kynetx.com

1Monday, October 12, 2009

Page 2: Using Puppet and Cobbler to Automate Your Infrastructure

Sleeping Through the NightPhillip J. Windley, Ph.DFounder and CTOKynetxwww.kynetx.com

2Monday, October 12, 2009

Page 3: Using Puppet and Cobbler to Automate Your Infrastructure

(afford|scal|reli)ability

3Monday, October 12, 2009

Page 4: Using Puppet and Cobbler to Automate Your Infrastructure

hire fewer people

4Monday, October 12, 2009

Page 5: Using Puppet and Cobbler to Automate Your Infrastructure

meet demand quickly

5Monday, October 12, 2009

Page 6: Using Puppet and Cobbler to Automate Your Infrastructure

make fewer mistakes

6Monday, October 12, 2009

Page 7: Using Puppet and Cobbler to Automate Your Infrastructure

7Monday, October 12, 2009

Page 8: Using Puppet and Cobbler to Automate Your Infrastructure

8Monday, October 12, 2009

Page 9: Using Puppet and Cobbler to Automate Your Infrastructure

8Monday, October 12, 2009

Page 10: Using Puppet and Cobbler to Automate Your Infrastructure

8Monday, October 12, 2009

Page 11: Using Puppet and Cobbler to Automate Your Infrastructure

9Monday, October 12, 2009

Page 12: Using Puppet and Cobbler to Automate Your Infrastructure

1. machine provisioning

9Monday, October 12, 2009

Page 13: Using Puppet and Cobbler to Automate Your Infrastructure

1. machine provisioning

2. system configuration

9Monday, October 12, 2009

Page 14: Using Puppet and Cobbler to Automate Your Infrastructure

1. machine provisioning

2. system configuration

3. deployment

9Monday, October 12, 2009

Page 15: Using Puppet and Cobbler to Automate Your Infrastructure

10Monday, October 12, 2009

Page 16: Using Puppet and Cobbler to Automate Your Infrastructure

provisioning

11Monday, October 12, 2009

Page 17: Using Puppet and Cobbler to Automate Your Infrastructure

machine provisioning

12Monday, October 12, 2009

Page 18: Using Puppet and Cobbler to Automate Your Infrastructure

manage images & repositories

machine provisioning

12Monday, October 12, 2009

Page 19: Using Puppet and Cobbler to Automate Your Infrastructure

manage images & repositories

kickstart machines

machine provisioning

12Monday, October 12, 2009

Page 20: Using Puppet and Cobbler to Automate Your Infrastructure

manage images & repositories

kickstart machines

handle physical and virtual hardware

machine provisioning

12Monday, October 12, 2009

Page 21: Using Puppet and Cobbler to Automate Your Infrastructure

manage images & repositories

kickstart machines

handle physical and virtual hardware

set up DHCP and DNS

machine provisioning

12Monday, October 12, 2009

Page 22: Using Puppet and Cobbler to Automate Your Infrastructure

13Monday, October 12, 2009

Page 23: Using Puppet and Cobbler to Automate Your Infrastructure

cobbler is a collection of tools that support

machine provisioning

13Monday, October 12, 2009

Page 24: Using Puppet and Cobbler to Automate Your Infrastructure

14Monday, October 12, 2009

Page 25: Using Puppet and Cobbler to Automate Your Infrastructure

dnsdhcp

power

cobblerd

14Monday, October 12, 2009

Page 26: Using Puppet and Cobbler to Automate Your Infrastructure

dnsdhcp

power

cobblerd

imageskickstart

repos

cobblerweb

14Monday, October 12, 2009

Page 27: Using Puppet and Cobbler to Automate Your Infrastructure

koan

dnsdhcp

power

cobblerd

imageskickstart

repos

cobblerweb

14Monday, October 12, 2009

Page 28: Using Puppet and Cobbler to Automate Your Infrastructure

cobbler uses a collection of specifications that

define your systems

15Monday, October 12, 2009

Page 29: Using Puppet and Cobbler to Automate Your Infrastructure

16Monday, October 12, 2009

Page 30: Using Puppet and Cobbler to Automate Your Infrastructure

distro

16Monday, October 12, 2009

Page 31: Using Puppet and Cobbler to Automate Your Infrastructure

distro

profile repo

16Monday, October 12, 2009

Page 32: Using Puppet and Cobbler to Automate Your Infrastructure

distro

profile repo

system

16Monday, October 12, 2009

Page 33: Using Puppet and Cobbler to Automate Your Infrastructure

import a distrocobbler import --mirror ~/fc8 --name fc8

17Monday, October 12, 2009

Page 34: Using Puppet and Cobbler to Automate Your Infrastructure

import a distrocobbler import --mirror ~/fc8 --name fc8

create a profilecobbler profile add --name=base-fc8 --distro=fc8-xen-i386 --kickstart=/root/base-fc8.ks --repos=fc8-newkey-repo

17Monday, October 12, 2009

Page 35: Using Puppet and Cobbler to Automate Your Infrastructure

import a distrocobbler import --mirror ~/fc8 --name fc8

create a profilecobbler profile add --name=base-fc8 --distro=fc8-xen-i386 --kickstart=/root/base-fc8.ks --repos=fc8-newkey-repo

define a systemcobbler system add --name=log0 --mac=00:16:3E:4B:40:00 --ip=192.168.122.180 --profile=base-fc8 --hostname=log0

17Monday, October 12, 2009

Page 36: Using Puppet and Cobbler to Automate Your Infrastructure

building a machinekoan --server=cobbler.kobj.net --virt --nogfx --system=log0

18Monday, October 12, 2009

Page 37: Using Puppet and Cobbler to Automate Your Infrastructure

configuration

19Monday, October 12, 2009

Page 38: Using Puppet and Cobbler to Automate Your Infrastructure

system configuration

20Monday, October 12, 2009

Page 39: Using Puppet and Cobbler to Automate Your Infrastructure

critical services on or off

system configuration

20Monday, October 12, 2009

Page 40: Using Puppet and Cobbler to Automate Your Infrastructure

critical services on or off

security systems configured correctly

system configuration

20Monday, October 12, 2009

Page 41: Using Puppet and Cobbler to Automate Your Infrastructure

critical services on or off

security systems configured correctly

users created

system configuration

20Monday, October 12, 2009

Page 42: Using Puppet and Cobbler to Automate Your Infrastructure

critical services on or off

security systems configured correctly

users created

necessary libraries in place

system configuration

20Monday, October 12, 2009

Page 43: Using Puppet and Cobbler to Automate Your Infrastructure

critical services on or off

security systems configured correctly

users created

necessary libraries in place

right packages built & installed

system configuration

20Monday, October 12, 2009

Page 44: Using Puppet and Cobbler to Automate Your Infrastructure

21Monday, October 12, 2009

Page 45: Using Puppet and Cobbler to Automate Your Infrastructure

puppet is a language for specifying desired system

configuration

21Monday, October 12, 2009

Page 46: Using Puppet and Cobbler to Automate Your Infrastructure

installpackage

22Monday, October 12, 2009

Page 47: Using Puppet and Cobbler to Automate Your Infrastructure

installpackage

configure

22Monday, October 12, 2009

Page 48: Using Puppet and Cobbler to Automate Your Infrastructure

installpackage

configure

configuration should be modified

after package installation

22Monday, October 12, 2009

Page 49: Using Puppet and Cobbler to Automate Your Infrastructure

installpackage

configure

service

configuration should be modified

after package installation

22Monday, October 12, 2009

Page 50: Using Puppet and Cobbler to Automate Your Infrastructure

installpackage

configure

service

configuration should be modified

after package installation

service should restart whenever

configuration changes

22Monday, October 12, 2009

Page 51: Using Puppet and Cobbler to Automate Your Infrastructure

yum install openssh-servervi /etc/ssh/sshd_configservice sshd start

the hard way

23Monday, October 12, 2009

Page 52: Using Puppet and Cobbler to Automate Your Infrastructure

class ssh { package { ssh: ensure => installed } file { sshd_config: name => “/etc/ssh/sshd_config”, owner=> root, source => “puppet://server/apps/ssh/…”, after => Package[ssh] } service { sshd: ensure => running, subscribe => [Package[ssh], File[sshd_config]] }}

the puppet way

24Monday, October 12, 2009

Page 53: Using Puppet and Cobbler to Automate Your Infrastructure

class ssh { package { ssh: ensure => installed } file { sshd_config: name => “/etc/ssh/sshd_config”, owner=> root, source => “puppet://server/apps/ssh/…”, after => Package[ssh] } service { sshd: ensure => running, subscribe => [Package[ssh], File[sshd_config]] }}

the puppet way

24Monday, October 12, 2009

Page 54: Using Puppet and Cobbler to Automate Your Infrastructure

class ssh { package { ssh: ensure => installed } file { sshd_config: name => “/etc/ssh/sshd_config”, owner=> root, source => “puppet://server/apps/ssh/…”, after => Package[ssh] } service { sshd: ensure => running, subscribe => [Package[ssh], File[sshd_config]] }}

the puppet way

24Monday, October 12, 2009

Page 55: Using Puppet and Cobbler to Automate Your Infrastructure

wait a minute…that looks like a lot more lines to me!

25Monday, October 12, 2009

Page 56: Using Puppet and Cobbler to Automate Your Infrastructure

deployment

26Monday, October 12, 2009

Page 57: Using Puppet and Cobbler to Automate Your Infrastructure

requirements

27Monday, October 12, 2009

Page 58: Using Puppet and Cobbler to Automate Your Infrastructure

deployment happens over & over again

requirements

27Monday, October 12, 2009

Page 59: Using Puppet and Cobbler to Automate Your Infrastructure

deployment happens over & over again

controlled, not continuous

requirements

27Monday, October 12, 2009

Page 60: Using Puppet and Cobbler to Automate Your Infrastructure

deployment happens over & over again

controlled, not continuous

role-based

requirements

27Monday, October 12, 2009

Page 61: Using Puppet and Cobbler to Automate Your Infrastructure

deployment happens over & over again

controlled, not continuous

role-based

remotable

requirements

27Monday, October 12, 2009

Page 62: Using Puppet and Cobbler to Automate Your Infrastructure

now for deployment...

28Monday, October 12, 2009

Page 63: Using Puppet and Cobbler to Automate Your Infrastructure

now for deployment...

28Monday, October 12, 2009

Page 64: Using Puppet and Cobbler to Automate Your Infrastructure

now for deployment...

28Monday, October 12, 2009

Page 65: Using Puppet and Cobbler to Automate Your Infrastructure

now for deployment...

28Monday, October 12, 2009

Page 66: Using Puppet and Cobbler to Automate Your Infrastructure

in the end…I just wrote it in Perl

in a few hours

29Monday, October 12, 2009

Page 67: Using Puppet and Cobbler to Automate Your Infrastructure

[root@ops deploy]# ./deploy.pl -d

The following tasks are configured:deploy | Export a new copy of the codeinstall | deploy, initialize, restartuninstall | rollback code, initialize,restart start_httpd | Start the HTTP serverrollback | Rollback to the deploystop_httpd | Stop the HTTP servertest_server | Run the appropriate server testcleanup | Remove old copies of codetest_code | Run the all tests configure_httpd| Build the httpd.conf file install_init | Install the init JS filesrestart_httpd | Restart the HTTP server

30Monday, October 12, 2009

Page 68: Using Puppet and Cobbler to Automate Your Infrastructure

[root@ops deploy]# ./deploy.pl -s

server | version-----------------------|---------------- init0.kobj.net | 340M init1.kobj.net | 340M log.kobj.net | 340 log0.kobj.net | 340 log1.kobj.net | 340 krl.kobj.net | 340 cs0.kobj.net | 341 cs1.kobj.net | 341 cs2.kobj.net | 341 cs3.kobj.net | 341

31Monday, October 12, 2009

Page 69: Using Puppet and Cobbler to Automate Your Infrastructure

[root@ops deploy]# ./deploy.pl -m krl -t install

Performing install on krl with role krl...A /web/lib/releases/perl_0910091229/ops...A /web/lib/releases/perl_0910091229/startup.plA /web/lib/releases/perl_0910091229/Kynetx.pmA /web/lib/releases/perl_0910091229/READMEChecked out revision 342.Writing /web/conf/httpd.confStopping httpd: [ OK ]Starting httpd: [ OK ]Testing RuleManager.....okAll tests successful.Files=1, Tests=73, 8 wallclock secs ...Result: PASS

32Monday, October 12, 2009

Page 70: Using Puppet and Cobbler to Automate Your Infrastructure

TODO

33Monday, October 12, 2009

Page 71: Using Puppet and Cobbler to Automate Your Infrastructure

TODO

configuration database

33Monday, October 12, 2009

Page 72: Using Puppet and Cobbler to Automate Your Infrastructure

TODO

configuration database

(more) automated testing

33Monday, October 12, 2009

Page 73: Using Puppet and Cobbler to Automate Your Infrastructure

TODO

configuration database

(more) automated testing

continuous integration

33Monday, October 12, 2009

Page 74: Using Puppet and Cobbler to Automate Your Infrastructure

results

34Monday, October 12, 2009

Page 75: Using Puppet and Cobbler to Automate Your Infrastructure

35Monday, October 12, 2009

Page 76: Using Puppet and Cobbler to Automate Your Infrastructure

kynetx can stand up a

new server in < 30 minutes

36Monday, October 12, 2009

Page 77: Using Puppet and Cobbler to Automate Your Infrastructure

uptime99.99772%

downtime*0.00229%

our servers stay up

* includes scheduled maintenance

37Monday, October 12, 2009

Page 78: Using Puppet and Cobbler to Automate Your Infrastructure

Warning!38Monday, October 12, 2009

Page 79: Using Puppet and Cobbler to Automate Your Infrastructure

Warning!38Monday, October 12, 2009

Page 80: Using Puppet and Cobbler to Automate Your Infrastructure

lessons learned

39Monday, October 12, 2009

Page 81: Using Puppet and Cobbler to Automate Your Infrastructure

lessons learned

architect for (afford|scal|reli)ability

39Monday, October 12, 2009

Page 82: Using Puppet and Cobbler to Automate Your Infrastructure

lessons learned

architect for (afford|scal|reli)ability

insist on consistency & repeatability

39Monday, October 12, 2009

Page 83: Using Puppet and Cobbler to Automate Your Infrastructure

lessons learned

architect for (afford|scal|reli)ability

insist on consistency & repeatability

document process with code

39Monday, October 12, 2009

Page 84: Using Puppet and Cobbler to Automate Your Infrastructure

lessons learned

architect for (afford|scal|reli)ability

insist on consistency & repeatability

document process with code

rolling releases and change control

39Monday, October 12, 2009

Page 85: Using Puppet and Cobbler to Automate Your Infrastructure

lessons learned

architect for (afford|scal|reli)ability

insist on consistency & repeatability

document process with code

rolling releases and change control

put ops procedures online

39Monday, October 12, 2009

Page 87: Using Puppet and Cobbler to Automate Your Infrastructure

Nov 18-19, 2009, Provo UT

41Monday, October 12, 2009

Page 88: Using Puppet and Cobbler to Automate Your Infrastructure

Nov 18-19, 2009, Provo UT

Use discount code Windley50

www.kynetx.com

41Monday, October 12, 2009

Page 89: Using Puppet and Cobbler to Automate Your Infrastructure

Contact info:[email protected]

www.windley.com@windley

Sleeping Through the Night

FREE Context Automation

White Paper at Kynetx Booth

Sign up free: http://www.kynetx.com/signup

42Monday, October 12, 2009