• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Puppet
 

Puppet

on

  • 1,699 views

Few simple commands to run puppet env.

Few simple commands to run puppet env.

Statistics

Views

Total Views
1,699
Views on SlideShare
1,685
Embed Views
14

Actions

Likes
0
Downloads
12
Comments
0

2 Embeds 14

http://www.linkedin.com 8
https://www.linkedin.com 6

Accessibility

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Puppet Puppet Presentation Transcript

    • Puppet – system do zarządzania systemami Łukasz Jagiełło – l.jagiello@gratka-technologie.plhttp://images.businessweek.com/cms/2011-09-01/tech__puppet37__01__600.jpg
    • AgendaKilka słów o sobiePuppetPrzyklady – co i jak zrobićPrezentacja LIVEMozliwości – co możemy osiągnąćPytania ?
    • Co mamy na rynkuAutorskie skrypty (tar, rsync itd.)Etckeeperbcfg2CFEnginePuppetChefitd.
    • Puppethttp://puppetlabs.com/ http://projects.puppetlabs.com/open source (Apache 2.0)dostępny w wielu dystrybucjach out-of-boxgotowe obrazy Amazon EC2projekt istnieje od dawnaduże communitywersja enterprice
    • PuppetStruktura 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)
    • PuppetFile - plik, katalog, symlink (lokalny fs)Package – yum,gem,pkg,apt,pip,ports...Service – systemd,upstart,init,daemontools...NotifyExec – commandline + creates,onlyif,cwd,user..Cron, user, group itd...http://docs.puppetlabs.com/references/latest/type.html
    • Przykładynode 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ładyfile { /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ładypackage { 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ładypackage { "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] ],}
    • Facterfacter is an independent !cross-platform Ruby librarycollect information about the hardware and operating systemoperating system names, hardware characteristics, IP addresses, MAC addresses, and SSH keys.
    • Facter[lcf@p0x ~]$ facterarchitecture => x86_64facterversion => 1.6.6hostname => p0xid => lcfinterfaces => lo,p6p1,virbr0,virbr0_nic,wlan0ipaddress => 192.168.10.100is_virtual => falsekernel => Linuxkernelmajversion => 3.3kernelrelease => 3.3.1­5.fc16.x86_64kernelversion => 3.3.1lsbdistcodename => Vernelsbdistdescription => Fedora release 16 (Verne)
    • Przykładycase $operatingsystem {  CentOS: { include centos }  MacOS:  { include mac }}case $operatingsystemrelease { /^5/: { service { "anacron": ensure => stopped, enable => false } }}<%= hostname %>
    • pre-LIVEOS: CentOS 6.2Repo: CentOS + EPELMinimal install + selinux disables + iptables disables + puppet/puppet-server install192.168.122.10 – puppetmaster192.168.122.20 – www1192.168.122.21 – www2
    • LIVE
    • Amazon EC2AMIPuppetmaster (HA?)Amazon ELBAmazon Auto ScalingEfekt:W pełni automatycznie skalowalne środowisko !
    • PlusyKonfiguracja w jednym miescuŁatwa kontrola wersji (svn,git,hg...)oraz kontrola nad zmianami na produkcjiWygodne propagowanie zmianPowtarzalnośćBłyskawicznie dokładanie gotowych funkcjonalności
    • MinusWydajność (da się coś z tym zrobić)LosowośćDziała tak dobrze, jak dobrze się w nim piszeSSL -> klucze -> hostname (uniq ?!)Kwiatki w składni
    • Przydatne linkihttp://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