SlideShare une entreprise Scribd logo
1  sur  50
Télécharger pour lire hors ligne
Managing Network Devices
                           Nan Liu // Sept. 27, 2012


Monday, September 17, 12
Network Devices

                   • Why Puppet?
                   • Puppet Device
                   • Load Balancer Demo
                   • Developing Devices (Advanced)


Monday, September 17, 12
Application Deployment


                   • Server + Puppet
                   • ???
                   • Profit!



Monday, September 17, 12
Missing Step?
                   • Linking Application Services




Monday, September 17, 12
#puppetize
                   • Network Device + Puppet




Monday, September 17, 12
Puppet Proxy Agent

                   • Certificates
                   • Retrieves Device Plugins
                   • Retrieves Device Catalog
                   • Connects to Device
                   • Apply Device Resources
                   • Reports to Master

Monday, September 17, 12
Proxy Agent
                   • Workflow   Device        Proxy Agent      Puppet Master

                                               Device Cert
                                                                  Plugins

                                             Device Connect


                           Custom Facts


                                                              Compile Catalog
                                                                (functions)


                                             Apply Catalog


                           Device resource
                                                              puppet report

                                                Report?       Report Procesor



                                                 Finish




Monday, September 17, 12
Commands

                   • facter
                   • puppet resource
                   • puppet apply (maybe)
                   • puppet device


Monday, September 17, 12
Device.conf

                   • $confdir/device.conf:
                           [node1_name]
                           type <device_type>
                           url <protocol://username:password@url/>

                           [node2_name]
                           type <device_type>
                           url <protocol://username:password@url/>



Monday, September 17, 12
Device $vardir

                   • $vardir(/var/lib/puppet /var/opt/lib/pe-puppet)
                           # tree ./devices
                           └── f5.puppetlabs.lan
                              ├── client_yaml
                              ├── facts
                              ├── ssl
                              └── state




Monday, September 17, 12
Puppet Resource


                   • Abstraction (Type/Provider)
                   • Declarative (Language)
                   • Idempotent (Enforcement)



Monday, September 17, 12
Manifest v.s. GUI
        f5_pool { 'apt.puppetlabs.com':
          ensure                            =>   'present',
          action_on_service_down            =>   'SERVICE_DOWN_ACTION_NONE',
          allow_nat_state                   =>   'STATE_ENABLED',
          allow_snat_state                  =>   'STATE_ENABLED',
          client_ip_tos                     =>   '65535',
          client_link_qos                   =>   '65535',
          gateway_failsafe_unit_id          =>   '0',
          lb_method                         =>   'LB_METHOD_ROUND_ROBIN',
          member                            =>   {'10.10.0.22:8080' => {...},
                                                  '10.10.0.23:8080' => {...},
                                                  '10.10.0.24:80' => {...}},
          minimum_active_member             =>   '0',
          minimum_up_member                 =>   '0',
          minimum_up_member_action          =>   'HA_ACTION_FAILOVER',
          minimum_up_member_enabled_state   =>   'STATE_DISABLED',
          monitor_association               =>   {...},
          server_ip_tos                     =>   '65535',
          server_link_qos                   =>   '65535',
          simple_timeout                    =>   '0',
          slow_ramp_time                    =>   '10',
        }




Monday, September 17, 12
Manifests = Text


                   • Version Control
                   • Auditing
                   • Workflow



Monday, September 17, 12
Resource Demo


                   • export FACTER_url=https://admin:admin@f5/
                   • puppet resource f5_*



Monday, September 17, 12
Web Module
                   • web::site definition:
                           define web::site (
                             $port = '80',
                             # F5 pool member settings:
                             $connection_limit = '0',
                             $dynamic_ratio     = '1',
                             $priority          = '0',
                             $ratio             = '1'
                           ) {
                             # setup web service.
                           }




Monday, September 17, 12
Web Server Nodes
                   • webservers nodes:
                           node /^webserver21/ {
                             web::site { 'apt.puppetlabs.com':
                               port => '8080',
                             }
                           }

                           node /^webserver22/ {
                             web::site { 'apt.puppetlabs.com':
                               port              => '80',
                               connection_limit => '100',
                             }
                             web::site { 'yum.puppetlabs.com':
                               port => '8080',
                             }
                           }


Monday, September 17, 12
Composing Services
                   • Network Device = Nodes
                           node 'f5.puppetlabs.lan' {
                             f5_virtualserver { 'apt.puppetlabs.com':
                              ...
                             }
                             f5_pool { 'apt.puppetlabs.com':
                               ...
                             }
                             f5_monitor { 'apt.puppetlabs.com':
                              ...
                             }
                           }




Monday, September 17, 12
Problem?
                   • f5_pool member ip address:




Monday, September 17, 12
Export Resources?
                   • ONLY export/collect resources.
                           f5_pool { 'apt.puppetlabs.com':
                             ensure    => 'present',
                             lb_method => 'LB_METHOD_ROUND_ROBIN',
                             member    => { '10.10.0.22:8080' => {},
                                            '10.10.0.23:8081' => {},
                                            '10.10.0.24:80' => {},
                             },
                           }

                   • f5_poolmember ?


Monday, September 17, 12
Resources Meta Type


                   • Puppet Resources:
                           resources { 'f5_poolmember':
                             purge => true,
                           }


                   • Does not support Resource subset =/
                           purge poolmember in pool ‘X’ ?




Monday, September 17, 12
Query Puppet DB


                   • ruby-puppetdb:
                           https://github.com/ripienaar/ruby-puppetdb

                   • puppetdb query:
                           https://github.com/dalen/puppet-
                           puppetdbquery




Monday, September 17, 12
Puppet Catalog
                   • Puppet Catalog = Resources + Relationship
                   • Facts + Manifests => compilation => Catalog


                              Facts
                           Agent        Master




Monday, September 17, 12
Puppet Catalog
                   • Puppet Catalog = Resources + Relationship
                   • Facts + Manifests => compilation => Catalog


                                           Facts
                           Agent        Master




Monday, September 17, 12
Puppet Catalog
                   • Puppet Catalog = Resources + Relationship
                   • Facts + Manifests => compilation => Catalog


                           Agent        Master




Monday, September 17, 12
Puppet Catalog
                   • Puppet Catalog = Resources + Relationship
                   • Facts + Manifests => compilation => Catalog


                           Agent        Master




Monday, September 17, 12
Puppet Catalog
                   • Puppet Catalog = Resources + Relationship
                   • Facts + Manifests => compilation => Catalog


                           Agent        Master




Monday, September 17, 12
Puppet Catalog
                   • Puppet Catalog = Resources + Relationship
                   • Facts + Manifests => compilation => Catalog


                                                 Catalog
                           Agent        Master




Monday, September 17, 12
Puppet Catalog
                   • Puppet Catalog = Resources + Relationship
                   • Facts + Manifests => compilation => Catalog


                             Catalog
                           Agent        Master




Monday, September 17, 12
Puppet DB
                   • Stores all client catalogs
                                          Master         Puppet DB




                           Web Server 1   Web Server 2




Monday, September 17, 12
Puppet DB
                   • Stores all client catalogs
                                          Master         Puppet DB




                           Web Server 1   Web Server 2




Monday, September 17, 12
Puppet DB
                   • Stores all client catalogs
                                          Master         Puppet DB




                           Web Server 1   Web Server 2




Monday, September 17, 12
Puppet DB
                   • Stores all client catalogs
                                          Master         Puppet DB




                           Web Server 1   Web Server 2




Monday, September 17, 12
Puppet DB
                   • Stores all client catalogs
                                          Master         Puppet DB




                           Web Server 1   Web Server 2




Monday, September 17, 12
web::loadbalancer
                define web::loadbalancer (
                  $site = $name, $address, $port = 80
                ) {
                  f5_virtualserver { $name:
                    ensure            => 'present',
                    connection_limit => '0',
                    default_pool_name => $name,
                    destination       => "${address}:${port}",
                    require           => F5_pool[$name],
                  }
                  # $member = ???
                  f5_pool { $name:
                    ensure    => 'present',
                    lb_method => 'LB_METHOD_ROUND_ROBIN',
                    member    => $member,
                  }
                }



Monday, September 17, 12
Query Puppet DB
                   • puppet query resource
                           --query='Class[web::server]'
                           --filter='Web::Site[apt.puppetlabs.com]'
                           --render-as yaml
                           "Web::Site[apt.puppetlabs.com]":
                            - parameters:
                               port: "8080"
                              nodes:
                               - webserver22
                               - webserver23
                            - parameters:
                               port: "80"
                               connection_limit: "100"
                              nodes:
                               - webserver24




Monday, September 17, 12
Pool Member
                    $ip_facts = query_facts('ipaddress', 'Class[web::server]')
                    $websites = query_resources('Class[web::server]',
                                                "Web::Site[${site}]")
                    $member   = web_poolmember($ip_facts, $websites)

                   • Results
                           { "10.0.2.24:80" =>
                             { "connection_limit"   =>   "0", 
                               "ratio"              =>   "1",
                               "priority"           =>   "3",
                               "dynamic_ratio"      =>   "1" },
                             "10.0.2.22:8080" =>
                             { "connection_limit"   =>   "0",
                               "ratio"              =>   "1",
                               "priority"           =>   "1",
                               "dynamic_ratio"      =>   "1"}
                           }


Monday, September 17, 12
Device Node
                   • F5 node:
                           node 'f5.puppetlabs.lan' {
                             web::loadbalancer { 'apt.puppetlabs.com':
                               address => '192.168.1.200',
                             }
                             web::loadbalancer { 'yum.puppetlabs.com':
                               address => '192.168.1.201',
                             }
                             web::loadbalancer { 'download.puppetlabs.com':
                               address => '192.168.1.202',
                             }
                           }




Monday, September 17, 12
Demo


                   • Update web::site deployment
                   • Update F5 Loadbalancer



Monday, September 17, 12
Developing Devices

                   • WARNING:
                           Recommend developing regular Puppet Type/Provider first.
                           Recommend developing regular Puppet Type/Provider first.
                           Recommend developing regular Puppet Type/Provider first.
                           Recommend developing regular Puppet Type/Provider first.
                           ...


                   • Puppet Type/Provider Session (Dan)


Monday, September 17, 12
Developing Devices

                   • Transport
                   • Facter
                   • Type
                   • Provider (retrieve/set)


Monday, September 17, 12
Transport
                   • device.conf
                           [node_name]
                           type <device_type>
                           url <protocol://username:password@url/>

                   • telnet
                   • ssh
                   • iControl (SOAP)
                   • (netconf)

Monday, September 17, 12
Initialize Device
                   • puppet/util/network_device.rb
      class Puppet::Util::NetworkDevice
        ...
        def self.init(device)
          require "puppet/util/network_device/#{device.provider}/device"
          @current = Puppet::Util::NetworkDevice.
            const_get(device.provider.capitalize).
            const_get(:Device).new(device.url)
        rescue => detail
          raise "Can't load #{device.provider} for #{device.name}:
      #{detail}"
        end
      end




Monday, September 17, 12
device.rb
                   • puppet/util/network_device/<type>/device.rb
     class Puppet::Util::NetworkDevice::Juniper

       attr_accessor :url, :transport

       def initialize(url)
         @url = URI.parse(url)
         @transport = Puppet::Util::NetworkDevice::Transport::Juniper.new
         end
       end

       def facts
         @facts ||=
     Puppet::Util::NetworkDevice::Transport::Juniper::facts.new(@transport)
         @facts.retrieve
       end
     end



Monday, September 17, 12
Device Facts
                   • puppet/util/network_device/<type>/facts.rb




Monday, September 17, 12
Type
                   • apply_to_all
                   • apply_to_host
                   • apply_to_device
                    Puppet::Type.newtype(:f5_monitor) do
                      @doc = "Manage F5 monitor."
                      apply_to_device
                      ensurable
                      ...
                      newproperty(:template_state) do
                        desc "The monitor templates' enabled/disabled states."
                        newvalues(/^STATE_(DISABLED|ENABLED)$/)
                      end
                    end


Monday, September 17, 12
Provider
                   • ssh/telnet:
                           output = transport.command('sh interface')

                   • Access custom transport:
                 def self.transport
                   if Facter.value(:url) then
                     Puppet.debug "F5: connecting via facter url."
                     @device ||=
               Puppet::Util::NetworkDevice::F5::Device.new(Facter.value(:url))
                   else
                     @device ||= Puppet::Util::NetworkDevice.current
                     raise Puppet::Error, "Error Msg..." unless @device
                   end

                   @tranport = @device.transport
                 end


Monday, September 17, 12
Testing


                   • Puppet Resource (self.instances)
                   • Puppet Apply (apply_to_host)



Monday, September 17, 12
Future

                   • Software defined infrastructure
                   • Systems (Google Compute Engine as Resource)
                   • Application (puppet agent)
                   • Network (puppet device)


Monday, September 17, 12
Questions?




Monday, September 17, 12
Thank you for attending




Monday, September 17, 12

Contenu connexe

Tendances

The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015Fernando Hamasaki de Amorim
 
Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Jacob Kaplan-Moss
 
Cooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugCooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugDavid Golden
 
Effective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 DevelopersEffective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 DevelopersMarcin Chwedziak
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)DECK36
 
New Symfony Tips & Tricks (SymfonyCon Paris 2015)
New Symfony Tips & Tricks (SymfonyCon Paris 2015)New Symfony Tips & Tricks (SymfonyCon Paris 2015)
New Symfony Tips & Tricks (SymfonyCon Paris 2015)Javier Eguiluz
 
JavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New WorldJavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New WorldRobert Nyman
 
Puppet atbazaarvoice
Puppet atbazaarvoicePuppet atbazaarvoice
Puppet atbazaarvoiceDave Barcelo
 
Responsible DI: Ditch the Frameworks
Responsible DI: Ditch the FrameworksResponsible DI: Ditch the Frameworks
Responsible DI: Ditch the Frameworkskenbot
 
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014Matthias Noback
 
Dutch php conference_apc_mem2010
Dutch php conference_apc_mem2010Dutch php conference_apc_mem2010
Dutch php conference_apc_mem2010isnull
 
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017Ryan Weaver
 
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and DesktopElizabeth Smith
 
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Campmodern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet CampPuppet
 
Buildr In Action @devoxx france 2012
Buildr In Action @devoxx france 2012Buildr In Action @devoxx france 2012
Buildr In Action @devoxx france 2012alexismidon
 

Tendances (20)

The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
 
Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)Introduction To Django (Strange Loop 2011)
Introduction To Django (Strange Loop 2011)
 
Cooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugCooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with Jitterbug
 
Step objects
Step objectsStep objects
Step objects
 
Effective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 DevelopersEffective Doctrine2: Performance Tips for Symfony2 Developers
Effective Doctrine2: Performance Tips for Symfony2 Developers
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricks
 
Django Heresies
Django HeresiesDjango Heresies
Django Heresies
 
WCLV13 JavaScript
WCLV13 JavaScriptWCLV13 JavaScript
WCLV13 JavaScript
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)
 
New Symfony Tips & Tricks (SymfonyCon Paris 2015)
New Symfony Tips & Tricks (SymfonyCon Paris 2015)New Symfony Tips & Tricks (SymfonyCon Paris 2015)
New Symfony Tips & Tricks (SymfonyCon Paris 2015)
 
JavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New WorldJavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New World
 
Puppet atbazaarvoice
Puppet atbazaarvoicePuppet atbazaarvoice
Puppet atbazaarvoice
 
Responsible DI: Ditch the Frameworks
Responsible DI: Ditch the FrameworksResponsible DI: Ditch the Frameworks
Responsible DI: Ditch the Frameworks
 
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
High Quality Symfony Bundles tutorial - Dutch PHP Conference 2014
 
Dutch php conference_apc_mem2010
Dutch php conference_apc_mem2010Dutch php conference_apc_mem2010
Dutch php conference_apc_mem2010
 
Symfony 2
Symfony 2Symfony 2
Symfony 2
 
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
 
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and Desktop
 
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Campmodern module development - Ken Barber 2012 Edinburgh Puppet Camp
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
 
Buildr In Action @devoxx france 2012
Buildr In Action @devoxx france 2012Buildr In Action @devoxx france 2012
Buildr In Action @devoxx france 2012
 

En vedette

Puppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet ModulesPuppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet ModulesPuppet
 
Puppet Camp Sydney 2015: The (Im)perfect Puppet Module
Puppet Camp Sydney 2015: The (Im)perfect Puppet ModulePuppet Camp Sydney 2015: The (Im)perfect Puppet Module
Puppet Camp Sydney 2015: The (Im)perfect Puppet ModulePuppet
 
Using Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & HadoopUsing Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & HadoopPuppet
 
Puppet Development Workflow
Puppet Development WorkflowPuppet Development Workflow
Puppet Development WorkflowJeffery Smith
 
Devops, Dungeons & Dragons
Devops, Dungeons & Dragons Devops, Dungeons & Dragons
Devops, Dungeons & Dragons David Lutz
 
Puppet - Configuration Management Made Eas(ier)
Puppet - Configuration Management Made Eas(ier)Puppet - Configuration Management Made Eas(ier)
Puppet - Configuration Management Made Eas(ier)Aaron Bernstein
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Puppet
 
A Introduction of Packer
A Introduction of PackerA Introduction of Packer
A Introduction of PackerFreyr Lin
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerGeorge Miranda
 
Packer, where DevOps begins
Packer, where DevOps beginsPacker, where DevOps begins
Packer, where DevOps beginsJeff Hung
 
Ppt With Speaker Notes
Ppt With Speaker NotesPpt With Speaker Notes
Ppt With Speaker NotesGurpreet Singh
 
The 2016 Guide to IT Identity Management
The 2016 Guide to IT Identity ManagementThe 2016 Guide to IT Identity Management
The 2016 Guide to IT Identity ManagementJumpCloud
 
Steven paul jobs
Steven paul jobsSteven paul jobs
Steven paul jobsritvik2003
 
Развитие корпоративного управления в венчурных фондах
Развитие корпоративного управления в венчурных фондахРазвитие корпоративного управления в венчурных фондах
Развитие корпоративного управления в венчурных фондахBranan
 

En vedette (17)

Puppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet ModulesPuppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
Puppet Camp Atlanta 2014: Continuous Deployment of Puppet Modules
 
Puppet Camp Sydney 2015: The (Im)perfect Puppet Module
Puppet Camp Sydney 2015: The (Im)perfect Puppet ModulePuppet Camp Sydney 2015: The (Im)perfect Puppet Module
Puppet Camp Sydney 2015: The (Im)perfect Puppet Module
 
Using Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & HadoopUsing Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & Hadoop
 
Puppet Development Workflow
Puppet Development WorkflowPuppet Development Workflow
Puppet Development Workflow
 
Devops, Dungeons & Dragons
Devops, Dungeons & Dragons Devops, Dungeons & Dragons
Devops, Dungeons & Dragons
 
Puppet - Configuration Management Made Eas(ier)
Puppet - Configuration Management Made Eas(ier)Puppet - Configuration Management Made Eas(ier)
Puppet - Configuration Management Made Eas(ier)
 
Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014Writing and Publishing Puppet Modules - PuppetConf 2014
Writing and Publishing Puppet Modules - PuppetConf 2014
 
Docker
Docker Docker
Docker
 
Docker internals
Docker internalsDocker internals
Docker internals
 
A Introduction of Packer
A Introduction of PackerA Introduction of Packer
A Introduction of Packer
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and Packer
 
Packer, where DevOps begins
Packer, where DevOps beginsPacker, where DevOps begins
Packer, where DevOps begins
 
Ppt With Speaker Notes
Ppt With Speaker NotesPpt With Speaker Notes
Ppt With Speaker Notes
 
The 2016 Guide to IT Identity Management
The 2016 Guide to IT Identity ManagementThe 2016 Guide to IT Identity Management
The 2016 Guide to IT Identity Management
 
Why we post social media?
Why we post social media?Why we post social media?
Why we post social media?
 
Steven paul jobs
Steven paul jobsSteven paul jobs
Steven paul jobs
 
Развитие корпоративного управления в венчурных фондах
Развитие корпоративного управления в венчурных фондахРазвитие корпоративного управления в венчурных фондах
Развитие корпоративного управления в венчурных фондах
 

Similaire à Puppet Conf 2012 - Managing Network Devices with Puppet

Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk GötzNETWAYS
 
Puppet at Pinterest
Puppet at PinterestPuppet at Pinterest
Puppet at PinterestPuppet
 
Puppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG editionPuppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG editionJoshua Thijssen
 
Fixing Growing Pains With Puppet Data Patterns
Fixing Growing Pains With Puppet Data PatternsFixing Growing Pains With Puppet Data Patterns
Fixing Growing Pains With Puppet Data PatternsMartin Jackson
 
Puppet and the HashiStack
Puppet and the HashiStackPuppet and the HashiStack
Puppet and the HashiStackBram Vogelaar
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment Evaldo Felipe
 
V mware
V mwareV mware
V mwaredvmug1
 
Puppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMwarePuppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMwaresubtitle
 
Puppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worldsPuppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worldsPuppet
 
Stanford Hackathon - Puppet Modules
Stanford Hackathon - Puppet ModulesStanford Hackathon - Puppet Modules
Stanford Hackathon - Puppet ModulesPuppet
 
Picking gem ruby for penetration testers
Picking gem ruby for penetration testersPicking gem ruby for penetration testers
Picking gem ruby for penetration testersPaolo Perego
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetAchieve Internet
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkDaniel Spector
 
Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!cloudbring
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpresoke4qqq
 
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NYPuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NYPuppet
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetWalter Heck
 

Similaire à Puppet Conf 2012 - Managing Network Devices with Puppet (20)

Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk Götz
 
Puppet at Pinterest
Puppet at PinterestPuppet at Pinterest
Puppet at Pinterest
 
Puppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG editionPuppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG edition
 
Fixing Growing Pains With Puppet Data Patterns
Fixing Growing Pains With Puppet Data PatternsFixing Growing Pains With Puppet Data Patterns
Fixing Growing Pains With Puppet Data Patterns
 
Puppet and the HashiStack
Puppet and the HashiStackPuppet and the HashiStack
Puppet and the HashiStack
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment
 
V mware
V mwareV mware
V mware
 
Puppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMwarePuppet Primer, Robbie Jerrom, Solution Architect VMware
Puppet Primer, Robbie Jerrom, Solution Architect VMware
 
Puppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worldsPuppet and AWS: Getting the best of both worlds
Puppet and AWS: Getting the best of both worlds
 
Stanford Hackathon - Puppet Modules
Stanford Hackathon - Puppet ModulesStanford Hackathon - Puppet Modules
Stanford Hackathon - Puppet Modules
 
Sprockets
SprocketsSprockets
Sprockets
 
Puppet
PuppetPuppet
Puppet
 
Picking gem ruby for penetration testers
Picking gem ruby for penetration testersPicking gem ruby for penetration testers
Picking gem ruby for penetration testers
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
 
Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
 
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NYPuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 

Dernier

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Dernier (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Puppet Conf 2012 - Managing Network Devices with Puppet

  • 1. Managing Network Devices Nan Liu // Sept. 27, 2012 Monday, September 17, 12
  • 2. Network Devices • Why Puppet? • Puppet Device • Load Balancer Demo • Developing Devices (Advanced) Monday, September 17, 12
  • 3. Application Deployment • Server + Puppet • ??? • Profit! Monday, September 17, 12
  • 4. Missing Step? • Linking Application Services Monday, September 17, 12
  • 5. #puppetize • Network Device + Puppet Monday, September 17, 12
  • 6. Puppet Proxy Agent • Certificates • Retrieves Device Plugins • Retrieves Device Catalog • Connects to Device • Apply Device Resources • Reports to Master Monday, September 17, 12
  • 7. Proxy Agent • Workflow Device Proxy Agent Puppet Master Device Cert Plugins Device Connect Custom Facts Compile Catalog (functions) Apply Catalog Device resource puppet report Report? Report Procesor Finish Monday, September 17, 12
  • 8. Commands • facter • puppet resource • puppet apply (maybe) • puppet device Monday, September 17, 12
  • 9. Device.conf • $confdir/device.conf: [node1_name] type <device_type> url <protocol://username:password@url/> [node2_name] type <device_type> url <protocol://username:password@url/> Monday, September 17, 12
  • 10. Device $vardir • $vardir(/var/lib/puppet /var/opt/lib/pe-puppet) # tree ./devices └── f5.puppetlabs.lan ├── client_yaml ├── facts ├── ssl └── state Monday, September 17, 12
  • 11. Puppet Resource • Abstraction (Type/Provider) • Declarative (Language) • Idempotent (Enforcement) Monday, September 17, 12
  • 12. Manifest v.s. GUI f5_pool { 'apt.puppetlabs.com':   ensure => 'present',   action_on_service_down => 'SERVICE_DOWN_ACTION_NONE',   allow_nat_state => 'STATE_ENABLED',   allow_snat_state => 'STATE_ENABLED',   client_ip_tos => '65535',   client_link_qos => '65535',   gateway_failsafe_unit_id => '0',   lb_method => 'LB_METHOD_ROUND_ROBIN',   member => {'10.10.0.22:8080' => {...}, '10.10.0.23:8080' => {...}, '10.10.0.24:80' => {...}},   minimum_active_member => '0',   minimum_up_member => '0',   minimum_up_member_action => 'HA_ACTION_FAILOVER',   minimum_up_member_enabled_state => 'STATE_DISABLED',   monitor_association => {...},   server_ip_tos => '65535',   server_link_qos => '65535',   simple_timeout => '0',   slow_ramp_time => '10', } Monday, September 17, 12
  • 13. Manifests = Text • Version Control • Auditing • Workflow Monday, September 17, 12
  • 14. Resource Demo • export FACTER_url=https://admin:admin@f5/ • puppet resource f5_* Monday, September 17, 12
  • 15. Web Module • web::site definition: define web::site (   $port = '80', # F5 pool member settings:   $connection_limit = '0',   $dynamic_ratio = '1',   $priority = '0',   $ratio = '1' ) { # setup web service. } Monday, September 17, 12
  • 16. Web Server Nodes • webservers nodes: node /^webserver21/ {   web::site { 'apt.puppetlabs.com':     port => '8080',   } } node /^webserver22/ {   web::site { 'apt.puppetlabs.com':     port => '80',     connection_limit => '100',   }   web::site { 'yum.puppetlabs.com':     port => '8080',   } } Monday, September 17, 12
  • 17. Composing Services • Network Device = Nodes node 'f5.puppetlabs.lan' { f5_virtualserver { 'apt.puppetlabs.com':    ...   }   f5_pool { 'apt.puppetlabs.com':   ...   }   f5_monitor { 'apt.puppetlabs.com':    ...   } } Monday, September 17, 12
  • 18. Problem? • f5_pool member ip address: Monday, September 17, 12
  • 19. Export Resources? • ONLY export/collect resources. f5_pool { 'apt.puppetlabs.com':   ensure => 'present',   lb_method => 'LB_METHOD_ROUND_ROBIN',   member => { '10.10.0.22:8080' => {},                  '10.10.0.23:8081' => {},             '10.10.0.24:80' => {},   }, } • f5_poolmember ? Monday, September 17, 12
  • 20. Resources Meta Type • Puppet Resources: resources { 'f5_poolmember':   purge => true, } • Does not support Resource subset =/ purge poolmember in pool ‘X’ ? Monday, September 17, 12
  • 21. Query Puppet DB • ruby-puppetdb: https://github.com/ripienaar/ruby-puppetdb • puppetdb query: https://github.com/dalen/puppet- puppetdbquery Monday, September 17, 12
  • 22. Puppet Catalog • Puppet Catalog = Resources + Relationship • Facts + Manifests => compilation => Catalog Facts Agent Master Monday, September 17, 12
  • 23. Puppet Catalog • Puppet Catalog = Resources + Relationship • Facts + Manifests => compilation => Catalog Facts Agent Master Monday, September 17, 12
  • 24. Puppet Catalog • Puppet Catalog = Resources + Relationship • Facts + Manifests => compilation => Catalog Agent Master Monday, September 17, 12
  • 25. Puppet Catalog • Puppet Catalog = Resources + Relationship • Facts + Manifests => compilation => Catalog Agent Master Monday, September 17, 12
  • 26. Puppet Catalog • Puppet Catalog = Resources + Relationship • Facts + Manifests => compilation => Catalog Agent Master Monday, September 17, 12
  • 27. Puppet Catalog • Puppet Catalog = Resources + Relationship • Facts + Manifests => compilation => Catalog Catalog Agent Master Monday, September 17, 12
  • 28. Puppet Catalog • Puppet Catalog = Resources + Relationship • Facts + Manifests => compilation => Catalog Catalog Agent Master Monday, September 17, 12
  • 29. Puppet DB • Stores all client catalogs Master Puppet DB Web Server 1 Web Server 2 Monday, September 17, 12
  • 30. Puppet DB • Stores all client catalogs Master Puppet DB Web Server 1 Web Server 2 Monday, September 17, 12
  • 31. Puppet DB • Stores all client catalogs Master Puppet DB Web Server 1 Web Server 2 Monday, September 17, 12
  • 32. Puppet DB • Stores all client catalogs Master Puppet DB Web Server 1 Web Server 2 Monday, September 17, 12
  • 33. Puppet DB • Stores all client catalogs Master Puppet DB Web Server 1 Web Server 2 Monday, September 17, 12
  • 34. web::loadbalancer define web::loadbalancer (   $site = $name, $address, $port = 80 ) {   f5_virtualserver { $name:     ensure => 'present',     connection_limit => '0',     default_pool_name => $name,     destination => "${address}:${port}",     require => F5_pool[$name],   } # $member = ???   f5_pool { $name:     ensure => 'present',     lb_method => 'LB_METHOD_ROUND_ROBIN',     member => $member,   } } Monday, September 17, 12
  • 35. Query Puppet DB • puppet query resource --query='Class[web::server]' --filter='Web::Site[apt.puppetlabs.com]' --render-as yaml "Web::Site[apt.puppetlabs.com]": - parameters: port: "8080" nodes: - webserver22 - webserver23 - parameters: port: "80" connection_limit: "100" nodes: - webserver24 Monday, September 17, 12
  • 36. Pool Member $ip_facts = query_facts('ipaddress', 'Class[web::server]') $websites = query_resources('Class[web::server]', "Web::Site[${site}]") $member = web_poolmember($ip_facts, $websites) • Results { "10.0.2.24:80" => { "connection_limit" => "0",  "ratio" => "1",     "priority" => "3", "dynamic_ratio" => "1" },   "10.0.2.22:8080" => { "connection_limit" => "0", "ratio" => "1",     "priority" => "1",     "dynamic_ratio" => "1"} } Monday, September 17, 12
  • 37. Device Node • F5 node: node 'f5.puppetlabs.lan' {   web::loadbalancer { 'apt.puppetlabs.com':     address => '192.168.1.200',   }   web::loadbalancer { 'yum.puppetlabs.com':     address => '192.168.1.201',   }   web::loadbalancer { 'download.puppetlabs.com':     address => '192.168.1.202',   } } Monday, September 17, 12
  • 38. Demo • Update web::site deployment • Update F5 Loadbalancer Monday, September 17, 12
  • 39. Developing Devices • WARNING: Recommend developing regular Puppet Type/Provider first. Recommend developing regular Puppet Type/Provider first. Recommend developing regular Puppet Type/Provider first. Recommend developing regular Puppet Type/Provider first. ... • Puppet Type/Provider Session (Dan) Monday, September 17, 12
  • 40. Developing Devices • Transport • Facter • Type • Provider (retrieve/set) Monday, September 17, 12
  • 41. Transport • device.conf [node_name] type <device_type> url <protocol://username:password@url/> • telnet • ssh • iControl (SOAP) • (netconf) Monday, September 17, 12
  • 42. Initialize Device • puppet/util/network_device.rb class Puppet::Util::NetworkDevice   ...   def self.init(device)     require "puppet/util/network_device/#{device.provider}/device"     @current = Puppet::Util::NetworkDevice. const_get(device.provider.capitalize). const_get(:Device).new(device.url)   rescue => detail     raise "Can't load #{device.provider} for #{device.name}: #{detail}"   end end Monday, September 17, 12
  • 43. device.rb • puppet/util/network_device/<type>/device.rb class Puppet::Util::NetworkDevice::Juniper   attr_accessor :url, :transport   def initialize(url)     @url = URI.parse(url)     @transport = Puppet::Util::NetworkDevice::Transport::Juniper.new     end   end   def facts     @facts ||= Puppet::Util::NetworkDevice::Transport::Juniper::facts.new(@transport)     @facts.retrieve   end end Monday, September 17, 12
  • 44. Device Facts • puppet/util/network_device/<type>/facts.rb Monday, September 17, 12
  • 45. Type • apply_to_all • apply_to_host • apply_to_device Puppet::Type.newtype(:f5_monitor) do   @doc = "Manage F5 monitor."   apply_to_device   ensurable   ...   newproperty(:template_state) do     desc "The monitor templates' enabled/disabled states."     newvalues(/^STATE_(DISABLED|ENABLED)$/)   end end Monday, September 17, 12
  • 46. Provider • ssh/telnet: output = transport.command('sh interface') • Access custom transport:   def self.transport     if Facter.value(:url) then       Puppet.debug "F5: connecting via facter url."       @device ||= Puppet::Util::NetworkDevice::F5::Device.new(Facter.value(:url))     else       @device ||= Puppet::Util::NetworkDevice.current       raise Puppet::Error, "Error Msg..." unless @device     end     @tranport = @device.transport   end Monday, September 17, 12
  • 47. Testing • Puppet Resource (self.instances) • Puppet Apply (apply_to_host) Monday, September 17, 12
  • 48. Future • Software defined infrastructure • Systems (Google Compute Engine as Resource) • Application (puppet agent) • Network (puppet device) Monday, September 17, 12
  • 50. Thank you for attending Monday, September 17, 12