Your SlideShare is downloading. ×
Puppet
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Puppet

1,481
views

Published on

Few simple commands to run puppet env.

Few simple commands to run puppet env.


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,481
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. 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
  • 2. AgendaKilka słów o sobiePuppetPrzyklady – co i jak zrobićPrezentacja LIVEMozliwości – co możemy osiągnąćPytania ?
  • 3. Co mamy na rynkuAutorskie skrypty (tar, rsync itd.)Etckeeperbcfg2CFEnginePuppetChefitd.
  • 4. 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
  • 5. 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)
  • 6. 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
  • 7. 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}
  • 8. 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"])}
  • 9. 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,}
  • 10. 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] ],}
  • 11. 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.
  • 12. 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)
  • 13. Przykładycase $operatingsystem {  CentOS: { include centos }  MacOS:  { include mac }}case $operatingsystemrelease { /^5/: { service { "anacron": ensure => stopped, enable => false } }}<%= hostname %>
  • 14. 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
  • 15. LIVE
  • 16. Amazon EC2AMIPuppetmaster (HA?)Amazon ELBAmazon Auto ScalingEfekt:W pełni automatycznie skalowalne środowisko !
  • 17. 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
  • 18. 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
  • 19. Przydatne linkihttp://puppetlabs.com/http://docs.puppetlabs.com/http://puppetlabs.com/puppet/related- projects/facter/https://github.com/example42/https://github.com/puppet-modules
  • 20. Pytania ?l.jagiello@gratka-technologie.pl