SlideShare a Scribd company logo
From Dev to DevOps


Carlos Sanchez
@csanchez
http://carlossanchez.eu
http://maestrodev.com
Apache
  @csanchez                   Maven
                                       Apache
   ASF                                 Archiva
  Member
                                   Apache
Eclipse IAM                       Continuum




              blog.carlossanchez.eu
Dev... What?
Agile




           planning
   iterative development
  continuous integration
release soon, release often
From Dev to DevOps - Codemotion ES 2012
DevQaOps ?
From Dev to DevOps - Codemotion ES 2012
DevOps addresses



       Fear of change
     Risky deployments
 It works on my machine!
         Siloisation
Dev Change vs. Ops stability
Individuals and interactions over processes and tools
 Working software over comprehensive documentation
  Customer collaboration over contract negotiation
    Responding to change over following a plan
Our highest priority is to satisfy the customer through early and
            continuous delivery of valuable software.
 Welcome changing requirements, even late in development.
  Agile processes harness change for the customer's competitive
                             advantage.
 Deliver working software frequently, from a couple of weeks
to a couple of months, with a preference to the shorter timescale.
   Business people and developers must work together daily
                      throughout the project.
 The most efficient and effective method of conveying information
       to and within a development team is face-to-face
                           conversation.
    Agile processes promote sustainable development. The
sponsors, developers, and users should be able to maintain
                    a constant pace indefinitely.
From Dev to DevOps - Codemotion ES 2012
Dev
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
What developers do today to
specify target environments is
         NOT enough
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
Ops
requirements

Operating System
config files
packages installed
multi stage configurations
dev
QA
pre-production
production
Deployment




How do I deploy this?
documentation
manual steps
prone to errors
Cloud




How do I deploy this?
to hundreds of servers
DevOps
From Dev to DevOps - Codemotion ES 2012
Should I worry about my OPS
            job?
yes
 my job is to make other
people’s jobs unnecessary
yes no
you should see the NOOPS
           guys
From Dev to DevOps - Codemotion ES 2012
DevOps is NOT about the tools
Nice, BUT




how can I implement IT
Tools can enable
change in behavior
  and eventually
  change culture

     Patrick Debois
DevOps tools



everyone is intelligent
enough
every tool is cloud
enabled
every tool is DevOps(tm)
DevOps tools: infrastructure automation


                 infrastructure as code
      it’s all invented, now it’s standardized
Infrastructure as Code


New solutions bring new challenges

Follow development best practices
              tagging
            branching
             releasing
       dev, QA, production
New solutions bring new problems
               DEVOPS


  “MY MACHINES ARE BEING PROVISIONED”
From Dev to DevOps - Codemotion ES 2012
Puppet
                 exec { "maven-untar":

manifests          command => "tar xf /tmp/x.tgz",
                   cwd => "/opt",
                   creates => "/opt/apache-maven-${version}",
ruby-like          path => ["/bin"],
                 } ->
 ERB templates   file { "/usr/bin/mvn":
                   ensure => link,
                   target => "/opt/apache-maven-${version}/bin/mvn",
                 }
                 file { "/usr/local/bin/mvn":
                   ensure => absent,
                   require => Exec["maven-untar"],
                 }
                 file { "$home/.mavenrc":
                   mode => "0600",
                   owner => $user,
                   content => template("maven/mavenrc.erb"),
                   require => User[$user],
                 }
Puppet



infrastructure IS code




                   package { 'openssh-server':
                     ensure => present,
                   }
Puppet

declarative model
state vs process
 no scripting



                    service { 'ntp':
                      name      => 'ntpd',
                      ensure    => running,
                    }
Puppet




master - agent
architecture
Vagrant
Vagrant


     Oracle VirtualBox cmdline automation
       Easy Puppet and Chef provisioning
  Keep VM configuration for different projects
Share boxes and configuration files across teams
          base box + configuration files
Vagrant base boxes




  www.vagrantbox.es

anywhere! just (big) files
using Vagrant

$ gem install vagrant
$ vagrant box add centos-6.0-x86_64 
      http://dl.dropbox.com/u/1627760/centos-6.0-x86_64.box
$   vagrant    init myproject
$   vagrant    up
$   vagrant    ssh
$   vagrant    suspend
$   vagrant    resume
$   vagrant    destroy
Vagrant
Vagrant::Config.run do |config|

  # Every Vagrant virtual environment requires a box to build off of.
  config.vm.box = "centos-6.0-x86_64"

  # The url from where the 'config.vm.box' box will be fetched
  config.vm.box_url = "http://dl.dropbox.com/u/1627760/centos-6.0-x86_64.box"

  # Boot with a GUI so you can see the screen. (Default is headless)
  #config.vm.boot_mode = :gui

  # Assign this VM to a host only network IP, allowing you to access it via the IP.
  # config.vm.network "33.33.33.10"

  # Forward a port from the guest to the host, which allows for outside
  # computers to access the VM, whereas host only networking does not.
  config.vm.forward_port "sonar", 9000, 19000

  # Enable provisioning with Puppet stand alone.
  config.vm.share_folder("templates", "/tmp/vagrant-puppet/templates", "templates")

  config.vm.provision :puppet do |puppet|
    puppet.manifest_file = "base.pp"
    puppet.module_path = "mymodules"
    puppet.options = ["--templatedir","/tmp/vagrant-puppet/templates"]
    puppet.options = "-v -d"
  end

end
manifests/base.pp



package { jdk:
  ensure => installed,
  name    => $operatingsystem ? {
     centOS => "java-1.6.0-openjdk-devel",
     Ubuntu => "openjdk-6-jdk",
     default => "jdk",
  },
}
VeeWee
VeeWee




   easily build Vagrant base boxes
https://github.com/jedi4ever/veewee
using VeeWee


$ gem install veewee
$ vagrant basebox templates
$ vagrant basebox define 'my-ubuntu-server'
    'ubuntu-11.04-server-amd64'
# customize definitions/my-ubuntu-server
$ vagrant basebox build 'my-ubuntu-server'
$ vagrant basebox validate 'my-ubuntu-server'
$ vagrant basebox export 'my-ubuntu-server'
$ vagrant box add 'my-ubuntu-server'
    'my-ubuntu-server.box'
$ vagrant init 'my-ubuntu-server'
Geppetto
http://cloudsmith.github.com/geppetto
Puppet DSL
Puppet resources


user { 'dave':
  ensure     =>   present,
  uid        =>   '507',
  gid        =>   'admin',
  shell      =>   '/bin/zsh',
  home       =>   '/home/dave',
  managehome =>   true,
}
Puppet standalone




$ puppet apply my_test_manifest.pp
ordering

file {'/tmp/test1':
  ensure => present,
  content => "Hi.",
}

notify {'/tmp/test1 has already
been synced.':
  require => File['/tmp/test1'],
}
ordering


file {'/tmp/test1':
  ensure => present,
  content => "Hi.",
} ->

notify {'/tmp/test1 has already
been synced.':}
variables



$longthing = "Imagine I have something really
long in here. Like an SSH key, let's say."

file {'authorized_keys':
  path    => '/root/.ssh/authorized_keys',
  content => $longthing,
}
facts

host {'self':
  ensure         =>   present,
  name           =>   $::fqdn,
  host_aliases   =>   ['puppet', $::hostname],
  ip             =>   $::ipaddress,
}

file {'motd':
  ensure => file,
  path    => '/etc/motd',
  mode    => 0644,
  content => "Welcome to ${::hostname},na $
{::operatingsystem} island in the sea of ${::domain}.
n",
}
conditionals

case $operatingsystem {
  centos, redhat: { $apache = "httpd" }
  debian, ubuntu: { $apache = "apache2" }
  default: { fail("Unrecognized operating system for
webserver") }
}

$apache = $operatingsystem ? {
     centos                => 'httpd',
     redhat                => 'httpd',
     /(?i)(ubuntu|debian)/ => "apache2-$1",
       # (Don't actually use that package name.)
     default               => undef,
   }
class definition

class ntp {

    package { 'ntp':
      ensure => installed,
    }

    service { 'ntp':
      name      => 'ntpd',
      ensure    => running,
      enable    => true,
      subscribe => File['ntp.conf'],
    }
}
parameterized classes

class paramclassexample ($value1, $value2 = "Default
value") {
  notify {"Value 1 is ${value1}.":}
  notify {"Value 2 is ${value2}.":}
}

class {'paramclassexample':
  value1 => 'Something',
  value2 => 'Something else',
}

class {'paramclassexample':
  value1 => 'Something',
}
modules

{module}/

    files/
    lib/
    manifests/
         init.pp
         {class}.pp
         {defined type}.pp
         {namespace}/
             {class}.pp
             {class}.pp
    templates/
    tests/
templating




file {'/etc/foo.conf':
  ensure => file,
  require => Package['foo'],
  content => template('foo/foo.conf.erb'),
}
templates/foo.conf.erb




OS is <%= $::operatingsystem %>
node configuration

# nodes.pp

node 'someserver.domain.com' inherits basenode {
    $web_fqdn = 'www.domain.com'
    include genericwebserver
    include some_other_service
}

node 'ldapmaster.domain.com' inherits basenode {
    include s_ldap::master
}

node 'humanresources.domain.com' inherits basenode {
    include c_humanresources
}
Examples
Tomcat cluster + postgres



     postgres database
         db.acme.com
      tomcat servers
        www1.acme.com
        www2.acme.com
             ...
          webapp
Modules required

git clone 
  https://github.com/maestrodev/puppet-postgres 
  modules/postgres
git clone 
  https://github.com/camptocamp/puppet-tomcat 
  modules/tomcat
git clone 
  https://github.com/maestrodev/puppet-maven 
  modules/maven
modules/example/database.pp

class 'database' ($db_password = 'password') {

    class { "postgres" :
      password => 'postgres'
    } ->
    postgres::initdb{ "initdb": } ->
    postgres::enable { "enable": } ->
    postgres::user {
      "web": passwd => $db_password
    } ->
    postgres::createdb { "web": owner=> "web" }
}
modules/example/webserver.pp

class 'webserver'($db_server = 'localhost', $db_password = 'password') {

  package { "java-1.6.0-openjdk-devel":
    ensure => "latest"
  }

  class { 'tomcat': } ->
  tomcat::instance {"mytomcat": } ->

  class { 'maven::maven': } ->
  maven { "/srv/tomcat/${mytomcat}/webapps/mywebapp.war":
    id => "com.acme:mywebapp:1.0:war",
  }

  file { '/etc/acme.conf':
    content => "db = ${db_server}
password = ${db_password}",
  }
}
manifests/site.pp

node 'base' {
  $db_password = 'web'
}

node 'db.acme.com' inherits base {
  class {'database': db_password => $db_password }
}

# www1.acme.com, www2.acme.com, www3.acme.com,...
node /^wwwd+.acme.com$/ inherits base {
  class {'webserver':
    db_server => 'db.acme.com',
    db_password => $db_password,
  }
}
spec/hosts/ db_spec.pp & www_spec.pp

 require 'rspec-puppet'

 describe 'db.acme.com' do
   it { should contain_package('postgres') }
 end


 require 'rspec-puppet'

 describe 'www55.acme.com' do
   it 'should have valid config file' do
     content = catalogue.resource('file', '/etc/acme.conf').send
 (:parameters)[:content]
     content.should match /db.acme.com/
     content.should match /password = web/
   end
 end
Example code and slides



                    Available at
        http://slideshare.carlossanchez.eu
          http://github.carlossanchez.eu
           http://blog.carlossanchez.eu
https://github.com/maestrodev/puppet-modules
Gracias!

http://blog.carlossanchez.eu
http://maestrodev.com
csanchez@maestrodev.com
carlos@apache.org

@csanchez
Photo Credits
               Son of Man Lego - Alex Eylar
http://www.flickr.com/photos/hoyvinmayvin/4702772452/
                 Brick wall - Luis Argerich
  http://www.flickr.com/photos/lrargerich/4353397797/
       Agile vs. Iterative flow - Christopher Little
http://en.wikipedia.org/wiki/File:Agile-vs-iterative-flow.jpg
                    DevOps - Rajiv.Pant
        http://en.wikipedia.org/wiki/File:Devops.png
         Pimientos de Padron - Howard Walfish
   http://www.flickr.com/photos/h-bomb/4868400647/
                    Compiling - XKCD
                    http://xkcd.com/303/
            Printer in 1568 - Meggs, Philip B
 http://en.wikipedia.org/wiki/File:Printer_in_1568-ce.png
                  Relativity - M. C. Escher
http://en.wikipedia.org/wiki/File:Escher%27s_Relativity.jpg
             Teacher and class - Herald Post
 http://www.flickr.com/photos/heraldpost/5169295832/

More Related Content

What's hot (20)

PDF
DevOps(4) : Ansible(2) - (MOSG)
Soshi Nemoto
 
PDF
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
PDF
Continuous infrastructure testing
Daniel Paulus
 
PDF
Configuration Surgery with Augeas
Puppet
 
PDF
Puppet: Eclipsecon ALM 2013
grim_radical
 
PPT
Learn basic ansible using docker
Larry Cai
 
PDF
Ansible 實戰:top down 觀點
William Yeh
 
PDF
DevOps(3) : Ansible - (MOSG)
Soshi Nemoto
 
PDF
Ansible not only for Dummies
Łukasz Proszek
 
PDF
Amazon EC2 Container Service in Action
Remotty
 
PDF
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
Puppet
 
KEY
Making Your Capistrano Recipe Book
Tim Riley
 
PDF
10 Million hits a day with WordPress using a $15 VPS
Paolo Tonin
 
PDF
Vagrant for real (codemotion rome 2016)
Michele Orselli
 
PDF
Docker puppetcamp london 2013
Tomas Doran
 
PDF
DevOps(2) : Vagrant - (MOSG)
Soshi Nemoto
 
PDF
Instruction: dev environment
Soshi Nemoto
 
PDF
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Puppet
 
PDF
Fabric workshop(1) - (MOSG)
Soshi Nemoto
 
PDF
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
raccoony
 
DevOps(4) : Ansible(2) - (MOSG)
Soshi Nemoto
 
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
Continuous infrastructure testing
Daniel Paulus
 
Configuration Surgery with Augeas
Puppet
 
Puppet: Eclipsecon ALM 2013
grim_radical
 
Learn basic ansible using docker
Larry Cai
 
Ansible 實戰:top down 觀點
William Yeh
 
DevOps(3) : Ansible - (MOSG)
Soshi Nemoto
 
Ansible not only for Dummies
Łukasz Proszek
 
Amazon EC2 Container Service in Action
Remotty
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
Puppet
 
Making Your Capistrano Recipe Book
Tim Riley
 
10 Million hits a day with WordPress using a $15 VPS
Paolo Tonin
 
Vagrant for real (codemotion rome 2016)
Michele Orselli
 
Docker puppetcamp london 2013
Tomas Doran
 
DevOps(2) : Vagrant - (MOSG)
Soshi Nemoto
 
Instruction: dev environment
Soshi Nemoto
 
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Puppet
 
Fabric workshop(1) - (MOSG)
Soshi Nemoto
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
raccoony
 

Similar to From Dev to DevOps - Codemotion ES 2012 (20)

PDF
From Dev to DevOps
Agile Spain
 
PDF
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Puppet
 
PDF
How I hack on puppet modules
Kris Buytaert
 
PDF
20090514 Introducing Puppet To Sasag
garrett honeycutt
 
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
KEY
20100425 Configuration Management With Puppet Lfnw
garrett honeycutt
 
KEY
Puppet
gbws
 
PDF
Security Testing Using Infrastructure-As-Code
Vision Concepts Infrastructure Services Solution
 
PDF
Test driven infrastructure
Skills Matter Talks
 
PPTX
Introduction to DevOps
Dmitry Buzdin
 
PDF
Developing IT infrastructures with Puppet
Alessandro Franceschi
 
PDF
SCALE 2011 Deploying OpenStack with Chef
Matt Ray
 
PPTX
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Bamdad Dashtban
 
PDF
Consistent Development Environment with Vagrant and Chef
Gerald Villorente
 
PDF
Using Vagrant, Puppet, Testing & Hadoop
Puppet
 
PDF
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
OlinData
 
PDF
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
Walter Heck
 
PDF
ReUse Your (Puppet) Modules!
Alessandro Franceschi
 
PDF
Deploying software at Scale
Kris Buytaert
 
PDF
TXLF: Automated Deployment of OpenStack with Chef
Matt Ray
 
From Dev to DevOps
Agile Spain
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Puppet
 
How I hack on puppet modules
Kris Buytaert
 
20090514 Introducing Puppet To Sasag
garrett honeycutt
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
20100425 Configuration Management With Puppet Lfnw
garrett honeycutt
 
Puppet
gbws
 
Security Testing Using Infrastructure-As-Code
Vision Concepts Infrastructure Services Solution
 
Test driven infrastructure
Skills Matter Talks
 
Introduction to DevOps
Dmitry Buzdin
 
Developing IT infrastructures with Puppet
Alessandro Franceschi
 
SCALE 2011 Deploying OpenStack with Chef
Matt Ray
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Bamdad Dashtban
 
Consistent Development Environment with Vagrant and Chef
Gerald Villorente
 
Using Vagrant, Puppet, Testing & Hadoop
Puppet
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
OlinData
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
Walter Heck
 
ReUse Your (Puppet) Modules!
Alessandro Franceschi
 
Deploying software at Scale
Kris Buytaert
 
TXLF: Automated Deployment of OpenStack with Chef
Matt Ray
 
Ad

More from Carlos Sanchez (20)

PDF
Using Containers for Continuous Integration and Continuous Delivery. KubeCon ...
Carlos Sanchez
 
PDF
Using Kubernetes for Continuous Integration and Continuous Delivery
Carlos Sanchez
 
PDF
Divide and Conquer: Easier Continuous Delivery using Micro-Services
Carlos Sanchez
 
PDF
Using Kubernetes for Continuous Integration and Continuous Delivery. Java2days
Carlos Sanchez
 
PDF
Using Containers for Continuous Integration and Continuous Delivery
Carlos Sanchez
 
PDF
Divide and Conquer: Easier Continuous Delivery using Micro-Services
Carlos Sanchez
 
PDF
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Carlos Sanchez
 
PDF
Testing Distributed Micro Services. Agile Testing Days 2017
Carlos Sanchez
 
PDF
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
Carlos Sanchez
 
PDF
From Monolith to Docker Distributed Applications
Carlos Sanchez
 
PDF
From Monolith to Docker Distributed Applications. JavaOne
Carlos Sanchez
 
PDF
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
Carlos Sanchez
 
PDF
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
Carlos Sanchez
 
PDF
From Monolith to Docker Distributed Applications
Carlos Sanchez
 
PDF
Scaling Jenkins with Docker and Kubernetes
Carlos Sanchez
 
PDF
Using Docker for Testing
Carlos Sanchez
 
PDF
Scaling Docker with Kubernetes
Carlos Sanchez
 
PPTX
Scaling Jenkins with Docker and Kubernetes
Carlos Sanchez
 
PDF
Scaling Docker with Kubernetes
Carlos Sanchez
 
KEY
Enterprise Build And Test In The Cloud
Carlos Sanchez
 
Using Containers for Continuous Integration and Continuous Delivery. KubeCon ...
Carlos Sanchez
 
Using Kubernetes for Continuous Integration and Continuous Delivery
Carlos Sanchez
 
Divide and Conquer: Easier Continuous Delivery using Micro-Services
Carlos Sanchez
 
Using Kubernetes for Continuous Integration and Continuous Delivery. Java2days
Carlos Sanchez
 
Using Containers for Continuous Integration and Continuous Delivery
Carlos Sanchez
 
Divide and Conquer: Easier Continuous Delivery using Micro-Services
Carlos Sanchez
 
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Carlos Sanchez
 
Testing Distributed Micro Services. Agile Testing Days 2017
Carlos Sanchez
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
Carlos Sanchez
 
From Monolith to Docker Distributed Applications
Carlos Sanchez
 
From Monolith to Docker Distributed Applications. JavaOne
Carlos Sanchez
 
Scaling Jenkins with Docker: Swarm, Kubernetes or Mesos?
Carlos Sanchez
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
Carlos Sanchez
 
From Monolith to Docker Distributed Applications
Carlos Sanchez
 
Scaling Jenkins with Docker and Kubernetes
Carlos Sanchez
 
Using Docker for Testing
Carlos Sanchez
 
Scaling Docker with Kubernetes
Carlos Sanchez
 
Scaling Jenkins with Docker and Kubernetes
Carlos Sanchez
 
Scaling Docker with Kubernetes
Carlos Sanchez
 
Enterprise Build And Test In The Cloud
Carlos Sanchez
 
Ad

Recently uploaded (20)

PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 

From Dev to DevOps - Codemotion ES 2012

  • 1. From Dev to DevOps Carlos Sanchez @csanchez http://carlossanchez.eu http://maestrodev.com
  • 2. Apache @csanchez Maven Apache ASF Archiva Member Apache Eclipse IAM Continuum blog.carlossanchez.eu
  • 4. Agile planning iterative development continuous integration release soon, release often
  • 8. DevOps addresses Fear of change Risky deployments It works on my machine! Siloisation Dev Change vs. Ops stability
  • 9. Individuals and interactions over processes and tools Working software over comprehensive documentation Customer collaboration over contract negotiation Responding to change over following a plan
  • 10. Our highest priority is to satisfy the customer through early and continuous delivery of valuable software. Welcome changing requirements, even late in development. Agile processes harness change for the customer's competitive advantage. Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale. Business people and developers must work together daily throughout the project. The most efficient and effective method of conveying information to and within a development team is face-to-face conversation. Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely.
  • 12. Dev
  • 16. What developers do today to specify target environments is NOT enough
  • 19. Ops
  • 20. requirements Operating System config files packages installed multi stage configurations dev QA pre-production production
  • 21. Deployment How do I deploy this? documentation manual steps prone to errors
  • 22. Cloud How do I deploy this? to hundreds of servers
  • 25. Should I worry about my OPS job?
  • 26. yes my job is to make other people’s jobs unnecessary
  • 27. yes no you should see the NOOPS guys
  • 29. DevOps is NOT about the tools
  • 30. Nice, BUT how can I implement IT
  • 31. Tools can enable change in behavior and eventually change culture Patrick Debois
  • 32. DevOps tools everyone is intelligent enough every tool is cloud enabled every tool is DevOps(tm)
  • 33. DevOps tools: infrastructure automation infrastructure as code it’s all invented, now it’s standardized
  • 34. Infrastructure as Code New solutions bring new challenges Follow development best practices tagging branching releasing dev, QA, production
  • 35. New solutions bring new problems DEVOPS “MY MACHINES ARE BEING PROVISIONED”
  • 37. Puppet exec { "maven-untar": manifests command => "tar xf /tmp/x.tgz", cwd => "/opt", creates => "/opt/apache-maven-${version}", ruby-like path => ["/bin"], } -> ERB templates file { "/usr/bin/mvn": ensure => link, target => "/opt/apache-maven-${version}/bin/mvn", } file { "/usr/local/bin/mvn": ensure => absent, require => Exec["maven-untar"], } file { "$home/.mavenrc": mode => "0600", owner => $user, content => template("maven/mavenrc.erb"), require => User[$user], }
  • 38. Puppet infrastructure IS code package { 'openssh-server': ensure => present, }
  • 39. Puppet declarative model state vs process no scripting service { 'ntp': name => 'ntpd', ensure => running, }
  • 42. Vagrant Oracle VirtualBox cmdline automation Easy Puppet and Chef provisioning Keep VM configuration for different projects Share boxes and configuration files across teams base box + configuration files
  • 43. Vagrant base boxes www.vagrantbox.es anywhere! just (big) files
  • 44. using Vagrant $ gem install vagrant $ vagrant box add centos-6.0-x86_64 http://dl.dropbox.com/u/1627760/centos-6.0-x86_64.box $ vagrant init myproject $ vagrant up $ vagrant ssh $ vagrant suspend $ vagrant resume $ vagrant destroy
  • 45. Vagrant Vagrant::Config.run do |config| # Every Vagrant virtual environment requires a box to build off of. config.vm.box = "centos-6.0-x86_64" # The url from where the 'config.vm.box' box will be fetched config.vm.box_url = "http://dl.dropbox.com/u/1627760/centos-6.0-x86_64.box" # Boot with a GUI so you can see the screen. (Default is headless) #config.vm.boot_mode = :gui # Assign this VM to a host only network IP, allowing you to access it via the IP. # config.vm.network "33.33.33.10" # Forward a port from the guest to the host, which allows for outside # computers to access the VM, whereas host only networking does not. config.vm.forward_port "sonar", 9000, 19000 # Enable provisioning with Puppet stand alone. config.vm.share_folder("templates", "/tmp/vagrant-puppet/templates", "templates") config.vm.provision :puppet do |puppet| puppet.manifest_file = "base.pp" puppet.module_path = "mymodules" puppet.options = ["--templatedir","/tmp/vagrant-puppet/templates"] puppet.options = "-v -d" end end
  • 46. manifests/base.pp package { jdk: ensure => installed, name => $operatingsystem ? { centOS => "java-1.6.0-openjdk-devel", Ubuntu => "openjdk-6-jdk", default => "jdk", }, }
  • 48. VeeWee easily build Vagrant base boxes https://github.com/jedi4ever/veewee
  • 49. using VeeWee $ gem install veewee $ vagrant basebox templates $ vagrant basebox define 'my-ubuntu-server' 'ubuntu-11.04-server-amd64' # customize definitions/my-ubuntu-server $ vagrant basebox build 'my-ubuntu-server' $ vagrant basebox validate 'my-ubuntu-server' $ vagrant basebox export 'my-ubuntu-server' $ vagrant box add 'my-ubuntu-server' 'my-ubuntu-server.box' $ vagrant init 'my-ubuntu-server'
  • 53. Puppet resources user { 'dave': ensure => present, uid => '507', gid => 'admin', shell => '/bin/zsh', home => '/home/dave', managehome => true, }
  • 54. Puppet standalone $ puppet apply my_test_manifest.pp
  • 55. ordering file {'/tmp/test1': ensure => present, content => "Hi.", } notify {'/tmp/test1 has already been synced.': require => File['/tmp/test1'], }
  • 56. ordering file {'/tmp/test1': ensure => present, content => "Hi.", } -> notify {'/tmp/test1 has already been synced.':}
  • 57. variables $longthing = "Imagine I have something really long in here. Like an SSH key, let's say." file {'authorized_keys': path => '/root/.ssh/authorized_keys', content => $longthing, }
  • 58. facts host {'self': ensure => present, name => $::fqdn, host_aliases => ['puppet', $::hostname], ip => $::ipaddress, } file {'motd': ensure => file, path => '/etc/motd', mode => 0644, content => "Welcome to ${::hostname},na $ {::operatingsystem} island in the sea of ${::domain}. n", }
  • 59. conditionals case $operatingsystem { centos, redhat: { $apache = "httpd" } debian, ubuntu: { $apache = "apache2" } default: { fail("Unrecognized operating system for webserver") } } $apache = $operatingsystem ? { centos => 'httpd', redhat => 'httpd', /(?i)(ubuntu|debian)/ => "apache2-$1", # (Don't actually use that package name.) default => undef, }
  • 60. class definition class ntp { package { 'ntp': ensure => installed, } service { 'ntp': name => 'ntpd', ensure => running, enable => true, subscribe => File['ntp.conf'], } }
  • 61. parameterized classes class paramclassexample ($value1, $value2 = "Default value") { notify {"Value 1 is ${value1}.":} notify {"Value 2 is ${value2}.":} } class {'paramclassexample': value1 => 'Something', value2 => 'Something else', } class {'paramclassexample': value1 => 'Something', }
  • 62. modules {module}/ files/ lib/ manifests/ init.pp {class}.pp {defined type}.pp {namespace}/ {class}.pp {class}.pp templates/ tests/
  • 63. templating file {'/etc/foo.conf': ensure => file, require => Package['foo'], content => template('foo/foo.conf.erb'), }
  • 64. templates/foo.conf.erb OS is <%= $::operatingsystem %>
  • 65. node configuration # nodes.pp node 'someserver.domain.com' inherits basenode { $web_fqdn = 'www.domain.com' include genericwebserver include some_other_service } node 'ldapmaster.domain.com' inherits basenode { include s_ldap::master } node 'humanresources.domain.com' inherits basenode { include c_humanresources }
  • 67. Tomcat cluster + postgres postgres database db.acme.com tomcat servers www1.acme.com www2.acme.com ... webapp
  • 68. Modules required git clone https://github.com/maestrodev/puppet-postgres modules/postgres git clone https://github.com/camptocamp/puppet-tomcat modules/tomcat git clone https://github.com/maestrodev/puppet-maven modules/maven
  • 69. modules/example/database.pp class 'database' ($db_password = 'password') { class { "postgres" : password => 'postgres' } -> postgres::initdb{ "initdb": } -> postgres::enable { "enable": } -> postgres::user { "web": passwd => $db_password } -> postgres::createdb { "web": owner=> "web" } }
  • 70. modules/example/webserver.pp class 'webserver'($db_server = 'localhost', $db_password = 'password') { package { "java-1.6.0-openjdk-devel": ensure => "latest" } class { 'tomcat': } -> tomcat::instance {"mytomcat": } -> class { 'maven::maven': } -> maven { "/srv/tomcat/${mytomcat}/webapps/mywebapp.war": id => "com.acme:mywebapp:1.0:war", } file { '/etc/acme.conf': content => "db = ${db_server} password = ${db_password}", } }
  • 71. manifests/site.pp node 'base' { $db_password = 'web' } node 'db.acme.com' inherits base { class {'database': db_password => $db_password } } # www1.acme.com, www2.acme.com, www3.acme.com,... node /^wwwd+.acme.com$/ inherits base { class {'webserver': db_server => 'db.acme.com', db_password => $db_password, } }
  • 72. spec/hosts/ db_spec.pp & www_spec.pp require 'rspec-puppet' describe 'db.acme.com' do it { should contain_package('postgres') } end require 'rspec-puppet' describe 'www55.acme.com' do it 'should have valid config file' do content = catalogue.resource('file', '/etc/acme.conf').send (:parameters)[:content] content.should match /db.acme.com/ content.should match /password = web/ end end
  • 73. Example code and slides Available at http://slideshare.carlossanchez.eu http://github.carlossanchez.eu http://blog.carlossanchez.eu https://github.com/maestrodev/puppet-modules
  • 75. Photo Credits Son of Man Lego - Alex Eylar http://www.flickr.com/photos/hoyvinmayvin/4702772452/ Brick wall - Luis Argerich http://www.flickr.com/photos/lrargerich/4353397797/ Agile vs. Iterative flow - Christopher Little http://en.wikipedia.org/wiki/File:Agile-vs-iterative-flow.jpg DevOps - Rajiv.Pant http://en.wikipedia.org/wiki/File:Devops.png Pimientos de Padron - Howard Walfish http://www.flickr.com/photos/h-bomb/4868400647/ Compiling - XKCD http://xkcd.com/303/ Printer in 1568 - Meggs, Philip B http://en.wikipedia.org/wiki/File:Printer_in_1568-ce.png Relativity - M. C. Escher http://en.wikipedia.org/wiki/File:Escher%27s_Relativity.jpg Teacher and class - Herald Post http://www.flickr.com/photos/heraldpost/5169295832/