SlideShare une entreprise Scribd logo
1  sur  55
Modern Module
 Development
       2012-03-23
  Puppet Camp Edinburgh

            Ken Barber
   Professional Services Engineer
       ken@puppetlabs.com
 http://linkedin.com/in/ken_barber
     IRC & Twitter: @ken_barber
What is a module?
•   A re-usable way of sharing common components:
    •   Classes
    •   Defined Resources
    •   Ruby Resources
    •   Files
    •   Templates
    •   Functions
    •   Facts
We need more
  modules!
and they need to
be good quality ...
Whats new(ish) in
Module Development?

    •   Puppet Module Face
    •   rspec-puppet
    •   puppet-lint
    •   Kwalify
But lets talk
patterns first ...
Why are patterns
  important?
Class Patterns

•   Most installation and management problems consist
    of:
    •   Installing software using files or packages
    •   Modifying configuration files
    •   Starting services
We commonly refer
to this pattern as:

     Package,
      Config,
      Service
Package Class

class bind::package {
  package { $bind::packages:
    ensure => installed,
  }
}
Config Class
class bind::config {
  file { $bind::config_file:
    content => template(“${module_name}/named.conf”),
    owner => $bind::user,
    group => $bind::group,
    mode => ‘0644’,
  }
}
Service Class
class bind::service {
  service { $bind::services:
    ensure     => running,
    enable     => true,
    hasstatus => true,
    hasrestart => true,
  }
}
Main Class
class bind {
  anchor { ‘bind::start’: }->
  class { ‘bind::package’: }~>
  class { ‘bind::config’: }~>
  class { ‘bind::service’: }~>
  anchor { ‘bind::end’: }
}
What are anchors?

•   Provided in stdlib
•   Anchors are resource that ‘do nothing’
•   They ensure the edge of the classes are demarcated
    properly so the graph executes in the expected
    order
But what about
defined resources?
Defined Resources
define bind::zone (
  $value = ‘nil’
  ){
  file { “/etc/bind/config.d/${name}.conf”:
    content => “${name} = ${value}n”,
    require => Class[‘bind::package’],
    notify => Class[‘bind::service’],
  }
}
Package, Config,
     Service Pattern

•   This pattern is good for ~80% of situations.
•   Deals with ordering in a non-complex way, working
    with defined resources as well.
Params Pattern
Default
           Parameters

•   Most parameters have OS dependant defaults.
•   In the past this was done with case statements in
    the main modules.
Class Parameters

•   I generally use two types of class parameters:
    •   User-tuneable parameters
    •   Advanced parameters for overriding items such
        as package name, service name configuration file
        paths
Params Pattern
The trick is to move your OS based param lookup into
manifests/params.pp:
 class bind::params {
   case $::operatingsystem {
     'ubuntu', 'debian': {
       $package = 'bind9'
       $service = 'bind9'
       $config_dir = '/etc/bind'
     }
     ‘centos’, ‘redhat’: {
       $package = ‘bind’
       $service = ‘bind’
       $config_dir = ‘/etc/named’
     }
     default: {
       fail(“Unknown OS: $::operatingsystem”)
     }
   }
 }
Params Pattern
Then inherit this in your base class like so:

 class bind (
   $package = $bind::params::package,
   $service      = $bind::params::service,
   $config_dir = $bind::params::config_dir
   ) inherits bind::params {

     ...

 }
Params Pattern
Then elsewhere in your code, reference the fully
qualified parameter from your bind class:



 class bind::package {
   package { $bind::packages:
     ensure => installed,
   }
 }
Puppet Module
Tool will now be a
  Puppet Face!
Puppet Module Tool
# puppet help module
USAGE: puppet module <action>

This subcommand can find, install, and manage modules from the Puppet Forge,
a repository of user-contributed Puppet code. It can also generate empty
modules, and prepare locally developed modules for release on the Forge.

OPTIONS:
 --mode MODE                 - The run mode to use (user, agent, or master).
 --render-as FORMAT            - The rendering format to use.
 --verbose                - Whether to log verbosely.
 --debug                 - Whether to log debug information.

ACTIONS:
 build      Build a module release package.
 changes      Show modified files of an installed module.
 clean      Clean the module download cache.
 generate Generate boilerplate for a new module.
 install   Install a module from a repository or release archive.
 list     List installed modules
 search      Search a repository for a module.
 uninstall Uninstall a puppet module.
 upgrade      Upgrade a puppet module.

See 'puppet man module' or 'man puppet-module' for full help.
Puppet Module
          Face

•   Obviously still subject to design changes before
    release ....
Validating
Parameters
Validating
             Parameters
•   Your allowed set of class parameters are like an
    Interface Contract to your users
•   A lot of bugs in code are to do with bad input
•   We have three mechanisms for validating input:
    •   parameter definitions in the class
    •   stdlib validate_* functions
    •   kwalify
Kwalify Validation

•   Uses the kwalify library - which is a language
    independent way of validating JSON/YAML style
    data structures.
•   Kwalify has binding in many languages - so its a
    nice universal choice for structured data validation.
Kwalify

•   Provides a single declarative way of defining what
    parameters are valid.
•   When validation fails, it shows all cases of failure.
•   Doesn’t handle logical validation across components
    - you’ll have to do this yourself.
A Kwalify Schema
  in Puppet DSL
    $schema = {
      'type' => 'map',
      'mapping' => {
        'name' => {
           'type' => 'str',
           'pattern' => '/^w+s*w+$/',
        },
        'age' => {
           'type' => 'str',
           'pattern' => '/^d+$/',
        },
     }
}
Kwalify
Validation in DSL
class bind (
  ...
  ){

    $args = get_scope_args()

    $schema = {
      ...
    }

    kwalify($schema, $args)
}
Module Testing
rspec-puppet

•   Tim Sharpe (@rodjek) from Github created it
•   Rspec is often used by Puppet for testing, so it
    made sense for us to use rspec-puppet
•   The same facility can be used for testing Puppet DSL
    and Ruby code as well: providers, types, facts etc.
rspec-puppet

 •   Is able to test:
     •   Classes
     •   Defined Resources
     •   Nodes
     •   Functions
rspec-puppet

•   Paths for tests:
    •   Classes:
        •   spec/classes/<name_of_class>_spec.rb
    •   Defined Resources
        •   spec/defines/<name_of_define>_spec.rb
rspec-puppet
For class testing, the idea is to test your compiled
catalogue. The following just tests if your class
compiles with no parameters:
 # spec/classes/bind_spec.rb
 require 'spec_helper'

 describe 'bind', :type => :class do
  let(:facts) do
    {
      :operatingsystem => "CentOS"
    }
  end

  describe 'when only mandatory parameters are provided' do
   let(:params) do
     {}
   end

   it 'class should get included' do
     subject.should contain_class('bind')
   end
  end
 end
rspec-puppet
You also want to make sure your expectations of how
the catalogue should look after compilation are met:


 it ‘bind package should be defined’ do
   subject.should contain_package(‘bind’)
 end

 it ‘bind service should be defined’ do
   subject.should contain_service(‘bind’)
 end
rspec-puppet
     For testing templates, we can do something a little
     different:

it 'changing authnxdomain should modify template' do
  params = {
    :config_options = "/tmp/named.conf.options"
    :options = {
      "authnxdomain" => "yes",
    }
  }
  content = param_value("file", "/tmp/named.conf.options", "content")
  content.should =~ /authnxdomain yes/
end
rspec-puppet
      Requires a spec/spec_helper.rb file with appropriate
      settings:


require 'rspec'
require 'rspec-puppet'
require 'puppet'
require 'mocha'

fixture_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures'))

RSpec.configure do |c|
 c.module_path = File.join(fixture_path, 'modules')
 c.manifest_dir = File.join(fixture_path, 'manifests')
end
rspec-puppet
Also the following should be added to your Rakefile
to get ‘rake spec’ to work:




 require 'rubygems'
 require 'rspec/core/rake_task'

 RSpec::Core::RakeTask.new do |t|
  t.pattern = 'spec/*/*_spec.rb'
 end
Importance of
Good Coding Style
Importance of
Good Coding Style
•   Code is read much more often then it is written (did
    Guido van Rossum say this?)
•   Other people being able to read your code is
    important to attract contributors
•   Contributors make your code better and ultimately
    more successful
Style Guide


•   Available here:
    •   http://docs.puppetlabs.com/guides/style_guide.html
puppet-lint

•   Also made by Tim Sharpe from Github
•   Uses the Puppet Labs style guide
•   Saves time, as it tells you what is wrong with your
    content before a code review
Using it in your
     Rakefile
Download the gem:

 gem install puppet-lint
Then just add the following to your modules Rakefile:

 require 'puppet-lint/tasks/puppet-lint'
Running it:

# rake lint
Evaluating manifests/init.pp
Evaluating manifests/config.pp
Evaluating manifests/package.pp
Evaluating manifests/service.pp
Packaging for the
     Forge
The Modulefile
•   Provides meta data for your module
•   Includes dependencies
    •   In the future the module tool can use these
        dependencies to download extra modules as
        needed
•   Is used to generate metadata.json, which is used by
    the forge
The Modulefile
name 'puppetlabs-bind'
version '0.0.1'
source 'https://github.com/puppetlabs/puppetlabs-bind.git'
author 'Puppet Labs Inc.'
license 'ASL 2.0'
summary 'ISC Bind Module'
description 'Installs and configures the ISC BIND DNS server'
project_page 'http://forge.puppetlabs.com/puppetlabs/bind'

dependency 'puppetlabs/stdlib', '>= 2.2.1'
dependency 'puppetlabs/kwalify', '>= 0.0.1'
dependency 'ripienaar/concat', '>= 20100507'
Packaging using
      the module tool
# puppet-module build
===================================================
Building /Users/ken/Development/puppetlabs-bind for release
-----------------------------------------------------------
Done. Built: pkg/puppetlabs-bind-0.0.1.tar.gz
Uploading To the
     Forge
•   Create an account - this username will be publicly
    visible, so if you are a company create a shared one
•   Create a project - this is the short name of the
    module
•   Create a revision - this is the revision you wish to
    upload. Use semantic versioning if you can ie. 1.2.0,
    3.1.2 etc.
•   Upload your revision, this is the tar.gz file created in
    pkg/ with puppet-module build
Using a forge
        module
Using the new module face you can install the forge
module:



 # puppet module search bind
 # puppet module install puppetlabs-bind
Future Work
Needed for Modules

•   Acceptance Testing
    •   ‘Real’ build testing, perhaps using monitoring
        frameworks for acceptance?
•   Hiera and data lookup methodology
    •   Using Hiera to emulate the params pattern
Any
Questions?

Contenu connexe

Tendances

Ansible new paradigms for orchestration
Ansible new paradigms for orchestrationAnsible new paradigms for orchestration
Ansible new paradigms for orchestrationPaolo Tonin
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaYevgeniy Brikman
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!Jeff Geerling
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionJoshua Thijssen
 
Mitchell Hashimoto, HashiCorp
Mitchell Hashimoto, HashiCorpMitchell Hashimoto, HashiCorp
Mitchell Hashimoto, HashiCorpOntico
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with AnsibleMartin Etmajer
 
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsChasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsTomas Doran
 
Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Chef
 
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and AnsibleService Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and AnsibleIsaac Christoffersen
 
Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Jeff Geerling
 
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & TomorrowTXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & TomorrowMatt Ray
 
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef CookbooksCIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef CookbooksICF CIRCUIT
 
Ansible at work
Ansible at workAnsible at work
Ansible at workBas Meijer
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments Ohad Raz
 
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Local Dev on Virtual Machines - Vagrant, VirtualBox and AnsibleLocal Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Local Dev on Virtual Machines - Vagrant, VirtualBox and AnsibleJeff Geerling
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsSadayuki Furuhashi
 

Tendances (20)

How Flipkart scales PHP
How Flipkart scales PHPHow Flipkart scales PHP
How Flipkart scales PHP
 
Ansible new paradigms for orchestration
Ansible new paradigms for orchestrationAnsible new paradigms for orchestration
Ansible new paradigms for orchestration
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
 
Puppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 EditionPuppet for dummies - ZendCon 2011 Edition
Puppet for dummies - ZendCon 2011 Edition
 
Ansible and AWS
Ansible and AWSAnsible and AWS
Ansible and AWS
 
Mitchell Hashimoto, HashiCorp
Mitchell Hashimoto, HashiCorpMitchell Hashimoto, HashiCorp
Mitchell Hashimoto, HashiCorp
 
Ansible
AnsibleAnsible
Ansible
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
 
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and JenkinsChasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
 
Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5Environments - Fundamentals Webinar Series Week 5
Environments - Fundamentals Webinar Series Week 5
 
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and AnsibleService Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
 
Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2
 
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & TomorrowTXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
 
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef CookbooksCIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
 
Ansible at work
Ansible at workAnsible at work
Ansible at work
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Local Dev on Virtual Machines - Vagrant, VirtualBox and AnsibleLocal Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
 

En vedette

Barber of Birmingham - Use of Documentaries Presentation
Barber of Birmingham - Use of Documentaries PresentationBarber of Birmingham - Use of Documentaries Presentation
Barber of Birmingham - Use of Documentaries PresentationDeborah Granger
 
Swack barbershop
Swack barbershopSwack barbershop
Swack barbershopaswackhamer
 
Epc barbershop presentationzzzz
Epc barbershop presentationzzzzEpc barbershop presentationzzzz
Epc barbershop presentationzzzzAfiq Knick
 
Vy Le, CEO Rudys Barbershop
Vy Le, CEO Rudys Barbershop Vy Le, CEO Rudys Barbershop
Vy Le, CEO Rudys Barbershop Dealmaker Media
 
class 5 eng TALKATIVE BARBER
class 5 eng TALKATIVE BARBERclass 5 eng TALKATIVE BARBER
class 5 eng TALKATIVE BARBERManjula Dubey
 
Epc barbershop reportzzz
Epc barbershop reportzzzEpc barbershop reportzzz
Epc barbershop reportzzzAfiq Knick
 
Gents Barber Shop, Professional Men's Hairdresser Meadowbrook
Gents Barber Shop, Professional Men's Hairdresser MeadowbrookGents Barber Shop, Professional Men's Hairdresser Meadowbrook
Gents Barber Shop, Professional Men's Hairdresser Meadowbrookgentsbarberau
 
Marketing proposal for cuttin up barbershop
Marketing proposal for cuttin up barbershopMarketing proposal for cuttin up barbershop
Marketing proposal for cuttin up barbershopAmanda Cintron
 
Keynote 5 - Principles and Pedagogic Concepts in Teacher Education: exploring...
Keynote 5 - Principles and Pedagogic Concepts in Teacher Education: exploring...Keynote 5 - Principles and Pedagogic Concepts in Teacher Education: exploring...
Keynote 5 - Principles and Pedagogic Concepts in Teacher Education: exploring...Mike Blamires
 
How I Would Growth Hack a Barbershop
How I Would Growth Hack a BarbershopHow I Would Growth Hack a Barbershop
How I Would Growth Hack a BarbershopJulien Le Coupanec
 
Barbershop presentation
Barbershop presentationBarbershop presentation
Barbershop presentationnooneuno9312
 
Kertas kerja kedai gunting rambut
Kertas kerja  kedai gunting rambutKertas kerja  kedai gunting rambut
Kertas kerja kedai gunting rambutRosedi Ibrahim
 
Salons & barber shops
Salons & barber shopsSalons & barber shops
Salons & barber shopsACroo99
 

En vedette (17)

Barber of Birmingham - Use of Documentaries Presentation
Barber of Birmingham - Use of Documentaries PresentationBarber of Birmingham - Use of Documentaries Presentation
Barber of Birmingham - Use of Documentaries Presentation
 
Swack barbershop
Swack barbershopSwack barbershop
Swack barbershop
 
Epc barbershop presentationzzzz
Epc barbershop presentationzzzzEpc barbershop presentationzzzz
Epc barbershop presentationzzzz
 
Vy Le, CEO Rudys Barbershop
Vy Le, CEO Rudys Barbershop Vy Le, CEO Rudys Barbershop
Vy Le, CEO Rudys Barbershop
 
class 5 eng TALKATIVE BARBER
class 5 eng TALKATIVE BARBERclass 5 eng TALKATIVE BARBER
class 5 eng TALKATIVE BARBER
 
Barbershop music
Barbershop musicBarbershop music
Barbershop music
 
MANSION BARBERSHOP INTRODUCTION
MANSION BARBERSHOP INTRODUCTIONMANSION BARBERSHOP INTRODUCTION
MANSION BARBERSHOP INTRODUCTION
 
Epc barbershop reportzzz
Epc barbershop reportzzzEpc barbershop reportzzz
Epc barbershop reportzzz
 
Program Latihan 1 Malaysia; Kolej Komuniti
Program Latihan 1 Malaysia; Kolej KomunitiProgram Latihan 1 Malaysia; Kolej Komuniti
Program Latihan 1 Malaysia; Kolej Komuniti
 
Gents Barber Shop, Professional Men's Hairdresser Meadowbrook
Gents Barber Shop, Professional Men's Hairdresser MeadowbrookGents Barber Shop, Professional Men's Hairdresser Meadowbrook
Gents Barber Shop, Professional Men's Hairdresser Meadowbrook
 
Marketing proposal for cuttin up barbershop
Marketing proposal for cuttin up barbershopMarketing proposal for cuttin up barbershop
Marketing proposal for cuttin up barbershop
 
Keynote 5 - Principles and Pedagogic Concepts in Teacher Education: exploring...
Keynote 5 - Principles and Pedagogic Concepts in Teacher Education: exploring...Keynote 5 - Principles and Pedagogic Concepts in Teacher Education: exploring...
Keynote 5 - Principles and Pedagogic Concepts in Teacher Education: exploring...
 
How I Would Growth Hack a Barbershop
How I Would Growth Hack a BarbershopHow I Would Growth Hack a Barbershop
How I Would Growth Hack a Barbershop
 
Barbershop presentation
Barbershop presentationBarbershop presentation
Barbershop presentation
 
Kertas kerja kedai gunting rambut
Kertas kerja  kedai gunting rambutKertas kerja  kedai gunting rambut
Kertas kerja kedai gunting rambut
 
Salons & barber shops
Salons & barber shopsSalons & barber shops
Salons & barber shops
 
Barbershop
BarbershopBarbershop
Barbershop
 

Similaire à modern module development - Ken Barber 2012 Edinburgh Puppet Camp

Strategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringStrategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringAlessandro Franceschi
 
Automated Puppet Testing - PuppetCamp Chicago '12 - Scott Nottingham
Automated Puppet Testing - PuppetCamp Chicago '12 - Scott NottinghamAutomated Puppet Testing - PuppetCamp Chicago '12 - Scott Nottingham
Automated Puppet Testing - PuppetCamp Chicago '12 - Scott NottinghamPuppet
 
Puppet camp chicago-automated_testing2
Puppet camp chicago-automated_testing2Puppet camp chicago-automated_testing2
Puppet camp chicago-automated_testing2nottings
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practicesmanugoel2003
 
Test-Driven Puppet Development - PuppetConf 2014
Test-Driven Puppet Development - PuppetConf 2014Test-Driven Puppet Development - PuppetConf 2014
Test-Driven Puppet Development - PuppetConf 2014Puppet
 
Tools and Tips for Moodle Developers - #mootus16
 Tools and Tips for Moodle Developers - #mootus16 Tools and Tips for Moodle Developers - #mootus16
Tools and Tips for Moodle Developers - #mootus16Dan Poltawski
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Drupalcon Paris
 
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Puppet
 
The Naked Bundle - Tryout
The Naked Bundle - TryoutThe Naked Bundle - Tryout
The Naked Bundle - TryoutMatthias Noback
 
Puppet modules: An Holistic Approach
Puppet modules: An Holistic ApproachPuppet modules: An Holistic Approach
Puppet modules: An Holistic ApproachAlessandro Franceschi
 
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...Puppet
 
Decoupled Libraries for PHP
Decoupled Libraries for PHPDecoupled Libraries for PHP
Decoupled Libraries for PHPPaul Jones
 
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
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012Carlos Sanchez
 
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
 
Drupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsDrupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsLuís Carneiro
 
13th Sep, Drupal 7 advanced training by TCS
13th Sep, Drupal 7 advanced training by TCS 13th Sep, Drupal 7 advanced training by TCS
13th Sep, Drupal 7 advanced training by TCS DrupalMumbai
 
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
 

Similaire à modern module development - Ken Barber 2012 Edinburgh Puppet Camp (20)

Strategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringStrategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoring
 
Automated Puppet Testing - PuppetCamp Chicago '12 - Scott Nottingham
Automated Puppet Testing - PuppetCamp Chicago '12 - Scott NottinghamAutomated Puppet Testing - PuppetCamp Chicago '12 - Scott Nottingham
Automated Puppet Testing - PuppetCamp Chicago '12 - Scott Nottingham
 
Puppet camp chicago-automated_testing2
Puppet camp chicago-automated_testing2Puppet camp chicago-automated_testing2
Puppet camp chicago-automated_testing2
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Test-Driven Puppet Development - PuppetConf 2014
Test-Driven Puppet Development - PuppetConf 2014Test-Driven Puppet Development - PuppetConf 2014
Test-Driven Puppet Development - PuppetConf 2014
 
Tools and Tips for Moodle Developers - #mootus16
 Tools and Tips for Moodle Developers - #mootus16 Tools and Tips for Moodle Developers - #mootus16
Tools and Tips for Moodle Developers - #mootus16
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
 
The Naked Bundle - Tryout
The Naked Bundle - TryoutThe Naked Bundle - Tryout
The Naked Bundle - Tryout
 
Puppet modules: An Holistic Approach
Puppet modules: An Holistic ApproachPuppet modules: An Holistic Approach
Puppet modules: An Holistic Approach
 
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
Puppet Modules: An Holistic Approach - Alessandro Franceschi of Lab42 - Puppe...
 
Decoupled Libraries for PHP
Decoupled Libraries for PHPDecoupled Libraries for PHP
Decoupled Libraries for PHP
 
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
 
Puppet
PuppetPuppet
Puppet
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)
 
Drupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsDrupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First Steps
 
13th Sep, Drupal 7 advanced training by TCS
13th Sep, Drupal 7 advanced training by TCS 13th Sep, Drupal 7 advanced training by TCS
13th Sep, Drupal 7 advanced training by TCS
 
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
 
Gradle
GradleGradle
Gradle
 

Plus de Puppet

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet
 
Puppetcamp r10kyaml
Puppetcamp r10kyamlPuppetcamp r10kyaml
Puppetcamp r10kyamlPuppet
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)Puppet
 
Puppet camp vscode
Puppet camp vscodePuppet camp vscode
Puppet camp vscodePuppet
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twentiesPuppet
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codePuppet
 
KGI compliance as-code approach
KGI compliance as-code approachKGI compliance as-code approach
KGI compliance as-code approachPuppet
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationPuppet
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliancePuppet
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowPuppet
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Puppet
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppetPuppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkPuppet
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping groundPuppet
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy SoftwarePuppet
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User GroupPuppet
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsPuppet
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyPuppet
 

Plus de Puppet (20)

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepo
 
Puppetcamp r10kyaml
Puppetcamp r10kyamlPuppetcamp r10kyaml
Puppetcamp r10kyaml
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)
 
Puppet camp vscode
Puppet camp vscodePuppet camp vscode
Puppet camp vscode
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twenties
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance code
 
KGI compliance as-code approach
KGI compliance as-code approachKGI compliance as-code approach
KGI compliance as-code approach
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automation
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliance
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNow
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden Windows
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael Pinson
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin Reeuwijk
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping ground
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User Group
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOps
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
 

Dernier

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
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
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Dernier (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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...
 
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...
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

modern module development - Ken Barber 2012 Edinburgh Puppet Camp

  • 1. Modern Module Development 2012-03-23 Puppet Camp Edinburgh Ken Barber Professional Services Engineer ken@puppetlabs.com http://linkedin.com/in/ken_barber IRC & Twitter: @ken_barber
  • 2. What is a module? • A re-usable way of sharing common components: • Classes • Defined Resources • Ruby Resources • Files • Templates • Functions • Facts
  • 3. We need more modules!
  • 4. and they need to be good quality ...
  • 5. Whats new(ish) in Module Development? • Puppet Module Face • rspec-puppet • puppet-lint • Kwalify
  • 7. Why are patterns important?
  • 8. Class Patterns • Most installation and management problems consist of: • Installing software using files or packages • Modifying configuration files • Starting services
  • 9. We commonly refer to this pattern as: Package, Config, Service
  • 10. Package Class class bind::package { package { $bind::packages: ensure => installed, } }
  • 11. Config Class class bind::config { file { $bind::config_file: content => template(“${module_name}/named.conf”), owner => $bind::user, group => $bind::group, mode => ‘0644’, } }
  • 12. Service Class class bind::service { service { $bind::services: ensure => running, enable => true, hasstatus => true, hasrestart => true, } }
  • 13. Main Class class bind { anchor { ‘bind::start’: }-> class { ‘bind::package’: }~> class { ‘bind::config’: }~> class { ‘bind::service’: }~> anchor { ‘bind::end’: } }
  • 14. What are anchors? • Provided in stdlib • Anchors are resource that ‘do nothing’ • They ensure the edge of the classes are demarcated properly so the graph executes in the expected order
  • 16. Defined Resources define bind::zone ( $value = ‘nil’ ){ file { “/etc/bind/config.d/${name}.conf”: content => “${name} = ${value}n”, require => Class[‘bind::package’], notify => Class[‘bind::service’], } }
  • 17. Package, Config, Service Pattern • This pattern is good for ~80% of situations. • Deals with ordering in a non-complex way, working with defined resources as well.
  • 19. Default Parameters • Most parameters have OS dependant defaults. • In the past this was done with case statements in the main modules.
  • 20. Class Parameters • I generally use two types of class parameters: • User-tuneable parameters • Advanced parameters for overriding items such as package name, service name configuration file paths
  • 21. Params Pattern The trick is to move your OS based param lookup into manifests/params.pp: class bind::params { case $::operatingsystem { 'ubuntu', 'debian': { $package = 'bind9' $service = 'bind9' $config_dir = '/etc/bind' } ‘centos’, ‘redhat’: { $package = ‘bind’ $service = ‘bind’ $config_dir = ‘/etc/named’ } default: { fail(“Unknown OS: $::operatingsystem”) } } }
  • 22. Params Pattern Then inherit this in your base class like so: class bind ( $package = $bind::params::package, $service = $bind::params::service, $config_dir = $bind::params::config_dir ) inherits bind::params { ... }
  • 23. Params Pattern Then elsewhere in your code, reference the fully qualified parameter from your bind class: class bind::package { package { $bind::packages: ensure => installed, } }
  • 24. Puppet Module Tool will now be a Puppet Face!
  • 25. Puppet Module Tool # puppet help module USAGE: puppet module <action> This subcommand can find, install, and manage modules from the Puppet Forge, a repository of user-contributed Puppet code. It can also generate empty modules, and prepare locally developed modules for release on the Forge. OPTIONS: --mode MODE - The run mode to use (user, agent, or master). --render-as FORMAT - The rendering format to use. --verbose - Whether to log verbosely. --debug - Whether to log debug information. ACTIONS: build Build a module release package. changes Show modified files of an installed module. clean Clean the module download cache. generate Generate boilerplate for a new module. install Install a module from a repository or release archive. list List installed modules search Search a repository for a module. uninstall Uninstall a puppet module. upgrade Upgrade a puppet module. See 'puppet man module' or 'man puppet-module' for full help.
  • 26. Puppet Module Face • Obviously still subject to design changes before release ....
  • 28. Validating Parameters • Your allowed set of class parameters are like an Interface Contract to your users • A lot of bugs in code are to do with bad input • We have three mechanisms for validating input: • parameter definitions in the class • stdlib validate_* functions • kwalify
  • 29. Kwalify Validation • Uses the kwalify library - which is a language independent way of validating JSON/YAML style data structures. • Kwalify has binding in many languages - so its a nice universal choice for structured data validation.
  • 30. Kwalify • Provides a single declarative way of defining what parameters are valid. • When validation fails, it shows all cases of failure. • Doesn’t handle logical validation across components - you’ll have to do this yourself.
  • 31. A Kwalify Schema in Puppet DSL $schema = { 'type' => 'map', 'mapping' => { 'name' => { 'type' => 'str', 'pattern' => '/^w+s*w+$/', }, 'age' => { 'type' => 'str', 'pattern' => '/^d+$/', }, } }
  • 32. Kwalify Validation in DSL class bind ( ... ){ $args = get_scope_args() $schema = { ... } kwalify($schema, $args) }
  • 34. rspec-puppet • Tim Sharpe (@rodjek) from Github created it • Rspec is often used by Puppet for testing, so it made sense for us to use rspec-puppet • The same facility can be used for testing Puppet DSL and Ruby code as well: providers, types, facts etc.
  • 35. rspec-puppet • Is able to test: • Classes • Defined Resources • Nodes • Functions
  • 36. rspec-puppet • Paths for tests: • Classes: • spec/classes/<name_of_class>_spec.rb • Defined Resources • spec/defines/<name_of_define>_spec.rb
  • 37. rspec-puppet For class testing, the idea is to test your compiled catalogue. The following just tests if your class compiles with no parameters: # spec/classes/bind_spec.rb require 'spec_helper' describe 'bind', :type => :class do let(:facts) do { :operatingsystem => "CentOS" } end describe 'when only mandatory parameters are provided' do let(:params) do {} end it 'class should get included' do subject.should contain_class('bind') end end end
  • 38. rspec-puppet You also want to make sure your expectations of how the catalogue should look after compilation are met: it ‘bind package should be defined’ do subject.should contain_package(‘bind’) end it ‘bind service should be defined’ do subject.should contain_service(‘bind’) end
  • 39. rspec-puppet For testing templates, we can do something a little different: it 'changing authnxdomain should modify template' do params = { :config_options = "/tmp/named.conf.options" :options = { "authnxdomain" => "yes", } } content = param_value("file", "/tmp/named.conf.options", "content") content.should =~ /authnxdomain yes/ end
  • 40. rspec-puppet Requires a spec/spec_helper.rb file with appropriate settings: require 'rspec' require 'rspec-puppet' require 'puppet' require 'mocha' fixture_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures')) RSpec.configure do |c| c.module_path = File.join(fixture_path, 'modules') c.manifest_dir = File.join(fixture_path, 'manifests') end
  • 41. rspec-puppet Also the following should be added to your Rakefile to get ‘rake spec’ to work: require 'rubygems' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new do |t| t.pattern = 'spec/*/*_spec.rb' end
  • 43. Importance of Good Coding Style • Code is read much more often then it is written (did Guido van Rossum say this?) • Other people being able to read your code is important to attract contributors • Contributors make your code better and ultimately more successful
  • 44. Style Guide • Available here: • http://docs.puppetlabs.com/guides/style_guide.html
  • 45. puppet-lint • Also made by Tim Sharpe from Github • Uses the Puppet Labs style guide • Saves time, as it tells you what is wrong with your content before a code review
  • 46. Using it in your Rakefile Download the gem: gem install puppet-lint Then just add the following to your modules Rakefile: require 'puppet-lint/tasks/puppet-lint'
  • 47. Running it: # rake lint Evaluating manifests/init.pp Evaluating manifests/config.pp Evaluating manifests/package.pp Evaluating manifests/service.pp
  • 49. The Modulefile • Provides meta data for your module • Includes dependencies • In the future the module tool can use these dependencies to download extra modules as needed • Is used to generate metadata.json, which is used by the forge
  • 50. The Modulefile name 'puppetlabs-bind' version '0.0.1' source 'https://github.com/puppetlabs/puppetlabs-bind.git' author 'Puppet Labs Inc.' license 'ASL 2.0' summary 'ISC Bind Module' description 'Installs and configures the ISC BIND DNS server' project_page 'http://forge.puppetlabs.com/puppetlabs/bind' dependency 'puppetlabs/stdlib', '>= 2.2.1' dependency 'puppetlabs/kwalify', '>= 0.0.1' dependency 'ripienaar/concat', '>= 20100507'
  • 51. Packaging using the module tool # puppet-module build =================================================== Building /Users/ken/Development/puppetlabs-bind for release ----------------------------------------------------------- Done. Built: pkg/puppetlabs-bind-0.0.1.tar.gz
  • 52. Uploading To the Forge • Create an account - this username will be publicly visible, so if you are a company create a shared one • Create a project - this is the short name of the module • Create a revision - this is the revision you wish to upload. Use semantic versioning if you can ie. 1.2.0, 3.1.2 etc. • Upload your revision, this is the tar.gz file created in pkg/ with puppet-module build
  • 53. Using a forge module Using the new module face you can install the forge module: # puppet module search bind # puppet module install puppetlabs-bind
  • 54. Future Work Needed for Modules • Acceptance Testing • ‘Real’ build testing, perhaps using monitoring frameworks for acceptance? • Hiera and data lookup methodology • Using Hiera to emulate the params pattern

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. Which is what this talk will hopefully help you all achieve.\n
  5. New(ish) because most of these ideas have been kicking around for a while, but only used in anger recently. Kwalify is new, only published to the forge on Wednesday.\n
  6. I&amp;#x2019;ll show you some patterns, and jump back and forth between code and this slidepack. In my examples, I&amp;#x2019;ll but using my in-development &amp;#x2018;bind&amp;#x2019; module as the basis of some of my examples where applicable.\n
  7. Providing a consistent mechanism for writing a module means we get the boring stuff out of the way earlier. Less fapping about with style &amp; layout of code. It also means we can learn from others mistakes - and wins.\n
  8. If you&amp;#x2019;ve ever been to any of out training courses - we talk about this quite a bit.\n
  9. Or Package, File, Service - but file is a bit ambigous - since a package is a file right?\nThis pattern breaks these three major items into consecutive chunks, in Puppet terms - sub classes.\n
  10. Contains all &amp;#x2018;package&amp;#x2019; related data.\n
  11. Contains all &amp;#x2018;configuration&amp;#x2019; related resources.\n
  12. Contains all &amp;#x2018;service&amp;#x2019; related resources. Possibly even Cron or Scheduled jobs ...\nNext slide: main class\n
  13. This class &amp;#x2018;brings it all together&amp;#x2019; using anchors. This provides course grained relationships between the Package, Config &amp; Service classes. You can see our usage of chained resources, this is mainly so it looks sexy.\n
  14. Anchors may look strange, but you need them to surround classes to ensure ordering is done correctly. This is due to ambiguous boundaries for classes in the graph. This is more or less a work-around for a &amp;#x2018;bug&amp;#x2019; or design flaw, and is more obvious when you have multiple layers of classes.\n
  15. Defined resources fit well with this pattern because you can now just build up relationships with the classes. ie. you require the package class, and notify the service class.\n
  16. This is a contrived example, and not really how you would manage a zone - but I just want to show how a resource inside a defined resource can establish relationships with the course grained package,config,service classes. Also - the beauty of this - is that you can notify and require these classes _outside_ of the module.\n
  17. I generally drop this pattern in as a template for customers so they can just copy it and modify to taste.\nNext section: Params Pattern\n
  18. \n
  19. \n
  20. \n
  21. The default will stop the code from working on non-supported operating systems. This may not always be desirable, but sometime its hard to find reasonable defaults in this case.\n
  22. Yes - it looks wordy. Now you can use these variables directly in your class - $package, $service, $config_dir.\n
  23. By doing it this way, you allow users who define class parameters to override the params defaults.\nAlso - check out RI Pienaars patterns around using Hiera and his take on the params pattern using the Hiera Puppet backend.\nNext Topic: Puppet Module as a Face?\n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. At this point I&amp;#x2019;ll just drop to the console and show it in action.\n
  32. \n
  33. \n
  34. \n
  35. \n
  36. These are conventions for layouts, but its recommended sticking to these conventions for the examples to work.\n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n