SlideShare a Scribd company logo
From Dev to DevOps



Carlos Sanchez
MaestroDev
Hola!


Solutions Architect at
MaestroDev
Member of Apache
Software Foundation
Maven PMC, Continuum,
Archiva
Eclipse IAM co-lead
etc...
Dev... What?
Agile
Agile




           planning
   iterative development
  continuous integration
release soon, release often
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
DevQaOps ?
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
DevOps addresses
DevOps addresses



       Fear of change
     Risky deployments
 It works on my machine!
         Siloisation
Dev Change vs. Ops stability
Agile Manifesto
Agile Manifesto




Individuals and interactions over processes and tools
 Working software over comprehensive documentation
  Customer collaboration over contract negotiation
    Responding to change over following a plan
Agile Manifesto
Agile Manifesto




Our highest priority is to satisfy the customer through early
     and continuous delivery of valuable software.
Agile Manifesto
Agile Manifesto




   Welcome changing requirements, even late in
development. Agile processes harness change for the
        customer's competitive advantage.
Agile Manifesto
Agile Manifesto




Deliver working software frequently, from a couple of
 weeks to a couple of months, with a preference to the
                  shorter timescale.
Agile Manifesto
Agile Manifesto




Business people and developers must work together
            daily throughout the project.
Agile Manifesto
Agile Manifesto




Build projects around motivated individuals. Give them the
environment and support they need, and trust them to get
                      the job done.
Agile Manifesto
Agile Manifesto




    The most efficient and effective method of conveying
information to and within a development team is face-
                   to-face conversation.
Agile Manifesto
Agile Manifesto




Working software is the primary measure of progress.
Agile Manifesto
Agile Manifesto




Agile processes promote sustainable development. The
sponsors, developers, and users should be able to
          maintain a constant pace indefinitely.
Agile Manifesto
Agile Manifesto




Continuous attention to technical excellence and good
               design enhances agility.
Agile Manifesto
Agile Manifesto




Simplicity--the art of maximizing the amount of work not
                     done--is essential.
Agile Manifesto
Agile Manifesto




The best architectures, requirements, and designs emerge
               from self-organizing teams.
Agile Manifesto
Agile Manifesto




At regular intervals, the team reflects on how to become
   more effective, then tunes and adjusts its behavior
                        accordingly.
DevOps tools



everyone thinks is
intelligent enough
every tool thinks it’s cloud
enabled
every tool thinks it’s
DevOps
DevOps tools



everyone thinks is
intelligent enough
every tool thinks it’s cloud
enabled
every tool thinks it’s
DevOps
DevOps tools: infrastructure automation
DevOps tools: infrastructure automation


                 infrastructure as code
      it’s all invented, now it’s standardized
Dev
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
From Dev to DevOps - Apache Barcamp Spain 2011
Ops
requirements
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
Infrastructure as Code
Infrastructure as Code




Follow development best practices
              tagging
            branching
             releasing
       dev, QA, production
Nice, but




how can I do IT
Nice, but




how can I do IT
DevOps
From Dev to DevOps - Apache Barcamp Spain 2011
Puppet
Puppet


    infrastructure IS code
       declarative model
state vs process - no scripting
           manifests
             ruby
         ERB templates
 master - agent architecture
Puppet file structure
Puppet file structure




      /etc/puppet
    manifests/site.pp
   manifests/nodes.pp
Puppet resources
Puppet resources


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

 $ puppet resource user root

user { 'root':
    home => '/var/root',
    shell => '/bin/sh',
    uid => '0',
    ensure => 'present',
    password => '*',
    gid => '0',
    comment => 'System Administrator'
}
Puppet resources
Puppet resources

$ puppet resource user dave
ensure=present shell="/bin/zsh" home="/
home/dave" managehome=true

notice: /User[dave]/ensure: created

user { 'dave':
    ensure => 'present',
    home => '/home/dave',
    shell => '/bin/zsh'
}
Puppet resources
Puppet resources



file {'testfile':
  path    => '/tmp/testfile',
  ensure => present,
  mode    => 0640,
  content => "I'm a test file.",
}
notify {"I'm notifying you.":}
Puppet standalone
Puppet standalone




$ puppet apply my_test_manifest.pp
ordering
ordering

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

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


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

notify {'/tmp/test1 has already
been synced.':}
package / file /service / subscribe
package / file /service / subscribe

package { 'openssh-server':
  ensure => present,
  before => File['/etc/ssh/sshd_config'],
}

file { '/etc/ssh/sshd_config':
  ensure => file,
  mode   => 600,
  source => '/root/learning-manifests/sshd_config',
}

service { 'sshd':
  ensure     => running,
  enable     => true,
  hasrestart => true,
  hasstatus => true,
  subscribe => File['/etc/ssh/sshd_config'],
}
variables
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
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
conditionals

if $is_virtual {
  service {'ntpd':
    ensure => stopped,
    enable => false,
  }
}
else {
  service { 'ntpd':
    name       => 'ntpd',
    ensure     => running,
    enable     => true,
    hasrestart => true,
    require => Package['ntp'],
  }
}
conditionals
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 definition

class ntp {

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

    service { 'ntp':
      name      => 'ntpd',
      ensure    => running,
      enable    => true,
      subscribe => File['ntp.conf'],
    }
}
class declaration (1)
class declaration (1)




class {'ntp': }
class declaration (2)
class declaration (2)




include ntp
parameterized classes
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
modules

{module}/

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




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




OS is <%= $::operatingsystem %>
node configuration
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
}
Vagrant
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
Vagrant base boxes



         www.vagrantbox.es

       anywhere! just (big) files

VeeWee tool to automate installations
 https://github.com/jedi4ever/veewee
using Vagrant
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
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
manifests/base.pp



package { jdk:
  ensure => installed,
  name    => $operatingsystem ? {
     centOS => "java-1.6.0-openjdk-devel",
     Ubuntu => "openjdk-6-jdk",
     default => "jdk",
  },
}
Maven and Puppet
What can I do to automate deployment
What can I do to automate deployment




 Handle full deployment including infrastructure
             not just webapp deployment
    Help Ops with clear, automated manifests
 Ability to reproduce production environments
  in local box using Vagrant / VirtualBox / VMWare
Maven-Puppet module
Maven-Puppet module


         A Maven Puppet module

https://github.com/maestrodev/puppet-maven

   fetches Maven artifacts from the repo
        manages them with Puppet
         no more extra packaging
Requirements
Requirements



      Java JDK
    Apache Buildr

preinstalled in the box
chicken and egg problem
New Maven type
New Maven type




    maven { "/tmp/maven-core-2.2.1.jar":
      id => "org.apache.maven:maven-core:jar:2.2.1",
      repos => ["http://repo1.maven.apache.org/maven2",
              "http://mirrors.ibiblio.org/pub/mirrors/maven2"],
}
New Maven type
New Maven type



    maven { "/tmp/maven-core-2.2.1.jar":
      groupId => "org.apache.maven",
      artifactId => "maven-core",
      version => "2.2.1",
      packaging => "jar",
      repos => ["http://repo1.maven.apache.org/maven2",
              "http://mirrors.ibiblio.org/pub/mirrors/maven2"],
}
Example code
Example code




                    Available at
          http://github.carlossanchez.eu
           http://blog.carlossanchez.eu
https://github.com/maestrodev/puppet-modules
Questions?
Thanks!

http://maestrodev.com
http://carlossanchez.eu
csanchez@maestrodev.com
carlos@apache.org
csanchez
Photo Credits
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

More Related Content

KEY
From Dev to DevOps - ApacheCON NA 2011
KEY
From Dev to DevOps - FOSDEM 2012
KEY
Puppet for Java developers - JavaZone NO 2012
PDF
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
PDF
From Dev to DevOps
PDF
From Dev to DevOps - Codemotion ES 2012
PDF
Puppet: Eclipsecon ALM 2013
PDF
DevOps(4) : Ansible(2) - (MOSG)
From Dev to DevOps - ApacheCON NA 2011
From Dev to DevOps - FOSDEM 2012
Puppet for Java developers - JavaZone NO 2012
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
From Dev to DevOps
From Dev to DevOps - Codemotion ES 2012
Puppet: Eclipsecon ALM 2013
DevOps(4) : Ansible(2) - (MOSG)

What's hot (19)

PDF
Continuous infrastructure testing
PDF
10 Million hits a day with WordPress using a $15 VPS
PDF
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
PDF
Preparation study of_docker - (MOSG)
PDF
PuppetCamp SEA 1 - Puppet Deployment at OnApp
PDF
PuppetCamp SEA 1 - Use of Puppet
PDF
Antons Kranga Building Agile Infrastructures
PPTX
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
PPTX
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
PDF
DevOps(3) : Ansible - (MOSG)
PDF
Puppet fundamentals
PDF
Configuration Surgery with Augeas
KEY
Making Your Capistrano Recipe Book
KEY
Puppet for dummies - ZendCon 2011 Edition
PDF
Getting started with Ansible
PDF
Ansible 實戰:top down 觀點
PDF
DevOps(2) : Vagrant - (MOSG)
PDF
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
PDF
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Continuous infrastructure testing
10 Million hits a day with WordPress using a $15 VPS
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
Preparation study of_docker - (MOSG)
PuppetCamp SEA 1 - Puppet Deployment at OnApp
PuppetCamp SEA 1 - Use of Puppet
Antons Kranga Building Agile Infrastructures
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
DevOps(3) : Ansible - (MOSG)
Puppet fundamentals
Configuration Surgery with Augeas
Making Your Capistrano Recipe Book
Puppet for dummies - ZendCon 2011 Edition
Getting started with Ansible
Ansible 實戰:top down 觀點
DevOps(2) : Vagrant - (MOSG)
Beaker: Automated, Cloud-Based Acceptance Testing - PuppetConf 2014
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Ad

Similar to From Dev to DevOps - Apache Barcamp Spain 2011 (20)

PPTX
Introduction to DevOps
PDF
Ansible new paradigms for orchestration
PPTX
Harmonious Development: Via Vagrant and Puppet
PDF
Lean Php Presentation
PDF
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
PDF
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
PDF
Developing IT infrastructures with Puppet
PDF
Workshop quality assurance for php projects - ZendCon 2013
PDF
Burn down the silos! Helping dev and ops gel on high availability websites
PDF
Puppet for Sys Admins
PDF
Provisioning with Puppet
PDF
Workshop quality assurance for php projects - phpbelfast
PDF
The "Holy Grail" of Dev/Ops
PPTX
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
PPTX
Automating Software Development Life Cycle - A DevOps Approach
PDF
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
PPT
Dance for the puppet master: G6 Tech Talk
PPTX
drupal ci cd concept cornel univercity.pptx
PPTX
Anatomy of a Build Pipeline
PDF
Chef - industrialize and automate your infrastructure
Introduction to DevOps
Ansible new paradigms for orchestration
Harmonious Development: Via Vagrant and Puppet
Lean Php Presentation
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Developing IT infrastructures with Puppet
Workshop quality assurance for php projects - ZendCon 2013
Burn down the silos! Helping dev and ops gel on high availability websites
Puppet for Sys Admins
Provisioning with Puppet
Workshop quality assurance for php projects - phpbelfast
The "Holy Grail" of Dev/Ops
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Automating Software Development Life Cycle - A DevOps Approach
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Dance for the puppet master: G6 Tech Talk
drupal ci cd concept cornel univercity.pptx
Anatomy of a Build Pipeline
Chef - industrialize and automate your infrastructure
Ad

More from Carlos Sanchez (20)

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

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Cloud computing and distributed systems.
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
A Presentation on Artificial Intelligence
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Diabetes mellitus diagnosis method based random forest with bat algorithm
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Big Data Technologies - Introduction.pptx
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
A Presentation on Artificial Intelligence
Understanding_Digital_Forensics_Presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Machine learning based COVID-19 study performance prediction
Review of recent advances in non-invasive hemoglobin estimation
Advanced methodologies resolving dimensionality complications for autism neur...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

From Dev to DevOps - Apache Barcamp Spain 2011

Editor's Notes