SlideShare a Scribd company logo
1 of 44
Automação e DevOps
  tome o controle da sua infraestrutura


       fabio.kung@gmail.com
    fabio.kung@locaweb.com.br
             @fabiokung
Administração Remota
Gerenciador




                                ...
DHCP     Proxy       Firewall
Gerenciador




WS WS WS   WS WS WS      WS WS WS
                                     ...
 DHCP        Proxy        Firewall
Gerenciador

           WS   WS




WS WS WS   WS WS WS      WS WS WS
                                     ...
 DHCP           Proxy     Firewall
Gerenciador

           WS   WS




WS WS WS   WS WS WS      WS WS WS
                                     ...
 DHCP           Proxy     Firewall
Gerenciador

           WS   WS


            Autenticação?
            Monitoração?
            Criptografia?
                 ...
WS WS WS   WS WS WS         WS WS WS
                                        ...
 DHCP           Proxy        Firewall
Gerenciador

           WS   WS




           ESB
WS WS WS   WS WS WS      WS WS WS
                                     ...
 DHCP           Proxy     Firewall
Gerenciador

           WS   WS




           ESB
WS WS WS   WS WS WS      WS WS WS
                                     ...
 DHCP           Proxy     Firewall
Gerenciador

           WS   WS




           ESB
WS WS WS   WS WS WS      WS WS WS
                                     ...
 DHCP           Proxy     Firewall
KI
     SSH
Gerenciador
          Logica
                          sudoers,
                      pub/priv keypairs




 SSH       SSH         SSH
                                 ...
DHCP     Proxy       Firewall
SSHService
require "net/ssh"

Net::SSH.start("host", "user", options) do |ssh|
  ssh_result = ssh.open_channel do |channel|
    channel.exec command
    channel.on_data { |ch, data| ch[:out] << data }
    channel.on_extended_data { |ch, type, data| ch[:out] << data }
    channel.on_request("exit-status") do |ch, request|
      ch[:status] = request.read_long
    end
  end
  ssh.loop
end
Controle de tarefas
     Mundo Assíncrono




      fuja de filas no DB!
Resque
Instant Messaging
XMPP JIDs


username@domain /resource
fabiokung@servidor
machine01@servidor




                     machine02@servidor

fabiokung@servidor




                     machine03@servidor
installer@servidor




                        cloner@servidor

fabiokung@servidor




                     uninstaller@servidor
XMPP4R
http://home.gna.org/xmpp4r
múltiplos workers


                      installer@servidor




                             ...
frontend@servidor




                      installer@servidor
frontend@servidor   installer@servidor/A




                           ...
                    installer@servidor/B
quem pode?
                    to: installer@servidor

frontend@servidor                            installer@servidor/A




                                                    ...
                                             installer@servidor/B
quem pode?
                      to: installer@servidor

                                                 installer@servidor/A
frontend@servidor            eu posso!
                    from: installer@servidor/A




                                                        ...
                             eu posso!
                    from: installer@servidor/B




                                                 installer@servidor/B
quem pode?
                      to: installer@servidor

                                                 installer@servidor/A
frontend@servidor            eu posso!
                    from: installer@servidor/A




                                                        ...
                             eu posso!
                    from: installer@servidor/B


                          ok, então instala!
                     to: installer@servidor/B
                                                 installer@servidor/B
quem pode?
                      to: installer@servidor

                                                 installer@servidor/A
frontend@servidor            eu posso!
                    from: installer@servidor/A
      ...




                                                        ...
                             eu posso!
                    from: installer@servidor/B


                          ok, então instala!
                     to: installer@servidor/B
frontend@servidor                                installer@servidor/B
presença,
pubsub...
Configuration
Management
•Puppet
•Chef
•CFEngine
Chef
recipes
                            chef-client


               recipes


chef-server       recipes   chef-client




                            chef-client
file "/etc/myapp.conf" do
  owner www-data
  group www-data
  mode "0600"
  action :create
end

package "mysql-server" do
  action :install
end

execute "open http port" do
  command "iptables -I INPUT -p tcp --dport 80 -j ACCEPT"
  creates "/var/run/http_port_opened"
end
package "sudo" do
  action :upgrade
end

user "sshservice" do
  system true
  action :create
end

template "/etc/sudoers" do
  source "sudoers.erb"
  mode 0440
  owner "root"
  group "root"
  variables(:user => "sshservice")
  action :create
end
bundle common control
{
    bundlesequence => { "ssh" };
    inputs => { "cfengine_stdlib.cf" }
}

bundle agent ssh
{
    packages:
        "sudo"
            package_policy => "add"
            package_method => "deb"
    files:
        "/etc/sudoers"
            edit_defaults => empty,
            edit_line => expand_template("sudoers.in"),
            perms => mog("0440", root, root),
            create => "true";
    methods:
        "sshservice" usebundle => create_user("sshservice")
}
http://cookbooks.opscode.com

 http://github.com/37signals/37s_cookbooks

http://github.com/engineyard/ey-cloud-recipes
continuous   Deployment
Capistrano
Chef?
deploy "/srv/my-cms" do
  repo "git://github.com/radiant/radiant.git"
  revision "HEAD"
  user "cms"
  migrate true
  migration_command "rake db:migrate"
  environment "production"
  action :deploy
  restart_command "touch tmp/restart.txt"
end
Pacotes!
 deb, rpm, ...
require'drb';F,D,C,P,M,U,*O=File,Class,Dir,*ARGV;def s(p)F.split(p[/[^|].*/])[-1
]end;def c(u);DRbObject.new((),u)end;def x(u)[P,u].hash;end;M=="client"&&c(U).f(
x(U)).each{|n|p,c=x(n),c(n);(c.f(p,O[0],0).map{|f|s f}-D["*"]).each{|f|F.open(f,
"w"){|o|o<<c.f(p,f,1)}}}||(DRb.start_service U,C.new{def f(c,a=[],t=2)c==x(U)&&(
t==0&&D[s(a)]||t==1&&F.read(s(a))||p(a))end;def y()(p(U)+p).each{|u|c(u).f(x(u),
p(U))rescue()};self;end;private;def p(x=[]);O.push(*x).uniq!;O;end}.new.y;sleep)

              http://ansuz.sooke.bc.ca/software/molester/2004121602.php




                                    P2P
Dúvidas?




   fabio.kung@gmail.com
fabio.kung@locaweb.com.br      Obrigado!
http://twitter.com/fabiokung

More Related Content

What's hot

Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environmentbocribbz
 
Modern Perl toolchain (help building microservices)
Modern Perl toolchain (help building microservices)Modern Perl toolchain (help building microservices)
Modern Perl toolchain (help building microservices)Jose Luis Martínez
 
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeEmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeMatt Ray
 
Aeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filteringAeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filteringConrad Cruz
 
Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)Conrad Cruz
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabricandymccurdy
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltStack
 
Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modulesmohamedmoharam
 
Setting up a_web_server.
Setting up a_web_server.Setting up a_web_server.
Setting up a_web_server.rmosum9384
 
DevOps(2) : Vagrant - (MOSG)
DevOps(2) : Vagrant  -  (MOSG)DevOps(2) : Vagrant  -  (MOSG)
DevOps(2) : Vagrant - (MOSG)Soshi Nemoto
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environmentSoshi Nemoto
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725miguel dominguez
 
Embedded software development using BDD
Embedded software development using BDDEmbedded software development using BDD
Embedded software development using BDDItamar Hassin
 
PHP MVC Tutorial 2
PHP MVC Tutorial 2PHP MVC Tutorial 2
PHP MVC Tutorial 2Yang Bruce
 
Backing up thousands of containers
Backing up thousands of containersBacking up thousands of containers
Backing up thousands of containersMarian Marinov
 

What's hot (18)

Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
Modern Perl toolchain (help building microservices)
Modern Perl toolchain (help building microservices)Modern Perl toolchain (help building microservices)
Modern Perl toolchain (help building microservices)
 
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeEmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
 
Capistrano
CapistranoCapistrano
Capistrano
 
Aeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filteringAeon mike guide transparent ssl filtering
Aeon mike guide transparent ssl filtering
 
Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)Aeon mike guide transparent ssl filtering (1)
Aeon mike guide transparent ssl filtering (1)
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabric
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
 
Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modules
 
Watch Me Install Alfresco
Watch Me Install AlfrescoWatch Me Install Alfresco
Watch Me Install Alfresco
 
Setting up a_web_server.
Setting up a_web_server.Setting up a_web_server.
Setting up a_web_server.
 
DevOps(2) : Vagrant - (MOSG)
DevOps(2) : Vagrant  -  (MOSG)DevOps(2) : Vagrant  -  (MOSG)
DevOps(2) : Vagrant - (MOSG)
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environment
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 
Embedded software development using BDD
Embedded software development using BDDEmbedded software development using BDD
Embedded software development using BDD
 
PHP MVC Tutorial 2
PHP MVC Tutorial 2PHP MVC Tutorial 2
PHP MVC Tutorial 2
 
Backing up thousands of containers
Backing up thousands of containersBacking up thousands of containers
Backing up thousands of containers
 
Fabric: A Capistrano Alternative
Fabric:  A Capistrano AlternativeFabric:  A Capistrano Alternative
Fabric: A Capistrano Alternative
 

Similar to Automacao devops

Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with CapistranoRamazan K
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabricandymccurdy
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-NapocaWP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-Napoca4nd4p0p
 
Maven 2 - more than a build tool
Maven 2 - more than a build toolMaven 2 - more than a build tool
Maven 2 - more than a build toolHarald Soevik
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...Amazon Web Services
 
Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitAndreas Heim
 
Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015yfauser
 
Subversion on-the-fly replication
Subversion on-the-fly replicationSubversion on-the-fly replication
Subversion on-the-fly replicationnormanmaurer
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos Sanchez
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environmentSumedt Jitpukdebodin
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Carlos Sanchez
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012Carlos Sanchez
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantBrian Hogan
 
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
 

Similar to Automacao devops (20)

Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-NapocaWP-CLI Workshop at WordPress Meetup Cluj-Napoca
WP-CLI Workshop at WordPress Meetup Cluj-Napoca
 
Maven 2 - more than a build tool
Maven 2 - more than a build toolMaven 2 - more than a build tool
Maven 2 - more than a build tool
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
 
Virtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profitVirtualize and automate your development environment for fun and profit
Virtualize and automate your development environment for fun and profit
 
Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015Open stack and_vagrant-os-meetup-2015
Open stack and_vagrant-os-meetup-2015
 
Subversion on-the-fly replication
Subversion on-the-fly replicationSubversion on-the-fly replication
Subversion on-the-fly replication
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environment
 
Lumen
LumenLumen
Lumen
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
 
From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012From Dev to DevOps - FOSDEM 2012
From Dev to DevOps - FOSDEM 2012
 
Capistrano Overview
Capistrano OverviewCapistrano Overview
Capistrano Overview
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
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
 

More from Fabio Kung

DockerCon 2014: Thoughts on interoperable containers
DockerCon 2014: Thoughts on interoperable containersDockerCon 2014: Thoughts on interoperable containers
DockerCon 2014: Thoughts on interoperable containersFabio Kung
 
Linux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environmentLinux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environmentFabio Kung
 
Dicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no CloudDicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no CloudFabio Kung
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionFabio Kung
 
Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Fabio Kung
 
Cloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como ServiçoCloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como ServiçoFabio Kung
 
Storage para virtualização
Storage para virtualizaçãoStorage para virtualização
Storage para virtualizaçãoFabio Kung
 
DSLs Internas e Ruby
DSLs Internas e RubyDSLs Internas e Ruby
DSLs Internas e RubyFabio Kung
 
Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?Fabio Kung
 
Ruby, muito mais que reflexivo
Ruby, muito mais que reflexivoRuby, muito mais que reflexivo
Ruby, muito mais que reflexivoFabio Kung
 
SOA não precisa ser buzzword
SOA não precisa ser buzzwordSOA não precisa ser buzzword
SOA não precisa ser buzzwordFabio Kung
 
JRuby on Rails
JRuby on RailsJRuby on Rails
JRuby on RailsFabio Kung
 

More from Fabio Kung (12)

DockerCon 2014: Thoughts on interoperable containers
DockerCon 2014: Thoughts on interoperable containersDockerCon 2014: Thoughts on interoperable containers
DockerCon 2014: Thoughts on interoperable containers
 
Linux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environmentLinux Containers at scale: challenges in a very dense environment
Linux Containers at scale: challenges in a very dense environment
 
Dicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no CloudDicas e truques para ser um bom inquilino no Cloud
Dicas e truques para ser um bom inquilino no Cloud
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to Production
 
Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!Ruby 2.0: to infinity... and beyond!
Ruby 2.0: to infinity... and beyond!
 
Cloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como ServiçoCloud IaaS - Detalhes da Infraestrutura como Serviço
Cloud IaaS - Detalhes da Infraestrutura como Serviço
 
Storage para virtualização
Storage para virtualizaçãoStorage para virtualização
Storage para virtualização
 
DSLs Internas e Ruby
DSLs Internas e RubyDSLs Internas e Ruby
DSLs Internas e Ruby
 
Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?
 
Ruby, muito mais que reflexivo
Ruby, muito mais que reflexivoRuby, muito mais que reflexivo
Ruby, muito mais que reflexivo
 
SOA não precisa ser buzzword
SOA não precisa ser buzzwordSOA não precisa ser buzzword
SOA não precisa ser buzzword
 
JRuby on Rails
JRuby on RailsJRuby on Rails
JRuby on Rails
 

Automacao devops

Editor's Notes

  1. assincrono
  2. solido redis tonf of plugins