SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
TUTORIAL AND HANDS ON SESSION
*
Christoph Oelmüller
Christoph.oelmueller@epost-dev.de
*
*why configuration management?
*puppet DSL - declarative resources instead of
procedural code
*writing Puppet manifests
*anatomy of a Puppet run
*using Puppet without/with a master
*nice2knows
*master of Puppets (hands on)
*nice2know cont.
*Q & A
*
Lazy admins, DevOps and Managers
*
admins are generally as lazy as
possible...
for s in $(<some_outdated_list.txt)
do
ssh $s „/bin/false“
done
http://optempo.com/images/trained_monkey.gi
f
*
manually
ssh loop
centralized procedural
• sequential – slow
• system-dependant
• inventory-dependant
• what about
authorization?
*
* from dev to prod
* reproducable configurations
* system (*nix flavour) independency
DEV TEST PROD
*
* managed „things“ can...
* ...be compliant
* ...be reported
* ...fullfill security requirements
*
http://wikipedia.org
http://www.business-cloud.de/cloudstorage-ja-aber-bitte-sicher/
*
declarative resources instead of procedural code
*
1. describe what you want to be configured
2. (don‘t care how it is done)
3. describe dependencies
file package service types
win *nix deb rpm POSIX win providers
package{„ntp“:
ensure => installed
}
file{„/etc/ntp.conf“:
ensure => present,
user => root,
group => root,
mode => 644,
source => puppet://...
}
service{„/etc/ntp.conf“:
ensure => running,
}
package{„ntp“:
ensure => installed
}
file{„/etc/ntp.conf“:
ensure => present,
user => root,
group => root,
mode => 644,
source => puppet://...,
require => Package[‚ntp‘]
}
service{„ntpd“:
ensure => running,
require => File[‚/etc/ntp.conf‘]
}
*
before after
without refresh before => Resource[‚name‘] require => Resource[‚name‘]
with refresh notify => Resource[‚name‘] subscribe => Resource[‚name‘]
in our resources
chaining syntax
Resource[‚‘] -> Resource[‚name‘] ~> Resource[‚name‘]
*
1. retreive plugins
from server
2. get „facts“ on client
and send them to
master
3. compile catalog and
send it to the client
4. apply catalog on
client
5. process report
*
* Manifest: your Puppet DSL (*.pp)
* Catalog: serialized host specific DSL
* Facts: host specific set of vars
* Plugins: puppet extensions
* facts, types, providers, reports...
*
[root@puppet ~]# facter
architecture => x86_64
augeasversion => 0.9.0
bios_release_date => 12/01/2006
bios_vendor => innotek GmbH
bios_version => VirtualBox
blockdevice_sda_model => VBOX HARDDISK
blockdevice_sda_size => 214748364800
blockdevice_sda_vendor => ATA
domain => example.com
facterversion => 1.7.2
filesystems => ext4,iso9660
fqdn => puppet.example.com
hardwareisa => x86_64
hardwaremodel => x86_64
hostname => puppet
id => root
interfaces => eth0,lo
ipaddress => 10.0.2.15
ipaddress_eth0 => 10.0.2.15
ipaddress_lo => 127.0.0.1
is_virtual => true
kernel => Linux
*
node definitions & modules & delivering content
*
%manifestdir/site.pp:
node frontend.example.com {
file{‚/etc/apache2/httpd.conf‘:
ensure => present,
...
}
...
}
node db1.example.com {
...
}
*
%manifestdir/site.pp:
node frontend.example.com {
# file{‚/etc/apache2/httpd.con‘:
# ensure => present,
# ...
#}
include apache2
# class{„apache2“:}
}
node db1.example.com {
...
}
*
directory structure in %modulepath:
mkdir –p modulename/{manifests,files,templates,lib,spec}
- manifests : where your .pp goes
- files : where your static content goes
- templates : where your dynamic content goes
(remember facts)
- lib : where your advanced puppet knowledge goes
- specs : home of Q&A‘s happiness
*
%modulepath/modulename/manifests/init.pp:
class modulename() {
file{„/tmp/testfile.conf“:
ensure => present,
...
}
package{„mypackage“:
ensure => latest,
}
service{„myinitscript“:
ensure => running
}
}
*
# static file content
file{„/tmp/testfile1.conf“:
ensure => present,
source => „puppet://mymodule/testfile1.conf“
}
# templating
file{„/tmp/testfile2.conf“:
ensure => present,
content => template(„testfile2.conf.erb“)
}
*
one binary to rule them all - faces
[root@puppet ~]# puppet help
Usage: puppet <subcommand> [options] <action> [options]
Available subcommands:
agent The puppet agent daemon
apply Apply Puppet manifests locally
cert Manage certificates and requests
master The puppet master daemon
module Creates, installs and searches for modules on the Puppet Forge.
parser Interact directly with the parser.
puppet apply:
• apply manifests locally
• no master needed
• no centralized fileserver
• test
• headless puppet
• no SSL-communication allowed
[root@puppet ~]# puppet help
Usage: puppet <subcommand> [options] <action> [options]
Available subcommands:
agent The puppet agent daemon
apply Apply Puppet manifests locally
cert Manage certificates and requests
master The puppet master daemon
module Creates, installs and searches for modules on the Puppet Forge.
parser Interact directly with the parser.
puppet master:
• starts https service
• TCP/8140
• internal webserver (ruby)
• scalable (mod_passenger)
puppet agent:
• manages puppet runs on client
• regularly
• one-time
[root@puppet ~]# puppet help
Usage: puppet <subcommand> [options] <action> [options]
Available subcommands:
agent The puppet agent daemon
apply Apply Puppet manifests locally
cert Manage certificates and requests
master The puppet master daemon
module Creates, installs and searches for modules on the Puppet Forge.
parser Interact directly with the parser.
puppet module:
• interacts with puppetlabs module repository
puppet parser validate:
• syntax check manifests
*
pre-Hands-On...
*
* find puppets configuration:
* puppet config print
* puppet.conf (PE vs. OSE)
* debugging puppet:
* puppet parser validate <file.pp>
* puppet agent/apply –-noop (use it!!!)
* running agent in „test“ mode
* includes one-time
* includes verbose
* doesn‘t include noop!!!
*
Hands-On
*
* connect to your learning instance and play around a bit
* launch puppet help
* launch a puppet master
* launch a client side puppet run
* find configuration files
* inspect the process list / ports
* find your manifests, site.pp, modules
* create an empty testfile via local puppet run
* implement a NTP module _1
* make sure NTPd is installed
* deliver your ntp.conf via puppet
* make sure NTPd is running
pingyourselfifidle:pinglocalhost
*
* implement a NTP module _2
* make sure NTPd is installed
* deliver your ntp.conf via puppet – dynamic content
* make sure NTPd is running
pingyourselfifidle:pinglocalhost
*
* implement a NTP module _3
* make sure NTPd is installed
* deliver your ntp.conf via puppet
* dynamic file content
* make sure NTPd is running
* first install NTPd, then configure it, then handle the service
* restart the service, if configuration file has been changed
pingyourselfifidle:pinglocalhost
*
post-Hands-On...
*
* puppets internal CA
* on master: puppet cert --list --all
* on client: NIL
* rm –rf /var/lib/puppet/ssl
* don‘t repeat others
* forge.puppetlabs.com – puppet module
* ask others:
*ask.puppetlabs.com
*
* resource ordering f*ck-ups?!
* puppet agent –t –-graph --noop
externalinternal
regulary
one-time
*
* how to trigger a puppet run?
puppet agent
cron‘d one-
time
ssh‘d one-
time
MCollective
*
got questions?
*
vagrant & puppet

Weitere ähnliche Inhalte

Was ist angesagt?

How to recognise that the user has just uninstalled your android app droidc...
How to recognise that the user has just uninstalled your android app   droidc...How to recognise that the user has just uninstalled your android app   droidc...
How to recognise that the user has just uninstalled your android app droidc...Przemek Jakubczyk
 
The event-driven nature of javascript – IPC2012
The event-driven nature of javascript – IPC2012The event-driven nature of javascript – IPC2012
The event-driven nature of javascript – IPC2012Martin Schuhfuß
 
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015Takayuki Shimizukawa
 
Scraping recalcitrant web sites with Python & Selenium
Scraping recalcitrant web sites with Python & SeleniumScraping recalcitrant web sites with Python & Selenium
Scraping recalcitrant web sites with Python & SeleniumRoger Barnes
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical StuffPetr Dvorak
 
Puppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the ForgePuppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the ForgePuppet
 
Clojurescript up and running
Clojurescript up and runningClojurescript up and running
Clojurescript up and runningTimo Sulg
 
Nginx Workshop Aftermath
Nginx Workshop AftermathNginx Workshop Aftermath
Nginx Workshop AftermathDenis Zhdanov
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shellsascha_klein
 
Hubot: a look inside our robot friend
Hubot: a look inside our robot friendHubot: a look inside our robot friend
Hubot: a look inside our robot friendajacksified
 
Debugging in Clojure: Finding Light in the Darkness using Emacs and Cursive
Debugging in Clojure: Finding Light in the Darkness using Emacs and CursiveDebugging in Clojure: Finding Light in the Darkness using Emacs and Cursive
Debugging in Clojure: Finding Light in the Darkness using Emacs and CursiveAhmad Ragab
 
Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet
 
Building and Testing Puppet with Docker
Building and Testing Puppet with DockerBuilding and Testing Puppet with Docker
Building and Testing Puppet with Dockercarlaasouza
 
Web backends development using Python
Web backends development using PythonWeb backends development using Python
Web backends development using PythonAyun Park
 
How to build a slack-hubot with js
How to build a slack-hubot with jsHow to build a slack-hubot with js
How to build a slack-hubot with jsJuneyoung Oh
 
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013Puppet
 
Reactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/OReactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/OArawn Park
 
Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Eric Hogue
 
Debian 5 Hardening Tips
Debian 5 Hardening TipsDebian 5 Hardening Tips
Debian 5 Hardening Tipss3m1llon
 

Was ist angesagt? (20)

How to recognise that the user has just uninstalled your android app droidc...
How to recognise that the user has just uninstalled your android app   droidc...How to recognise that the user has just uninstalled your android app   droidc...
How to recognise that the user has just uninstalled your android app droidc...
 
The event-driven nature of javascript – IPC2012
The event-driven nature of javascript – IPC2012The event-driven nature of javascript – IPC2012
The event-driven nature of javascript – IPC2012
 
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015
 
Intro django
Intro djangoIntro django
Intro django
 
Scraping recalcitrant web sites with Python & Selenium
Scraping recalcitrant web sites with Python & SeleniumScraping recalcitrant web sites with Python & Selenium
Scraping recalcitrant web sites with Python & Selenium
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical Stuff
 
Puppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the ForgePuppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the Forge
 
Clojurescript up and running
Clojurescript up and runningClojurescript up and running
Clojurescript up and running
 
Nginx Workshop Aftermath
Nginx Workshop AftermathNginx Workshop Aftermath
Nginx Workshop Aftermath
 
Groovy on the Shell
Groovy on the ShellGroovy on the Shell
Groovy on the Shell
 
Hubot: a look inside our robot friend
Hubot: a look inside our robot friendHubot: a look inside our robot friend
Hubot: a look inside our robot friend
 
Debugging in Clojure: Finding Light in the Darkness using Emacs and Cursive
Debugging in Clojure: Finding Light in the Darkness using Emacs and CursiveDebugging in Clojure: Finding Light in the Darkness using Emacs and Cursive
Debugging in Clojure: Finding Light in the Darkness using Emacs and Cursive
 
Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013
 
Building and Testing Puppet with Docker
Building and Testing Puppet with DockerBuilding and Testing Puppet with Docker
Building and Testing Puppet with Docker
 
Web backends development using Python
Web backends development using PythonWeb backends development using Python
Web backends development using Python
 
How to build a slack-hubot with js
How to build a slack-hubot with jsHow to build a slack-hubot with js
How to build a slack-hubot with js
 
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013
PuppetDB: New Adventures in Higher-Order Automation - PuppetConf 2013
 
Reactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/OReactive Web - Servlet & Async, Non-blocking I/O
Reactive Web - Servlet & Async, Non-blocking I/O
 
Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014Getting started with TDD - Confoo 2014
Getting started with TDD - Confoo 2014
 
Debian 5 Hardening Tips
Debian 5 Hardening TipsDebian 5 Hardening Tips
Debian 5 Hardening Tips
 

Andere mochten auch

OpenMagazine: interoperabilità tra il CMS eZ Publish ed Adobe InDesign
OpenMagazine: interoperabilità tra il CMS eZ Publish ed Adobe InDesignOpenMagazine: interoperabilità tra il CMS eZ Publish ed Adobe InDesign
OpenMagazine: interoperabilità tra il CMS eZ Publish ed Adobe InDesignGabriele Francescotto
 
eZ magazine: soluzione completa per la gestione multicanale della tua rivista
eZ magazine: soluzione completa per la gestione multicanale della tua rivistaeZ magazine: soluzione completa per la gestione multicanale della tua rivista
eZ magazine: soluzione completa per la gestione multicanale della tua rivistaGabriele Francescotto
 
Recurring calendar
Recurring calendarRecurring calendar
Recurring calendarJoe Kepley
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with ChefJoe Kepley
 
Automated infrastructure is on the menu
Automated infrastructure is on the menuAutomated infrastructure is on the menu
Automated infrastructure is on the menujtimberman
 
ComunWeb: Portali istituzionali e qualità dei dati aperti
ComunWeb: Portali istituzionali e qualità dei dati apertiComunWeb: Portali istituzionali e qualità dei dati aperti
ComunWeb: Portali istituzionali e qualità dei dati apertiGabriele Francescotto
 
Published in 1885 and shared on facebook
Published in 1885 and shared on facebookPublished in 1885 and shared on facebook
Published in 1885 and shared on facebookJoe Kepley
 
Open Entrepreneurship: Exploring the Role of Entrepreneurs in Private-collect...
Open Entrepreneurship: Exploring the Role of Entrepreneurs in Private-collect...Open Entrepreneurship: Exploring the Role of Entrepreneurs in Private-collect...
Open Entrepreneurship: Exploring the Role of Entrepreneurs in Private-collect...Paul Di Gangi
 
eZ Openmagazine: Automating multi-channel content creation for your digital f...
eZ Openmagazine: Automating multi-channel content creation for your digital f...eZ Openmagazine: Automating multi-channel content creation for your digital f...
eZ Openmagazine: Automating multi-channel content creation for your digital f...Gabriele Francescotto
 

Andere mochten auch (13)

eZ publish for Magazine
eZ publish for MagazineeZ publish for Magazine
eZ publish for Magazine
 
OpenMagazine: interoperabilità tra il CMS eZ Publish ed Adobe InDesign
OpenMagazine: interoperabilità tra il CMS eZ Publish ed Adobe InDesignOpenMagazine: interoperabilità tra il CMS eZ Publish ed Adobe InDesign
OpenMagazine: interoperabilità tra il CMS eZ Publish ed Adobe InDesign
 
eZ magazine: soluzione completa per la gestione multicanale della tua rivista
eZ magazine: soluzione completa per la gestione multicanale della tua rivistaeZ magazine: soluzione completa per la gestione multicanale della tua rivista
eZ magazine: soluzione completa per la gestione multicanale della tua rivista
 
eZ magazine a Webtech
eZ magazine a WebtecheZ magazine a Webtech
eZ magazine a Webtech
 
Presentazione ComunWeb
Presentazione ComunWebPresentazione ComunWeb
Presentazione ComunWeb
 
Recurring calendar
Recurring calendarRecurring calendar
Recurring calendar
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with Chef
 
Automated infrastructure is on the menu
Automated infrastructure is on the menuAutomated infrastructure is on the menu
Automated infrastructure is on the menu
 
ComunWeb: Portali istituzionali e qualità dei dati aperti
ComunWeb: Portali istituzionali e qualità dei dati apertiComunWeb: Portali istituzionali e qualità dei dati aperti
ComunWeb: Portali istituzionali e qualità dei dati aperti
 
ComunWeb e Open Data
ComunWeb e Open DataComunWeb e Open Data
ComunWeb e Open Data
 
Published in 1885 and shared on facebook
Published in 1885 and shared on facebookPublished in 1885 and shared on facebook
Published in 1885 and shared on facebook
 
Open Entrepreneurship: Exploring the Role of Entrepreneurs in Private-collect...
Open Entrepreneurship: Exploring the Role of Entrepreneurs in Private-collect...Open Entrepreneurship: Exploring the Role of Entrepreneurs in Private-collect...
Open Entrepreneurship: Exploring the Role of Entrepreneurs in Private-collect...
 
eZ Openmagazine: Automating multi-channel content creation for your digital f...
eZ Openmagazine: Automating multi-channel content creation for your digital f...eZ Openmagazine: Automating multi-channel content creation for your digital f...
eZ Openmagazine: Automating multi-channel content creation for your digital f...
 

Ähnlich wie Introduction to puppet - Hands on Session at HPI Potsdam

Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with PuppetAlessandro Franceschi
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with PuppetOlinData
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013grim_radical
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasaggarrett honeycutt
 
Dexterity in 15 minutes or less
Dexterity in 15 minutes or lessDexterity in 15 minutes or less
Dexterity in 15 minutes or lessrijk.stofberg
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012Carlos Sanchez
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
monitoring configuration management - from dev to prod
monitoring configuration management - from dev to prodmonitoring configuration management - from dev to prod
monitoring configuration management - from dev to prodChristoph Oelmüller
 
Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk GötzNETWAYS
 
Provisioning with Puppet
Provisioning with PuppetProvisioning with Puppet
Provisioning with PuppetJoe Ray
 
From Dev to DevOps
From Dev to DevOpsFrom Dev to DevOps
From Dev to DevOpsAgile Spain
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetOmar Reygaert
 
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011Carlos Sanchez
 
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...Puppet
 
Puppet modules: An Holistic Approach
Puppet modules: An Holistic ApproachPuppet modules: An Holistic Approach
Puppet modules: An Holistic ApproachAlessandro Franceschi
 
Learning Puppet Chapter 1
Learning Puppet Chapter 1Learning Puppet Chapter 1
Learning Puppet Chapter 1Vishal Biyani
 
Taking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and PuppetTaking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and PuppetPuppet
 

Ähnlich wie Introduction to puppet - Hands on Session at HPI Potsdam (20)

Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with Puppet
 
Puppet quick start guide
Puppet quick start guidePuppet quick start guide
Puppet quick start guide
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with Puppet
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
Phing
PhingPhing
Phing
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
 
Dexterity in 15 minutes or less
Dexterity in 15 minutes or lessDexterity in 15 minutes or less
Dexterity in 15 minutes or less
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
monitoring configuration management - from dev to prod
monitoring configuration management - from dev to prodmonitoring configuration management - from dev to prod
monitoring configuration management - from dev to prod
 
Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk Götz
 
Provisioning with Puppet
Provisioning with PuppetProvisioning with Puppet
Provisioning with Puppet
 
From Dev to DevOps
From Dev to DevOpsFrom Dev to DevOps
From Dev to DevOps
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - ApacheCON NA 2011
 
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
 
Puppet modules: An Holistic Approach
Puppet modules: An Holistic ApproachPuppet modules: An Holistic Approach
Puppet modules: An Holistic Approach
 
Learning Puppet Chapter 1
Learning Puppet Chapter 1Learning Puppet Chapter 1
Learning Puppet Chapter 1
 
Taking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and PuppetTaking Control of Chaos with Docker and Puppet
Taking Control of Chaos with Docker and Puppet
 

Kürzlich hochgeladen

React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...itnewsafrica
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sectoritnewsafrica
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 

Kürzlich hochgeladen (20)

React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 

Introduction to puppet - Hands on Session at HPI Potsdam

  • 1. TUTORIAL AND HANDS ON SESSION * Christoph Oelmüller Christoph.oelmueller@epost-dev.de
  • 2. * *why configuration management? *puppet DSL - declarative resources instead of procedural code *writing Puppet manifests *anatomy of a Puppet run *using Puppet without/with a master *nice2knows *master of Puppets (hands on) *nice2know cont. *Q & A
  • 3. * Lazy admins, DevOps and Managers
  • 4. * admins are generally as lazy as possible... for s in $(<some_outdated_list.txt) do ssh $s „/bin/false“ done http://optempo.com/images/trained_monkey.gi f
  • 5. * manually ssh loop centralized procedural • sequential – slow • system-dependant • inventory-dependant • what about authorization?
  • 6. * * from dev to prod * reproducable configurations * system (*nix flavour) independency DEV TEST PROD
  • 7. * * managed „things“ can... * ...be compliant * ...be reported * ...fullfill security requirements
  • 9. * declarative resources instead of procedural code
  • 10. * 1. describe what you want to be configured 2. (don‘t care how it is done) 3. describe dependencies file package service types win *nix deb rpm POSIX win providers
  • 11. package{„ntp“: ensure => installed } file{„/etc/ntp.conf“: ensure => present, user => root, group => root, mode => 644, source => puppet://... } service{„/etc/ntp.conf“: ensure => running, }
  • 12. package{„ntp“: ensure => installed } file{„/etc/ntp.conf“: ensure => present, user => root, group => root, mode => 644, source => puppet://..., require => Package[‚ntp‘] } service{„ntpd“: ensure => running, require => File[‚/etc/ntp.conf‘] }
  • 13. * before after without refresh before => Resource[‚name‘] require => Resource[‚name‘] with refresh notify => Resource[‚name‘] subscribe => Resource[‚name‘] in our resources chaining syntax Resource[‚‘] -> Resource[‚name‘] ~> Resource[‚name‘]
  • 14. *
  • 15. 1. retreive plugins from server 2. get „facts“ on client and send them to master 3. compile catalog and send it to the client 4. apply catalog on client 5. process report
  • 16. * * Manifest: your Puppet DSL (*.pp) * Catalog: serialized host specific DSL * Facts: host specific set of vars * Plugins: puppet extensions * facts, types, providers, reports...
  • 17. * [root@puppet ~]# facter architecture => x86_64 augeasversion => 0.9.0 bios_release_date => 12/01/2006 bios_vendor => innotek GmbH bios_version => VirtualBox blockdevice_sda_model => VBOX HARDDISK blockdevice_sda_size => 214748364800 blockdevice_sda_vendor => ATA domain => example.com facterversion => 1.7.2 filesystems => ext4,iso9660 fqdn => puppet.example.com hardwareisa => x86_64 hardwaremodel => x86_64 hostname => puppet id => root interfaces => eth0,lo ipaddress => 10.0.2.15 ipaddress_eth0 => 10.0.2.15 ipaddress_lo => 127.0.0.1 is_virtual => true kernel => Linux
  • 18. * node definitions & modules & delivering content
  • 20. * %manifestdir/site.pp: node frontend.example.com { # file{‚/etc/apache2/httpd.con‘: # ensure => present, # ... #} include apache2 # class{„apache2“:} } node db1.example.com { ... }
  • 21. * directory structure in %modulepath: mkdir –p modulename/{manifests,files,templates,lib,spec} - manifests : where your .pp goes - files : where your static content goes - templates : where your dynamic content goes (remember facts) - lib : where your advanced puppet knowledge goes - specs : home of Q&A‘s happiness
  • 22. * %modulepath/modulename/manifests/init.pp: class modulename() { file{„/tmp/testfile.conf“: ensure => present, ... } package{„mypackage“: ensure => latest, } service{„myinitscript“: ensure => running } }
  • 23. * # static file content file{„/tmp/testfile1.conf“: ensure => present, source => „puppet://mymodule/testfile1.conf“ } # templating file{„/tmp/testfile2.conf“: ensure => present, content => template(„testfile2.conf.erb“) }
  • 24. * one binary to rule them all - faces
  • 25. [root@puppet ~]# puppet help Usage: puppet <subcommand> [options] <action> [options] Available subcommands: agent The puppet agent daemon apply Apply Puppet manifests locally cert Manage certificates and requests master The puppet master daemon module Creates, installs and searches for modules on the Puppet Forge. parser Interact directly with the parser. puppet apply: • apply manifests locally • no master needed • no centralized fileserver • test • headless puppet • no SSL-communication allowed
  • 26. [root@puppet ~]# puppet help Usage: puppet <subcommand> [options] <action> [options] Available subcommands: agent The puppet agent daemon apply Apply Puppet manifests locally cert Manage certificates and requests master The puppet master daemon module Creates, installs and searches for modules on the Puppet Forge. parser Interact directly with the parser. puppet master: • starts https service • TCP/8140 • internal webserver (ruby) • scalable (mod_passenger) puppet agent: • manages puppet runs on client • regularly • one-time
  • 27. [root@puppet ~]# puppet help Usage: puppet <subcommand> [options] <action> [options] Available subcommands: agent The puppet agent daemon apply Apply Puppet manifests locally cert Manage certificates and requests master The puppet master daemon module Creates, installs and searches for modules on the Puppet Forge. parser Interact directly with the parser. puppet module: • interacts with puppetlabs module repository puppet parser validate: • syntax check manifests
  • 29. * * find puppets configuration: * puppet config print * puppet.conf (PE vs. OSE) * debugging puppet: * puppet parser validate <file.pp> * puppet agent/apply –-noop (use it!!!) * running agent in „test“ mode * includes one-time * includes verbose * doesn‘t include noop!!!
  • 31. * * connect to your learning instance and play around a bit * launch puppet help * launch a puppet master * launch a client side puppet run * find configuration files * inspect the process list / ports * find your manifests, site.pp, modules * create an empty testfile via local puppet run * implement a NTP module _1 * make sure NTPd is installed * deliver your ntp.conf via puppet * make sure NTPd is running pingyourselfifidle:pinglocalhost
  • 32. * * implement a NTP module _2 * make sure NTPd is installed * deliver your ntp.conf via puppet – dynamic content * make sure NTPd is running pingyourselfifidle:pinglocalhost
  • 33. * * implement a NTP module _3 * make sure NTPd is installed * deliver your ntp.conf via puppet * dynamic file content * make sure NTPd is running * first install NTPd, then configure it, then handle the service * restart the service, if configuration file has been changed pingyourselfifidle:pinglocalhost
  • 35. * * puppets internal CA * on master: puppet cert --list --all * on client: NIL * rm –rf /var/lib/puppet/ssl * don‘t repeat others * forge.puppetlabs.com – puppet module * ask others: *ask.puppetlabs.com
  • 36. * * resource ordering f*ck-ups?! * puppet agent –t –-graph --noop
  • 37. externalinternal regulary one-time * * how to trigger a puppet run? puppet agent cron‘d one- time ssh‘d one- time MCollective