Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Infrastructure as Ruby code

Infrastructure as Ruby code

RubyConf Argentina 2012

Augusto Becciu

October 20, 2012
Tweet

More Decks by Augusto Becciu

Other Decks in Programming

Transcript

  1. Who am I? • @abecciu {github, twitter} • Hacker •

    Startups guy • Cur: CTO at • Prev: Dev / Ops Engineer at
  2. Traditional Sysadmin • Manual (mostly) • Lack of process •

    Bunch of shell and perl scripts • Fear of change • Monolithic architectures • Durable bare metal hardware • Vertical scalability
  3. The Cloud Computing Evolution • Service Oriented Architectures • Horizontal

    Scalability • Transition to virtualized ephemeral resources • Instant provisioning • OMG APIs !!!
  4. Infrastructure as code • Automation • Repeatability • Agility •

    Scalability Apply software engineering practices to systems administration and operation.
  5. “Enable the reconstruction of the business from nothing but a

    source code repository, an application data backup, and bare metal resources” Jesse Robins describes the goal brilliantly:
  6. We need to... • Install packages • Create directories •

    Create users • Get the code • Install gems • Run migrations • Run the app server
  7. Unit Testing $ gem install rspec $ gem install chefspec

    $ rspec --color rubyconfar https://github.com/acrmp/chefspec https://github.com/acrmp/chefspec
  8. Acceptance Testing $ gem install cucumber-nagios $ cucumber-nagios-gen project rubyconfar

    $ cd rubyconfar $ ./bin/cucumber-nagios features/ http://auxesis.github.com/cucumber-nagios/
  9. $ gem install knife-ec2 $ knife ec2 server create -I

    ami-2e845d33 -f t1.micro -r ‘recipe[rubyconfar]’ $ knife ec2 server delete instance_id
  10. Build your own awesome tools, it’s easy! + + gli

    Net::SSH + http://net-ssh.rubyforge.org/ http://davetron5000.github.com/gli/