SlideShare a Scribd company logo
1 of 21
Puppet – system do zarządzania
                     systemami




                                   Łukasz Jagiełło – l.jagiello@gratka-technologie.pl


http://images.businessweek.com/cms/2011-09-01/tech__puppet37__01__600.jpg
Agenda
Kilka słów o sobie
Puppet
Przyklady – co i jak zrobić
Prezentacja LIVE
Mozliwości – co możemy osiągnąć
Pytania ?
Co mamy na rynku
Autorskie skrypty (tar, rsync itd.)
Etckeeper
bcfg2
CFEngine
Puppet
Chef
itd.
Puppet
http://puppetlabs.com/
  http://projects.puppetlabs.com/
open source (Apache 2.0)
dostępny w wielu dystrybucjach out-of-box
gotowe obrazy Amazon EC2
projekt istnieje od dawna
duże community
wersja enterprice
Puppet
Struktura katalogów:
/manifest (nodes.pp, site.pp)
/modules
  /name (np. nginx, webpage, snmp ...)
     /files (nginx.conf, infoshare.conf ...)
     /manifests (init.pp, config.pp, install.pp ...)
     /template (index.html.erb ...)
/rack ( passenger + nginx)
/lib ( dodatkowe biblioteki np. facter)
Puppet
File - plik, katalog, symlink (lokalny fs)
Package – yum,gem,pkg,apt,pip,ports...
Service – systemd,upstart,init,daemontools...
Notify
Exec – commandline + creates,onlyif,cwd,user..
Cron, user, group itd...


http://docs.puppetlabs.com/references/latest/type.html
Przykłady
node 'www.testing.com' {

    include common

    include apache, squid

}

node /^(foo|bar).testing.com$/ {

    include common

}



case $hostname {

    'jack','jill':     { include hill    } # apply the hill class

    'humpty','dumpty': { include wall    } # apply the wall class

    default:           { include generic } # apply the generic class

}
Przykłady
file { '/etc/passwd':

    owner => 'root',

    group => 'root',

    mode  => '0644'}



define cfg {

    file { "/etc/sec/$name.sec":

         owner   => root,
         content => template("sec/$name.sec.erb"),
         notify  => Service['sec'],
         require => File["/etc/sec"],
    }}

@sec::cfg { ["webpage1","webpage2"] }

if $config_www_webpage1 == 1 { realize(Sec::Cfg["webpage1"])}

if $config_www_webpage2 == 1 { realize(Sec::Cfg["webpage2"])}
Przykłady
package { 'openssh­server': ensure => installed }

file { '/etc/ssh/sshd_config':

    source  => 'puppet:///modules/sshd/sshd_config',

    owner   => 'root',

    group   => 'root',

    mode    => '640',

    notify  => Service['sshd'], # sshd will restart whenever you edit this file.

    require => Package['openssh­server'],

}

service { 'sshd':

    ensure => running,

    enable => true,

    hasstatus => true,

    hasrestart => true,

}
Przykłady
package { "rubygems": ensure  => present }

package { "xmpp4r": ensure => "0.5", provider => gem }

package { "xmpp4r­simple": ensure => "0.8.8", provider => gem }



python::pip::install{"Paste": package => 'Paste==1.7.5.1', venv => '/usr', ensure => 'present' }

python::pip::install{"PasteDeploy": package => 'PasteDeploy==1.5.0', venv => '/usr', ensure => 
    'present' }



if $ensure == 'present' {

    exec { "pip install $name":

         command => "$venv/bin/pip­python install $package",
         unless  => "$venv/bin/pip­python freeze | grep ­e $grep_regex",
         require => [ Package[python­pip], Package[libxml2­devel], Package[libxslt­devel], 
            Package[gcc], Package[python­devel] ],
}
Facter
facter is an independent !
cross-platform Ruby library
collect information about the hardware and
  operating system


operating system names, hardware
 characteristics, IP addresses, MAC addresses,
 and SSH keys.
Facter
[lcf@p0x ~]$ facter

architecture => x86_64

facterversion => 1.6.6

hostname => p0x

id => lcf

interfaces => lo,p6p1,virbr0,virbr0_nic,wlan0

ipaddress => 192.168.10.100

is_virtual => false

kernel => Linux

kernelmajversion => 3.3

kernelrelease => 3.3.1­5.fc16.x86_64

kernelversion => 3.3.1

lsbdistcodename => Verne

lsbdistdescription => Fedora release 16 (Verne)
Przykłady
case $operatingsystem {

  'CentOS': { include centos }

  'MacOS':  { include mac }

}




case $operatingsystemrelease {

     /^5/: { service { "anacron": ensure => stopped, enable => false } }

}



<%= hostname %>
pre-LIVE
OS: CentOS 6.2
Repo: CentOS + EPEL

Minimal install + selinux disables + iptables
 disables + puppet/puppet-server install

192.168.122.10 – puppetmaster
192.168.122.20 – www1
192.168.122.21 – www2
LIVE
Amazon EC2
AMI
Puppetmaster (HA?)
Amazon ELB
Amazon Auto Scaling


Efekt:
W pełni automatycznie skalowalne środowisko !
Plusy
Konfiguracja w jednym miescu
Łatwa kontrola wersji (svn,git,hg...)
oraz kontrola nad zmianami na produkcji
Wygodne propagowanie zmian
Powtarzalność
Błyskawicznie dokładanie gotowych
  funkcjonalności
Minus
Wydajność (da się coś z tym zrobić)
Losowość
Działa tak dobrze, jak dobrze się w nim pisze
SSL -> klucze -> hostname (uniq ?!)
Kwiatki w składni
Przydatne linki
http://puppetlabs.com/
http://docs.puppetlabs.com/
http://puppetlabs.com/puppet/related-
  projects/facter/
https://github.com/example42/
https://github.com/puppet-modules
Pytania ?




l.jagiello@gratka-technologie.pl

More Related Content

What's hot

X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 new
Yiwei Ma
 
The Magic of Hot Streaming Replication, Bruce Momjian
The Magic of Hot Streaming Replication, Bruce MomjianThe Magic of Hot Streaming Replication, Bruce Momjian
The Magic of Hot Streaming Replication, Bruce Momjian
Fuenteovejuna
 
Setting up mongo replica set
Setting up mongo replica setSetting up mongo replica set
Setting up mongo replica set
Sudheer Kondla
 
Lamp configuration u buntu 10.04
Lamp configuration   u buntu 10.04Lamp configuration   u buntu 10.04
Lamp configuration u buntu 10.04
mikehie
 
Proxy server ubuntu 12.04
Proxy server ubuntu 12.04Proxy server ubuntu 12.04
Proxy server ubuntu 12.04
Tio Aldiansyah
 
Easy distributed load test with Tsung
Easy distributed load test with TsungEasy distributed load test with Tsung
Easy distributed load test with Tsung
Ngoc Dao
 

What's hot (20)

LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control Groups
 
Linux fundamental - Chap 09 pkg
Linux fundamental - Chap 09 pkgLinux fundamental - Chap 09 pkg
Linux fundamental - Chap 09 pkg
 
X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 new
 
Chap 19 web
Chap 19 webChap 19 web
Chap 19 web
 
OpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQLOpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQL
 
Postgres-BDR with Google Cloud Platform
Postgres-BDR with Google Cloud PlatformPostgres-BDR with Google Cloud Platform
Postgres-BDR with Google Cloud Platform
 
Importance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation readingImportance of linux system fundamental in technical documentation reading
Importance of linux system fundamental in technical documentation reading
 
PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22
 
A little systemtap
A little systemtapA little systemtap
A little systemtap
 
The Magic of Hot Streaming Replication, Bruce Momjian
The Magic of Hot Streaming Replication, Bruce MomjianThe Magic of Hot Streaming Replication, Bruce Momjian
The Magic of Hot Streaming Replication, Bruce Momjian
 
Setting up mongo replica set
Setting up mongo replica setSetting up mongo replica set
Setting up mongo replica set
 
Pf: the OpenBSD packet filter
Pf: the OpenBSD packet filterPf: the OpenBSD packet filter
Pf: the OpenBSD packet filter
 
Lamp configuration u buntu 10.04
Lamp configuration   u buntu 10.04Lamp configuration   u buntu 10.04
Lamp configuration u buntu 10.04
 
PostgreSQL Replication with Bucardo
PostgreSQL Replication with BucardoPostgreSQL Replication with Bucardo
PostgreSQL Replication with Bucardo
 
Go replicator
Go replicatorGo replicator
Go replicator
 
Query logging with proxysql
Query logging with proxysqlQuery logging with proxysql
Query logging with proxysql
 
Proxy server ubuntu 12.04
Proxy server ubuntu 12.04Proxy server ubuntu 12.04
Proxy server ubuntu 12.04
 
Easy distributed load test with Tsung
Easy distributed load test with TsungEasy distributed load test with Tsung
Easy distributed load test with Tsung
 
LXC on Ganeti
LXC on GanetiLXC on Ganeti
LXC on Ganeti
 
T.Pollak y C.Yaconi - Prey
T.Pollak y C.Yaconi - PreyT.Pollak y C.Yaconi - Prey
T.Pollak y C.Yaconi - Prey
 

Similar to Puppet

Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012
Carlos Sanchez
 
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
Carlos Sanchez
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Carlos Sanchez
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
garrett honeycutt
 
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkDance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech Talk
Michael Peacock
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and Agent
Ranjit Avasarala
 
Linuxday.at - Lightning Talk
Linuxday.at - Lightning TalkLinuxday.at - Lightning Talk
Linuxday.at - Lightning Talk
Jan Gehring
 

Similar to Puppet (20)

Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with Puppet
 
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
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
 
DevOps Braga #6
DevOps Braga #6DevOps Braga #6
DevOps Braga #6
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014
 
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkDance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech Talk
 
Puppi. Puppet strings to the shell
Puppi. Puppet strings to the shellPuppi. Puppet strings to the shell
Puppi. Puppet strings to the shell
 
Puppet: What _not_ to do
Puppet: What _not_ to doPuppet: What _not_ to do
Puppet: What _not_ to do
 
PuppetCamp Ghent - What Not to Do with Puppet
PuppetCamp Ghent - What Not to Do with PuppetPuppetCamp Ghent - What Not to Do with Puppet
PuppetCamp Ghent - What Not to Do with Puppet
 
PuppetCamp Ghent - What Not to Do with Puppet
PuppetCamp Ghent - What Not to Do with PuppetPuppetCamp Ghent - What Not to Do with Puppet
PuppetCamp Ghent - What Not to Do with Puppet
 
Using Puppet on Linux, Windows, and Mac OSX
Using Puppet on Linux, Windows, and Mac OSXUsing Puppet on Linux, Windows, and Mac OSX
Using Puppet on Linux, Windows, and Mac OSX
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and Agent
 
Linuxday.at - Lightning Talk
Linuxday.at - Lightning TalkLinuxday.at - Lightning Talk
Linuxday.at - Lightning Talk
 
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksHow to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
 
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksHow to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
 
Ansible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife OrchestrationAnsible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife Orchestration
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Puppet