SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
From zero to Puppet




http://www.rankpop.com/you-need-to-start-structuring-your-blog-posts-asap/
+15TB / mth
+1bn docs /mth
2-5k inserts/s @ 3ms
10K RPM @ 140ms
Servers

HTTP Load Balancer – 5x
Apache - 14x
Build - 2x
MongoDB - 19x data,
          13x routing,
          6x configuration,
          6x arbiter,
HTTP Load Balancer



$globalIPs_array = split($globalIPs, ',')

<% globalIPs_array.each do |globalIP| ­%>
ListenHTTP
        # primary public IP address
        Address <%= globalIP %>
        Port    80
Apache
Apache


file
{
 'vhost':
  path    =>  "/etc/apache2/sites­enabled/${::siteDomain}",
  ensure  => file,
  content => template('apache­php/vhost.erb'),
  notify  => Service['apache2'],
}
Apache

<VirtualHost *:80>
ServerName <%= siteDomain %>
DocumentRoot <%= documentRoot %>
...        
ErrorLog /var/log/apache2/error­<%= siteDomain %>.log
<% if @requestLogging and requestLogging == "yes" %>
 CustomLog /var/log/apache2/access­<%= siteDomain %>.log vhost_combined
<% end %>

<% if enableSSL == "yes" %>
<VirtualHost *:443>   
SSLEngine On
SSLCertificateFile /var/www/ssl/<%= siteDomain %>.crt
SSLCertificateKeyFile /var/www/ssl/<%= siteDomain %>.key
...
$excess_bagage = [ 
                   "ppp", 
                   "bind9­host", 
                   "laptop­detect", 
                   "open­iscsi", 
                   "libnss3:i386" 
                 ]
package
{
 $excess_bagage:
 ensure => purged,
}
exec
{
 'ufw allow is­1':
   command     => '/usr/sbin/ufw allow from 184.173.178.67',
   unless      => '/usr/sbin/ufw status verbose | grep "184.173.178.67"',
}
exec
{
 'ufw enable':
   command     => '/usr/sbin/ufw enable',
   unless      => '/usr/sbin/ufw status | grep "Status: active"',
   Require     => [Exec['ufw allow is­1']],
   notify      => Exec['ufw reload'],
}
exec
{
 'ufw reload':
   command     => '/usr/sbin/ufw reload',
   require     => Exec['ufw enable'],
   refreshonly => true,
}
SSH
file
{
 'sshd_config':
   path    => '/etc/ssh/sshd_config',
   ensure  => file,
   content  => template('sshd/sshd_config.erb'),
}
Port 22
Protocol 2
AllowUsers david pessoa chris rob wes
Compression yes
...
<% if @duoSecKey and @duoIntKey and @duoHost %>
 ForceCommand /usr/sbin/login_duo
 PermitTunnel no
 AllowTcpForwarding no
<% end %>
System updates
CANARIES=" 
       aws­prod­apac­singapore­exm­a1 
       a2.wdc.sl 
       exm1.wdc.sl 
       mtx­web1.wdc.sl 
       sdapp­web1.wdc.sl 
       sdapi­web1.wdc.sl 
       "
function canaries {
   echo "REMOVE *­web1.wdc.sl FROM ROTATION!"
   echo "press ENTER"
   read
   echo "have you REALLY removed *­web1.wdc.sl from rotation?"
   echo "press ENTER"
   read

   for i in $CANARIES
   do
       echo $i
       mco rpc puppetral ­I $i create type=exec 
                       title="/bin/bash ­c 'apt­get dist­upgrade ­y'"
   done
}
System updates



function reboot_canaries {
   echo "REMOVE *­web1.wdc.sl FROM ROTATION!"
   echo "press ENTER"
   read
   echo "have you REALLY removed *­web1.wdc.sl from rotation?"
   echo "press ENTER"
   read
   for i in $CANARIES
   do
       echo $i
       mco rpc puppetral ­I $i create type=exec 
                       title="/bin/bash ­c 'reboot'"
       echo "­­­­­­­­­­­­­­"
   done
}
What to Reboot

mco rpc puppetral create type=exec 
   title="/bin/bash ­c 'ls /var/run/reboot­required'" 
   | grep ­B 1  "Resource was created" 
   | grep ".sl"



                          exm1.wdc.sl                              
                             Status: change from notrun to 0 failed: 
                             /bin/bash ­c 'ls /var/run/reboot­required' 
                             returned 2 instead of one of [0]


    exm­md1a.wdc.sl                          
         Status: Resource was created
       Resource: {"tags"=>["exec"],
                  "title"=>"/bin/bash ­c 'ls /var/run/reboot­required'",
                  "type"=>"Exec",
                  "parameters"=>{:returns=>:notrun},
                  "exported"=>false}
Live Management
                      - Emergency




# Metrics
<%= metricsIP %> metrics­svc

# Infrastructure services
184.173.178.66  puppet

...
Live Management
     - Emergency
Live Management
     - Emergency
Live Management
     - Emergency
Live Management
     - Emergency
Pedro Pessoa

pessoa@serverdensity.com




www.serverdensity.com

Más contenido relacionado

La actualidad más candente

Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricksbcoca
 
ZeroMQ Is The Answer
ZeroMQ Is The AnswerZeroMQ Is The Answer
ZeroMQ Is The AnswerIan Barber
 
Perl web app 테스트전략
Perl web app 테스트전략Perl web app 테스트전략
Perl web app 테스트전략Jeen Lee
 
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbSmartTools
 
Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & ToolsIan Barber
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupGreg DeKoenigsberg
 
Hacking ansible
Hacking ansibleHacking ansible
Hacking ansiblebcoca
 
Perl: Coro asynchronous
Perl: Coro asynchronous Perl: Coro asynchronous
Perl: Coro asynchronous Shmuel Fomberg
 
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 ClicksCarlos Sanchez
 
Security Challenges in Node.js
Security Challenges in Node.jsSecurity Challenges in Node.js
Security Challenges in Node.jsWebsecurify
 
Roll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaRoll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaJon Moore
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stackEric Ahn
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricksbcoca
 
V2 and beyond
V2 and beyondV2 and beyond
V2 and beyondjimi-c
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUNCong Zhang
 
The promise of asynchronous PHP
The promise of asynchronous PHPThe promise of asynchronous PHP
The promise of asynchronous PHPWim Godden
 
Bootstrapping multidc observability stack
Bootstrapping multidc observability stackBootstrapping multidc observability stack
Bootstrapping multidc observability stackBram Vogelaar
 

La actualidad más candente (20)

Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 
ZeroMQ Is The Answer
ZeroMQ Is The AnswerZeroMQ Is The Answer
ZeroMQ Is The Answer
 
A Gentle Introduction to Event Loops
A Gentle Introduction to Event LoopsA Gentle Introduction to Event Loops
A Gentle Introduction to Event Loops
 
ActionHeroJS Talk
ActionHeroJS TalkActionHeroJS Talk
ActionHeroJS Talk
 
Perl web app 테스트전략
Perl web app 테스트전략Perl web app 테스트전략
Perl web app 테스트전략
 
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
 
Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & Tools
 
Ansible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetupAnsible loves Python, Python Philadelphia meetup
Ansible loves Python, Python Philadelphia meetup
 
Hacking ansible
Hacking ansibleHacking ansible
Hacking ansible
 
Perl: Coro asynchronous
Perl: Coro asynchronous Perl: Coro asynchronous
Perl: Coro asynchronous
 
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
 
Security Challenges in Node.js
Security Challenges in Node.jsSecurity Challenges in Node.js
Security Challenges in Node.js
 
Roll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaRoll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and Lua
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stack
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricks
 
V2 and beyond
V2 and beyondV2 and beyond
V2 and beyond
 
Anyevent
AnyeventAnyevent
Anyevent
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUN
 
The promise of asynchronous PHP
The promise of asynchronous PHPThe promise of asynchronous PHP
The promise of asynchronous PHP
 
Bootstrapping multidc observability stack
Bootstrapping multidc observability stackBootstrapping multidc observability stack
Bootstrapping multidc observability stack
 

Destacado

High performance Infrastructure Oct 2013
High performance Infrastructure Oct 2013High performance Infrastructure Oct 2013
High performance Infrastructure Oct 2013Server Density
 
Experiences from DevOps production: Deployment, performance, failure.
Experiences from DevOps production: Deployment, performance, failure.Experiences from DevOps production: Deployment, performance, failure.
Experiences from DevOps production: Deployment, performance, failure.Server Density
 
StartOps: Growing an ops team from 1 founder
StartOps: Growing an ops team from 1 founderStartOps: Growing an ops team from 1 founder
StartOps: Growing an ops team from 1 founderServer Density
 
Puppet Camp Ghent 2013
Puppet Camp Ghent 2013Puppet Camp Ghent 2013
Puppet Camp Ghent 2013Server Density
 
NoSQL Infrastructure - Late 2013
NoSQL Infrastructure - Late 2013NoSQL Infrastructure - Late 2013
NoSQL Infrastructure - Late 2013Server Density
 
MongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsMongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsServer Density
 
Remote startup - building a company from everywhere in the world
Remote startup - building a company from everywhere in the worldRemote startup - building a company from everywhere in the world
Remote startup - building a company from everywhere in the worldServer Density
 
Navigating the customer lifecycle
Navigating the customer lifecycleNavigating the customer lifecycle
Navigating the customer lifecycleServer Density
 
Scaling humans - Ops teams and incident management
Scaling humans - Ops teams and incident managementScaling humans - Ops teams and incident management
Scaling humans - Ops teams and incident managementServer Density
 
DevOps Incident Handling - Making friends not enemies.
DevOps Incident Handling - Making friends not enemies.DevOps Incident Handling - Making friends not enemies.
DevOps Incident Handling - Making friends not enemies.Server Density
 
Puppet at the centre of everything
Puppet at the centre of everythingPuppet at the centre of everything
Puppet at the centre of everythingServer Density
 
Infrastructure choices - cloud vs colo vs bare metal
Infrastructure choices - cloud vs colo vs bare metalInfrastructure choices - cloud vs colo vs bare metal
Infrastructure choices - cloud vs colo vs bare metalServer Density
 
Flight training for DevOps & HumanOps - IncontroDevOps 2016
Flight training for DevOps & HumanOps - IncontroDevOps 2016Flight training for DevOps & HumanOps - IncontroDevOps 2016
Flight training for DevOps & HumanOps - IncontroDevOps 2016Server Density
 
Flight training for DevOps
Flight training for DevOpsFlight training for DevOps
Flight training for DevOpsServer Density
 
Content marketing @ Server Density
Content marketing @ Server DensityContent marketing @ Server Density
Content marketing @ Server DensityServer Density
 

Destacado (20)

High performance Infrastructure Oct 2013
High performance Infrastructure Oct 2013High performance Infrastructure Oct 2013
High performance Infrastructure Oct 2013
 
Experiences from DevOps production: Deployment, performance, failure.
Experiences from DevOps production: Deployment, performance, failure.Experiences from DevOps production: Deployment, performance, failure.
Experiences from DevOps production: Deployment, performance, failure.
 
StartOps: Growing an ops team from 1 founder
StartOps: Growing an ops team from 1 founderStartOps: Growing an ops team from 1 founder
StartOps: Growing an ops team from 1 founder
 
Puppet Camp Ghent 2013
Puppet Camp Ghent 2013Puppet Camp Ghent 2013
Puppet Camp Ghent 2013
 
NoSQL Infrastructure - Late 2013
NoSQL Infrastructure - Late 2013NoSQL Infrastructure - Late 2013
NoSQL Infrastructure - Late 2013
 
MongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & AnalyticsMongoDB: Optimising for Performance, Scale & Analytics
MongoDB: Optimising for Performance, Scale & Analytics
 
Handling incidents
Handling incidentsHandling incidents
Handling incidents
 
Briefing: Containers
Briefing: ContainersBriefing: Containers
Briefing: Containers
 
Remote startup - building a company from everywhere in the world
Remote startup - building a company from everywhere in the worldRemote startup - building a company from everywhere in the world
Remote startup - building a company from everywhere in the world
 
NoSQL Infrastructure
NoSQL InfrastructureNoSQL Infrastructure
NoSQL Infrastructure
 
Navigating the customer lifecycle
Navigating the customer lifecycleNavigating the customer lifecycle
Navigating the customer lifecycle
 
Scaling humans - Ops teams and incident management
Scaling humans - Ops teams and incident managementScaling humans - Ops teams and incident management
Scaling humans - Ops teams and incident management
 
DevOps Incident Handling - Making friends not enemies.
DevOps Incident Handling - Making friends not enemies.DevOps Incident Handling - Making friends not enemies.
DevOps Incident Handling - Making friends not enemies.
 
Why puppet? Why now?
Why puppet? Why now?Why puppet? Why now?
Why puppet? Why now?
 
Puppet at the centre of everything
Puppet at the centre of everythingPuppet at the centre of everything
Puppet at the centre of everything
 
Infrastructure choices - cloud vs colo vs bare metal
Infrastructure choices - cloud vs colo vs bare metalInfrastructure choices - cloud vs colo vs bare metal
Infrastructure choices - cloud vs colo vs bare metal
 
Flight training for DevOps & HumanOps - IncontroDevOps 2016
Flight training for DevOps & HumanOps - IncontroDevOps 2016Flight training for DevOps & HumanOps - IncontroDevOps 2016
Flight training for DevOps & HumanOps - IncontroDevOps 2016
 
Flight training for DevOps
Flight training for DevOpsFlight training for DevOps
Flight training for DevOps
 
Content marketing @ Server Density
Content marketing @ Server DensityContent marketing @ Server Density
Content marketing @ Server Density
 
How to monitor NGINX
How to monitor NGINXHow to monitor NGINX
How to monitor NGINX
 

Similar a Puppet Camp 2012

Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Composeraccoony
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationJohn Lynch
 
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionIan Barber
 
Heavy Web Optimization: Backend
Heavy Web Optimization: BackendHeavy Web Optimization: Backend
Heavy Web Optimization: BackendVõ Duy Tuấn
 
Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4Ilya Haykinson
 
PHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnPHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnSandro Zaccarini
 
X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newYiwei Ma
 
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...Willian Molinari
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos Sanchez
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)Wesley Beary
 

Similar a Puppet Camp 2012 (20)

Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
Ubic
UbicUbic
Ubic
 
Ubic-public
Ubic-publicUbic-public
Ubic-public
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
 
infra-as-code
infra-as-codeinfra-as-code
infra-as-code
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
 
Heavy Web Optimization: Backend
Heavy Web Optimization: BackendHeavy Web Optimization: Backend
Heavy Web Optimization: Backend
 
Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4Why and How Powershell will rule the Command Line - Barcamp LA 4
Why and How Powershell will rule the Command Line - Barcamp LA 4
 
PHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vulnPHP Backdoor: The rise of the vuln
PHP Backdoor: The rise of the vuln
 
Puppi. Puppet strings to the shell
Puppi. Puppet strings to the shellPuppi. Puppet strings to the shell
Puppi. Puppet strings to the shell
 
Puppet
PuppetPuppet
Puppet
 
Memcached Study
Memcached StudyMemcached Study
Memcached Study
 
X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 new
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
 

Puppet Camp 2012