Presentation

40
An introduction to configuration management with Puppet Rudy Gevaert

Transcript of Presentation

Page 1: Presentation

An introduction to configurationmanagement with Puppet

Rudy Gevaert

Page 2: Presentation

About me

GNU/Linux sysadmin

Post- and Puppetmaster at GhentUniversity

Doing ICT for developmentprojects in Ethiopia and Cuba

http://webworm.org

@rgevaert

[email protected]

Page 3: Presentation

Today’s presentation. . .

From the past to the present

Config management?

Puppet components

Puppet language

Demonstration

Page 4: Presentation

From the past . . .

Page 5: Presentation

. . . to the present

Page 6: Presentation

. . . and the future

Page 7: Presentation

The future is already here — it’s just not very evenly distributed.(William Gibson)

Downloads of Puppet forge modules October 20121

1https://puppetlabs.com/blog/mapping-the-puppet-forge

Page 8: Presentation

Problem of the system administrator

How to manage:

Multiple applications

Different stacks

1000 servers (and more!)

Page 9: Presentation

Problem of the system administrator

How to manage:

Multiple applications

Different stacks

1000 servers (and more!)

Page 10: Presentation

More problems: from a developers perspective

Before:

Monolithic application

Development on the server

Sole developer

Long time to market software

Now:

Distributed application

Set up local dev environment

Multiple teams

Short time to market

How do you build a local development environment that is similar toproduction?

=⇒ Puppet

Page 11: Presentation

More problems: from a developers perspective

Before:

Monolithic application

Development on the server

Sole developer

Long time to market software

Now:

Distributed application

Set up local dev environment

Multiple teams

Short time to market

How do you build a local development environment that is similar toproduction?

=⇒ Puppet

Page 12: Presentation

More problems: from a developers perspective

Before:

Monolithic application

Development on the server

Sole developer

Long time to market software

Now:

Distributed application

Set up local dev environment

Multiple teams

Short time to market

How do you build a local development environment that is similar toproduction?

=⇒ Puppet

Page 13: Presentation

More problems: from a developers perspective

Before:

Monolithic application

Development on the server

Sole developer

Long time to market software

Now:

Distributed application

Set up local dev environment

Multiple teams

Short time to market

How do you build a local development environment that is similar toproduction?

=⇒ Puppet

Page 14: Presentation

What is configuration management?

Is a method to automatically and centrally manage:

the packages,

configuration files

process state

firewall rules

and other settings

to do their assigned job

Without config mgt? Manually or handwritten scripts

Page 15: Presentation

Configuration Management

It’s also about making changes to the system in an organized way soyour servers and modified deliberately and correctly while accountingfor relationships between system components

Page 16: Presentation

Why you need automated configuration

management?

Not automating config mgt causes pain!

Manual errors, custom scripts can be fragile, custom scripts aren’taccessible to everyone, you can’t scale

Configuration management eliminates manual work, and createsdependability and predictability

Page 17: Presentation

Why you need automated configuration

management?

Another problem with the manual-change and script-based approachis the lack of a single source of truth.

Automation makes you productive; lets the people who aredependent on you be more productive; and gives you the time to uplevel your job and your skills.

Spend less time on manual configuration and putting out theinevitable fires

Page 18: Presentation

Who benefits

Everyone benefits from automated configuration management!

Sysadmins get:

visibility into the state of the overall system, and eachcomponent of it

faster identification of problems, and faster remediation

efficiency in performing regular maintenance

documentation, so fixes and updates can be referenced andrepeated an end to 3:00 am emergency calls

Page 19: Presentation

Who benefits

Quality assurance and test engineers get:

the confidence that they’re testing code in an environmentthat’s identical to where the code was created and where it willfinally run

Page 20: Presentation

Who benefits

IT managers get:

visibility into what the IT team is doing: maintenance,remediation, provisioning

faster time to recovery, so greater satisfaction for internal andexternal customers more efficient, predictable operations

better ability to plan

better ability to report to other teams in the company

Page 21: Presentation

Who benefits

The entire company gets:

more stable and dependable systems and software to work on

faster service from IT when things need to be installed or fixed

the ability to expand IT services while containing costs

the confidence to make changes more quickly and learn frommarket response

Customers (the people who pay us!) get:

better products, better services, faster innovation and betterresponse to their needs

Page 22: Presentation

The typical life cycle of a server

⇒ ⇒

Installation andbootstrap

Configure applications Administer system

Automatic installwith net boot orVM image

Puppet Puppet

Page 23: Presentation

The typical life cycle of a server

⇒ ⇒

Installation andbootstrap

Configure applications Administer system

Automatic installwith net boot orVM image

Puppet Puppet

Page 24: Presentation

The typical life cycle of a server

⇒ ⇒

Installation andbootstrap

Configure applications Administer system

Automatic installwith net boot orVM image

Puppet Puppet

Page 25: Presentation

Puppet

Configuration management software developed by Puppetlabs

http://www.puppetlabs.com

Free Software version and Proprietary version (PuppetEnterprise)

Supports: GNU/Linux, Windows, Solaris

Competition: Cfeninge, Chef, Ansible, Saltstack

Page 26: Presentation

Terminology

catalog

modules

nodes

class

manifests

resource

Page 27: Presentation

Components of Puppet

Facter

Puppet master

Puppet agent

PuppetDB

Hiera

Puppet Forge

Puppet Domain Specific Language (DSL)

Page 28: Presentation

Architecture

Page 29: Presentation

Architecture

Page 30: Presentation

Defining State, idempotent

Page 31: Presentation

Puppet DSL

Managing packages

package {

’openssh’:

ensure => present;

}

package {

’vim’:

ensure => absent;

}

Page 32: Presentation

Puppet DSL

Managing services

service {

’apache2’:

ensure => running;

}

Page 33: Presentation

Puppet DSL

Managing files

file {

’/etc/motd’:

ensure => present,

mode => ’0600’,

owner => ’root’,

group => ’root’,

source => ’puppet:///modules/motd/motd’;

}

Page 34: Presentation

Puppet DSL: resource types

augeas

computer

cron

exec

file

filebucket

group

host

interface

k5login

macauthorization

mailalias

maillist

mcx

mount

nagios_command

nagios_contact

nagios_contactgroup

nagios_host

nagios_hostdependency

nagios_hostescalation

nagios_hostextinfo

nagios_hostgroup

nagios_service

nagios_servicedependency

nagios_serviceescalation

nagios_serviceextinfo

nagios_servicegroup

nagios_timeperiod

notify

package

resources

router

schedule

scheduled_task

selboolean

selmodule

service

ssh_authorized_key

sshkey

stage

tidy

user

vlan

yumrepo

zfs

zone

zpool

Page 35: Presentation

Puppet DSL

Managing a node

node ’www.domain.com’ {

include apache

include mysql

}

Page 36: Presentation

Verifying style

puppet-lint and meta-data-json-lint

Page 37: Presentation

How the get started

https://puppetlabs.com/download-learning-vm

https://puppetlabs.com/resources/books

http://ask.puppetlabs.com/questions/

https://docs.puppetlabs.com/puppet/

Page 38: Presentation

Demonstration

Page 39: Presentation

Thank you for your attention.

Questions?

Page 40: Presentation

Pictures...www.theluxuryspot.com/wp-content/uploads/2013/05/Fashion-pug.jpg

plyojump.com/classes/images/computer_history/ibm_360_color.jpg

www.cse.unsw.edu.au/opencms/export/sites/cse/.content/images/

feature_boxes_750x400/server_room.jpg_687647283.jpg www.alvantia.

es/blog/wp-content/uploads/2015/02/cloud-computing.jpg

www.linuxplanet.org/blogs/?cat=177

www.rcesecurity.com/wp-content/uploads/2014/08/tux-egg.jpeg

www.greatleadersserve.com/wp-content/uploads/2012/08/iStock_

000020378687XSmall.jpg https://pensarlaescuela.files.wordpress.com/

2015/03/persona-en-rueda-de-entrenamiento.jpg

doc.ubuntu-fr.org/_media/administration/puppet.png https://docs.

puppetlabs.com/pe/latest/images/puppet/pe-configuration-data.png

https://docs.puppetlabs.com/learning/images/manifest_to_defined_

state_split.png