SlideShare a Scribd company logo
Getting started with Puppet


                      Jeremy MATHEVET
                            12/09/2012
Topics



    Configuration management

    Puppet Installation

    Puppetmaster

    Puppet language basics

    Puppet language advanced
Configuration management

    Puppet, Chef, Cfengine
Configuration management

                           Definition



           Configuration Management is the
           process of standardizing resource
           configurations and enforcing their state
           across IT infrastructure in an automated
           yet agile manner.


                               —        Puppet Labs
Configuration management

                                 Why do we need it

         
             Heterogeneous Operating Systems
         
             Servers profusion
         
             Increasing deployment needs
              
                  Cloud
Configuration management

                                  Different solutions


          3 ways for deploying software to the SI

          Manually
                
                    Could take very long time
          By scripts
                
                    Could be quite tricky
                       
                           Multi-environment case
          By configuration management software
Configuration management

                      Configuration management software

          Pros :
                
                    Centralized management
                
                    Automated management
                
                    Mass deployment
                
                    Configuration customization
                
                    Abstraction layer
                
                    Idempotence
                
                    “DevOps ready”
Configuration management

                                      Principle


         
             A client/server
                architecture.
         
             The server has a reference
               configuration.
         
             The client queries the
               server.
         
             The client makes change in
               order to match the
               reference configuration.
Configuration management

                                  Principle




           1. Pull Request
           2. Reference configuration
           3. Operations
           4. (optionnal) Message code / error
Configuration management

                                    Principle

        Version control and security

         
             Revision control used to keep a trace of config
               revisions
                  
                      Not mandatory but hugely recommended
         
             Encrypted connection
Configuration management

                                   Principle

             What you can do

         
              File transfer
         
              File edition
         
              Service management
         
              Package management
         
              Mount points management
         
              Cron management
         
              VLAN management
         
              Command launching
         
              …
Configuration management

                                    Comparison


         3 major solutions :
         
             Puppet
                  
                      The most popular
                  
                      Easiest solution
         
             Chef
                  
                      Puppet fork
                  
                      Still young but very promising
         
             CFEngine
                  
                      The first CM software
                  
                      The most resource effective
                  
                      More complex
Configuration management

                           Comparison

          Timeline :
Configuration management

                                     Comparison

          Some differences




                 Technology         Ruby               Ruby                  C
                Configuration     Dedicated            Ruby             Dedicated
                                  langage                               langage
                Configuration                      Plain text files
                  method        Plain text files      CLI tool        Plain text files
                                                      Web UI
                   Licence         Apache             Apache               GPL
Configuration management

                                    Comparison

             Some similarities

         
              Same origin
         
              Specially designed for config
                management
         
              Client/server model
                  
                      Standalone mode possible
         
              CLI interface
         
              Need to increase your
                competence
Configuration management




           Do you have any questions ?
Puppet Installation

   Install && setup
Puppet Installation

                                             Puppet

              Some details and features

          
               Created in 2006 by Puppet Labs
          
               Latest version : 3.0.0
          
               The easiest solution
          
               Dedicated declarative language
                      
                          Inspired by Ruby
          
               Modular configuration
          
               System profiling with Facter
          
               Template support
          
               Asymmetric Key Encryption
Puppet Installation

                                           Puppet


              Prerequisite and sources

          
               Prerequisite
                      
                          Configured DNS
                      
                          Ruby

          
               Installation sources :
                      
                          Distribution repositories
                      
                          RubyGem
                      
                          Sources
Puppet Installation

                                          Puppet

            Client and server

           Puppet server : Puppetmaster
           Puppet client : Puppet (agent)


           Main steps once installed :
                  
                      Puppet agent installation on client hosts (also called a node).
                         
                             Enter the server FQDN into /etc/puppet/puppet.conf
                         
                             The agent checks every 30 mn by default
                  
                      Certificate generation
                         
                             CSR for the node generated on the puppetmaster during
                               the first agent request
Puppet Installation

                            Working with Puppetmaster

           Working with Puppet CA
            [root@puppetmaster ~]# puppetca --sign fqdn.utopia.net


                  Options                                      Definitions

            --sign            Sign the certificate request for the following host


            --list            List certificate request


            --all             Used with --sign, sign all certificate request


            --clean           Remove all files related to the host from the CA


            --print           Print the full text version of a host’s certificate


            --revoke          Remove all files related to the host from the CA
Puppet Installation




            Do you have any questions ?
Puppet




         Puppetmaster

         Puppetmaster said…
Puppetmaster

               One important thing




               Infrastructure is code.
Puppetmaster

                              Definition




               Manifest – Puppet programs are called
               « manifests » . They use the .pp file
               extension. These programs contain one or
               more class.
Puppetmaster

                             Puppet configuration tree

             Configuration files overview 1/2

         
               puppet.conf
                   
                       General Puppetmaster settings
         
               auth.conf
                   
                       General ACL
         
               fileserver.conf
                   
                       ACL for the Puppet fileserver
         
               manifests directory
                   
                       site.pp : global defaults
                          configuration
                   
                       nodes.pp : manage hosts
Puppetmaster

                               Puppet configuration tree

             Configuration files overview 2/2

         
               modules directory
                   
                       Contain one subdirectory per
                         module
                   
                       manifests/init.pp
                           
                                The module code
                   
                       The best way to use Puppet
         
               templates directory
                   
                       The default directory which contains
                         templates.
Puppetmaster

                          Puppet configuration files

           puppet.conf


                         [main]
                         logdir=/var/log/puppet
                         vardir=/var/lib/puppet
                         ssldir=/var/lib/puppet/ssl
                         rundir=/var/run/puppet
                         factpath=$vardir/lib/facter
                         templatedir=$confdir/templates
                         server=debiantest.decilex.net
                         downcasefacts = true
Puppetmaster

                            Puppet configuration files

             manifests/nodes.pp


         
               Skeleton :
                                           node basenode {
               
                   node ‘fqdn’ { include   include ssh
                     module}               include ntp
                                           }

         
               Node declaration
                                           node 'test.utopia.net' inherits basenode {
         
               Module inclusion            include nagios
               
                   Inheritance             }
Puppetmaster

                       Puppet configuration files

           Reading order


                                manifests/site.pp




                               manifests/nodes.pp




                     modules/$nomdumodule/manifests/init.pp




                           modules/$nomdumodule/files/
Puppetmaster




           Do you have any questions ?
Puppet




         Puppet language basics

            Puppet, Chef, Cfengine
Puppet language basics

                               The declarative language


              About the language

          
               With Puppet, we declare how the node
                 must be.
          
               Everything you want to manage have to
                 be explicitly declared.
          
               A Puppet program is called a manifest
                    
                         Central manifest : site.pp
                    
                         Puppet load modules manifests
          
               Into manifests, we define classes.
                
                    We write resources inside these
                      classes
Puppet language basics

                               The declarative language

              Resources

          
               The fundamental unit of modeling
          
               Like a “function”
                    
                         Inside, a series of attributes and their values
          
               Resources types and attributes are predefined by Puppet
          
               List of available resources
                    
                         http://docs.puppetlabs.com/references/stable/type.html
          
               Skeleton
                
                    Ressource-name { ‘title’ : attribute = value }
Puppet language basics

                                       Resources


              File

          
               Manage files
                                            file { '/etc/passwd':
                     
                         Content                 owner => 'root',
                                                 group => 'root',
                     
                         Permissions             mode => '0644',
                     
                         Ownership               source => ‘puppet:///base/passwd‘
                     
                                               }

          
               Source attribute
                     
                         Copy a file from the Puppetmaster to the node
                     
                         puppet:/// followed by the relative source of the file
                           placed in /etc/puppet/modules/module-name/files/
Puppet language basics

                                        Resources

              Package                                package { ‘openssh-server’:
                                                        ensure => installed
                                                     }
          
               Manage packages
                   
                         Wide provider support       package { ‘openssh-server’:
                                                        ensure => latest
                             
                                 APT                 }
                             
                                 Aptitude            package { ‘openssh-server’:
                             
                                 YUM                    ensure => absent
                                                     }
                             
                                 And more..
                   
                         Install, upgrade, uninstall packages
                   
                         The last or defined package version
Puppet language basics

                                           Resources

              Service

          
               Manage services
                   
                         Wide provider support      service { ‘snmpd’:
                             
                                 Init                   ensure => running,
                                                        enable => true,
                             
                                 Systemd                hasrestart => true,
                             
                                 Upstart                hasstatus => true
                                                    }
                             
                                 And more…
                   
                         Start, stop, restart, start on boot (enable) services
Puppet language basics




           Do you have any questions ?
Puppet




         Puppet language advanced

               Dive into Puppet
Puppet language advanced

                                         Facter

             The system profiler

         
              Software used by Puppet             ~ # facter
                                                  architecture => i386
         
              Installed on nodes                  domain => utopia.net
                                                  facterversion => 1.5.7
         
              Collect various data, "facts",
                                                  fqdn => debiantest.utopia.net
                on node                           hardwaremodel => i686
         
              Many facts already defined by       hostname => debiantest
                Facter                            id => root
                                                  […]
               
                   Possibility to create your
                     own facts
Puppet language advanced

                                      Variables

             Variables into classes
         
              Begin by $
                                         case $operatingsystem {
         
              Can use facts or you           centos, redhat: { $service_name = 'ntpd' }
                own defined                  debian, ubuntu: { $service_name = 'ntp' }
                variables                  }
         
              Often used with            service { 'ntp':
                 conditional                name => $service_name,
                 statements                 ensure => running,
                                            enable => true
                   
                       Case statement    }
                   
                       If statement
Puppet language advanced

                              Conditional statements

             If/Elsif/Else Statement      if $variable {
                                               file { '/some/file': ensure => present }
                                             } else {
         
              Based on                         file { '/some/other/file': ensure => present }
                                             }
                   
                       the truth value
                          of a variable
                   
                       the value of an
                          expression      if $server == 'mongrel' {
                                               include mongrel
                   
                       The truth of an       } elsif $server == 'nginx' {
                         arithmetic            include nginx
                         expression          } else {
                                               include thin
                                             }


                                          if $ram > 1024 {
                                               $maxclient = 500
                                             }
Puppet language advanced

                                        Expressions

             Operators
         
              Operators usable in if statements
                   
                       Boolean expressions
                            
                                And, or, not
                   
                       Comparison expressions
                            
                                == =! < > <= > >=
                   
                       Arithmetic expressions
                            
                                + - / * >> (left shift) << (right shift)
                   
                       Regular expressions
                            
                                =~ !~
                   
                       “in” expressions
                       
                           allows to find if the left operand is in the right one.
Puppet language advanced

                                      Templates

             Personalized text files

                                             file {"hosts":
         
              Permit to have                    path => "/etc/hosts",
                personalized                    owner => root,
                configuration per node          group => root,
                                                mode => 644,
                   
                       Use ERB language         content => template("base/hosts.erb")
                   
                       Retrieve and use      }
                         facts
                                             <%= ipadress %> <%fqdn> <%hostname>
                   
                       Use file resource
                           
                               ERB file
                                 placed in
                                 module
                                 template
                                 directory
Puppet language advanced

                                Resources relationship

             Relationship meta-parameters
         
              before
                   
                        Resource is applied before the target resource
         
              require
                   
                        Resource is applied after the target resource
         
              notify
                   
                        Like before + The target resource will refresh if the
                           notifying resource changes
         
              subscribe
                   
                        Like require + The subscribing resource will refresh if the
                           target resource changes.
Puppet language advanced

                                Resources relationship

           Ordering relationship

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


           file { '/etc/ssh/sshd_config':
                ensure => file,
                mode => 600,
                source => 'puppet:///modules/sshd/sshd_config',
                require => Package['openssh-server'],
              }




          These two examples are mutually-exclusive
Puppet language advanced

                               Resources relationship

           Notification relationship

           file { '/etc/ssh/sshd_config':
                ensure => file,
                mode => 600,
                source => 'puppet:///modules/sshd/sshd_config',
                notify => Service['sshd']
              }


           service { 'sshd':
               ensure => running,
               enable => true,
               subscribe => File['/etc/ssh/sshd_config‘]
             }


            These two examples are mutually-exclusive
Puppet language advanced

                                   Resources relationship

             Chaining and refreshing

         
               Ordering resources
                     
                         The resource on the left is applied
                           before the resource on the right.
                     
                         ->
         
               Refreshing
                     
                         Kind of trigger
                     
                         Restart a service after a file update
                     
                         ~>

             # ntp.conf is applied first, and will notify the ntpd service if it changes:
             File['/etc/ntp.conf'] ~> Service['ntpd']
Puppet language advanced




           Do you have any questions ?
Puppet


                                Summary


         Configuration
         Configuration                             Puppetmaster
                                                   Puppetmaster
         management
          management       Puppet installation
                           Puppet installation




                                            Puppet Language
                                            Puppet Language
              Puppet language
              Puppet language                  advanced
                                               advanced
                  basics
                  basics
Contact

            Jeremy MATHEVET
                 @Jeyg




Content under Creative Commons BY 3.0 License

More Related Content

What's hot

DEVOPS
DEVOPSDEVOPS
DEVOPS
TayssirLimem
 
Apache Hive 紹介
Apache Hive 紹介Apache Hive 紹介
AnsibleによるInfrastructure as code入門
AnsibleによるInfrastructure as code入門AnsibleによるInfrastructure as code入門
AnsibleによるInfrastructure as code入門
kk_Ataka
 
Uml : Diagrammes de Cas dutilisation -- Modele preliminaire -- 23
Uml : Diagrammes de Cas dutilisation -- Modele preliminaire -- 23Uml : Diagrammes de Cas dutilisation -- Modele preliminaire -- 23
Uml : Diagrammes de Cas dutilisation -- Modele preliminaire -- 23
megaplanet20
 
kubernetes, pourquoi et comment
kubernetes, pourquoi et commentkubernetes, pourquoi et comment
kubernetes, pourquoi et comment
Jean-Baptiste Claramonte
 
주니어의 쿠버네티스 생태계에서 살아남기
주니어의 쿠버네티스 생태계에서 살아남기주니어의 쿠버네티스 생태계에서 살아남기
주니어의 쿠버네티스 생태계에서 살아남기
InfraEngineer
 
Sécurité dans le cloud
Sécurité dans le cloudSécurité dans le cloud
Sécurité dans le cloud
Hassan EL ALLOUSSI
 
Cahier des charges
Cahier des charges Cahier des charges
Cahier des charges
Anwar Youssef
 
Gestion des LOGS savec syslog+loganalyzer
Gestion des LOGS savec syslog+loganalyzerGestion des LOGS savec syslog+loganalyzer
Gestion des LOGS savec syslog+loganalyzer
Mohamet Lamine DIOP
 
Cours Devops Sparks.pptx.pdf
Cours Devops Sparks.pptx.pdfCours Devops Sparks.pptx.pdf
Cours Devops Sparks.pptx.pdf
boulonvert
 
Javaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組みJavaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組み
Chihiro Ito
 
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
Masahito Zembutsu
 
Spring Cloud Data Flow の紹介 #streamctjp
Spring Cloud Data Flow の紹介  #streamctjpSpring Cloud Data Flow の紹介  #streamctjp
Spring Cloud Data Flow の紹介 #streamctjp
Yahoo!デベロッパーネットワーク
 
CSI Driverを開発し自社プライベートクラウドにより適した安全なKubernetes Secrets管理を実現した話
CSI Driverを開発し自社プライベートクラウドにより適した安全なKubernetes Secrets管理を実現した話CSI Driverを開発し自社プライベートクラウドにより適した安全なKubernetes Secrets管理を実現した話
CSI Driverを開発し自社プライベートクラウドにより適した安全なKubernetes Secrets管理を実現した話
Katsuya Yamaguchi
 
Mise en place d'active directory sous windows serveur 22
Mise en place d'active directory sous windows serveur 22Mise en place d'active directory sous windows serveur 22
Mise en place d'active directory sous windows serveur 22
ImnaTech
 
Ceph アーキテクチャ概説
Ceph アーキテクチャ概説Ceph アーキテクチャ概説
Ceph アーキテクチャ概説
Emma Haruka Iwao
 
Mise en place de Nagios core sur Ubuntu 22.04
Mise en place de Nagios core  sur Ubuntu 22.04Mise en place de Nagios core  sur Ubuntu 22.04
Mise en place de Nagios core sur Ubuntu 22.04
ImnaTech
 
Fluentdのお勧めシステム構成パターン
Fluentdのお勧めシステム構成パターンFluentdのお勧めシステム構成パターン
Fluentdのお勧めシステム構成パターン
Kentaro Yoshida
 
Réussir sa migration vers le Cloud grâce à la virtualisation des données
Réussir sa migration vers le Cloud grâce à la virtualisation des donnéesRéussir sa migration vers le Cloud grâce à la virtualisation des données
Réussir sa migration vers le Cloud grâce à la virtualisation des données
Denodo
 
Podman Overview and internals.pdf
Podman Overview and internals.pdfPodman Overview and internals.pdf
Podman Overview and internals.pdf
Saim Safder
 

What's hot (20)

DEVOPS
DEVOPSDEVOPS
DEVOPS
 
Apache Hive 紹介
Apache Hive 紹介Apache Hive 紹介
Apache Hive 紹介
 
AnsibleによるInfrastructure as code入門
AnsibleによるInfrastructure as code入門AnsibleによるInfrastructure as code入門
AnsibleによるInfrastructure as code入門
 
Uml : Diagrammes de Cas dutilisation -- Modele preliminaire -- 23
Uml : Diagrammes de Cas dutilisation -- Modele preliminaire -- 23Uml : Diagrammes de Cas dutilisation -- Modele preliminaire -- 23
Uml : Diagrammes de Cas dutilisation -- Modele preliminaire -- 23
 
kubernetes, pourquoi et comment
kubernetes, pourquoi et commentkubernetes, pourquoi et comment
kubernetes, pourquoi et comment
 
주니어의 쿠버네티스 생태계에서 살아남기
주니어의 쿠버네티스 생태계에서 살아남기주니어의 쿠버네티스 생태계에서 살아남기
주니어의 쿠버네티스 생태계에서 살아남기
 
Sécurité dans le cloud
Sécurité dans le cloudSécurité dans le cloud
Sécurité dans le cloud
 
Cahier des charges
Cahier des charges Cahier des charges
Cahier des charges
 
Gestion des LOGS savec syslog+loganalyzer
Gestion des LOGS savec syslog+loganalyzerGestion des LOGS savec syslog+loganalyzer
Gestion des LOGS savec syslog+loganalyzer
 
Cours Devops Sparks.pptx.pdf
Cours Devops Sparks.pptx.pdfCours Devops Sparks.pptx.pdf
Cours Devops Sparks.pptx.pdf
 
Javaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組みJavaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組み
 
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
Docker入門-基礎編 いまから始めるDocker管理【2nd Edition】
 
Spring Cloud Data Flow の紹介 #streamctjp
Spring Cloud Data Flow の紹介  #streamctjpSpring Cloud Data Flow の紹介  #streamctjp
Spring Cloud Data Flow の紹介 #streamctjp
 
CSI Driverを開発し自社プライベートクラウドにより適した安全なKubernetes Secrets管理を実現した話
CSI Driverを開発し自社プライベートクラウドにより適した安全なKubernetes Secrets管理を実現した話CSI Driverを開発し自社プライベートクラウドにより適した安全なKubernetes Secrets管理を実現した話
CSI Driverを開発し自社プライベートクラウドにより適した安全なKubernetes Secrets管理を実現した話
 
Mise en place d'active directory sous windows serveur 22
Mise en place d'active directory sous windows serveur 22Mise en place d'active directory sous windows serveur 22
Mise en place d'active directory sous windows serveur 22
 
Ceph アーキテクチャ概説
Ceph アーキテクチャ概説Ceph アーキテクチャ概説
Ceph アーキテクチャ概説
 
Mise en place de Nagios core sur Ubuntu 22.04
Mise en place de Nagios core  sur Ubuntu 22.04Mise en place de Nagios core  sur Ubuntu 22.04
Mise en place de Nagios core sur Ubuntu 22.04
 
Fluentdのお勧めシステム構成パターン
Fluentdのお勧めシステム構成パターンFluentdのお勧めシステム構成パターン
Fluentdのお勧めシステム構成パターン
 
Réussir sa migration vers le Cloud grâce à la virtualisation des données
Réussir sa migration vers le Cloud grâce à la virtualisation des donnéesRéussir sa migration vers le Cloud grâce à la virtualisation des données
Réussir sa migration vers le Cloud grâce à la virtualisation des données
 
Podman Overview and internals.pdf
Podman Overview and internals.pdfPodman Overview and internals.pdf
Podman Overview and internals.pdf
 

Similar to Getting started with Puppet

Rudder - Configuration management benefits for everyone (FOSDEM 2012)
Rudder - Configuration management benefits for everyone (FOSDEM 2012)Rudder - Configuration management benefits for everyone (FOSDEM 2012)
Rudder - Configuration management benefits for everyone (FOSDEM 2012)
RUDDER
 
Configuration management benefits for everyone - Rudder @ FLOSSUK Spring Conf...
Configuration management benefits for everyone - Rudder @ FLOSSUK Spring Conf...Configuration management benefits for everyone - Rudder @ FLOSSUK Spring Conf...
Configuration management benefits for everyone - Rudder @ FLOSSUK Spring Conf...
RUDDER
 
Configuration management: automating and rationalizing server setup with CFEn...
Configuration management: automating and rationalizing server setup with CFEn...Configuration management: automating and rationalizing server setup with CFEn...
Configuration management: automating and rationalizing server setup with CFEn...
Jonathan Clarke
 
Configuration management: automating and rationalizing server setup with CFEn...
Configuration management: automating and rationalizing server setup with CFEn...Configuration management: automating and rationalizing server setup with CFEn...
Configuration management: automating and rationalizing server setup with CFEn...
RUDDER
 
IBM PureFlex System Live Demo Outline: A scenario
IBM PureFlex System Live Demo Outline: A scenarioIBM PureFlex System Live Demo Outline: A scenario
IBM PureFlex System Live Demo Outline: A scenario
IBM India Smarter Computing
 
XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...
XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...
XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...
XebiaLabs
 
Nagios Conference 2012 - Andreas Ericsson - Merlin
Nagios Conference 2012 - Andreas Ericsson - MerlinNagios Conference 2012 - Andreas Ericsson - Merlin
Nagios Conference 2012 - Andreas Ericsson - Merlin
Nagios
 
SOA Summer School: Best of SOA Summer School – Encore Session
SOA Summer School: Best of SOA Summer School – Encore Session SOA Summer School: Best of SOA Summer School – Encore Session
SOA Summer School: Best of SOA Summer School – Encore Session
WSO2
 
Ss Wrap Up Session 13 Aug
Ss Wrap Up Session 13 AugSs Wrap Up Session 13 Aug
Ss Wrap Up Session 13 AugWSO2
 
Continuous Delivery in the AWS Cloud
Continuous Delivery in the AWS CloudContinuous Delivery in the AWS Cloud
Continuous Delivery in the AWS Cloud
Nigel Fernandes
 
Continuous Delivery in the Cloud
Continuous Delivery in the CloudContinuous Delivery in the Cloud
Continuous Delivery in the CloudFabio Lessa
 
Open Source Licenses and Tools
Open Source Licenses and ToolsOpen Source Licenses and Tools
Open Source Licenses and Tools
g2ix
 
LAST Conference - Dev-Ops and Continuous Delivery
LAST Conference - Dev-Ops and Continuous DeliveryLAST Conference - Dev-Ops and Continuous Delivery
LAST Conference - Dev-Ops and Continuous Delivery
Nigel Fernandes
 
Configuration management 101 - A tale of disaster recovery using CFEngine 3
Configuration management 101 - A tale of disaster recovery using CFEngine 3Configuration management 101 - A tale of disaster recovery using CFEngine 3
Configuration management 101 - A tale of disaster recovery using CFEngine 3RUDDER
 
OOW 09 EBS Application Change Management Pack
OOW 09 EBS Application Change Management PackOOW 09 EBS Application Change Management Pack
OOW 09 EBS Application Change Management Packjucaab
 
System Center 2012 - January Licensing Update
System Center 2012 - January Licensing UpdateSystem Center 2012 - January Licensing Update
System Center 2012 - January Licensing Update
Softchoice Corporation
 
Plugin Overview I and II
Plugin Overview I and IIPlugin Overview I and II
Plugin Overview I and II
dotCMS
 
Decoding SDN
Decoding SDNDecoding SDN
Decoding SDN
Juniper Networks
 
Chef for DevOps - an Introduction
Chef for DevOps - an IntroductionChef for DevOps - an Introduction
Chef for DevOps - an Introduction
Sanjeev Sharma
 
Newvem Community - Cloud Management
Newvem Community - Cloud ManagementNewvem Community - Cloud Management
Newvem Community - Cloud Management
Andreas Chatzakis
 

Similar to Getting started with Puppet (20)

Rudder - Configuration management benefits for everyone (FOSDEM 2012)
Rudder - Configuration management benefits for everyone (FOSDEM 2012)Rudder - Configuration management benefits for everyone (FOSDEM 2012)
Rudder - Configuration management benefits for everyone (FOSDEM 2012)
 
Configuration management benefits for everyone - Rudder @ FLOSSUK Spring Conf...
Configuration management benefits for everyone - Rudder @ FLOSSUK Spring Conf...Configuration management benefits for everyone - Rudder @ FLOSSUK Spring Conf...
Configuration management benefits for everyone - Rudder @ FLOSSUK Spring Conf...
 
Configuration management: automating and rationalizing server setup with CFEn...
Configuration management: automating and rationalizing server setup with CFEn...Configuration management: automating and rationalizing server setup with CFEn...
Configuration management: automating and rationalizing server setup with CFEn...
 
Configuration management: automating and rationalizing server setup with CFEn...
Configuration management: automating and rationalizing server setup with CFEn...Configuration management: automating and rationalizing server setup with CFEn...
Configuration management: automating and rationalizing server setup with CFEn...
 
IBM PureFlex System Live Demo Outline: A scenario
IBM PureFlex System Live Demo Outline: A scenarioIBM PureFlex System Live Demo Outline: A scenario
IBM PureFlex System Live Demo Outline: A scenario
 
XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...
XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...
XebiaLabs, CloudBees, Puppet Labs Webinar Slides - IT Automation for the Mode...
 
Nagios Conference 2012 - Andreas Ericsson - Merlin
Nagios Conference 2012 - Andreas Ericsson - MerlinNagios Conference 2012 - Andreas Ericsson - Merlin
Nagios Conference 2012 - Andreas Ericsson - Merlin
 
SOA Summer School: Best of SOA Summer School – Encore Session
SOA Summer School: Best of SOA Summer School – Encore Session SOA Summer School: Best of SOA Summer School – Encore Session
SOA Summer School: Best of SOA Summer School – Encore Session
 
Ss Wrap Up Session 13 Aug
Ss Wrap Up Session 13 AugSs Wrap Up Session 13 Aug
Ss Wrap Up Session 13 Aug
 
Continuous Delivery in the AWS Cloud
Continuous Delivery in the AWS CloudContinuous Delivery in the AWS Cloud
Continuous Delivery in the AWS Cloud
 
Continuous Delivery in the Cloud
Continuous Delivery in the CloudContinuous Delivery in the Cloud
Continuous Delivery in the Cloud
 
Open Source Licenses and Tools
Open Source Licenses and ToolsOpen Source Licenses and Tools
Open Source Licenses and Tools
 
LAST Conference - Dev-Ops and Continuous Delivery
LAST Conference - Dev-Ops and Continuous DeliveryLAST Conference - Dev-Ops and Continuous Delivery
LAST Conference - Dev-Ops and Continuous Delivery
 
Configuration management 101 - A tale of disaster recovery using CFEngine 3
Configuration management 101 - A tale of disaster recovery using CFEngine 3Configuration management 101 - A tale of disaster recovery using CFEngine 3
Configuration management 101 - A tale of disaster recovery using CFEngine 3
 
OOW 09 EBS Application Change Management Pack
OOW 09 EBS Application Change Management PackOOW 09 EBS Application Change Management Pack
OOW 09 EBS Application Change Management Pack
 
System Center 2012 - January Licensing Update
System Center 2012 - January Licensing UpdateSystem Center 2012 - January Licensing Update
System Center 2012 - January Licensing Update
 
Plugin Overview I and II
Plugin Overview I and IIPlugin Overview I and II
Plugin Overview I and II
 
Decoding SDN
Decoding SDNDecoding SDN
Decoding SDN
 
Chef for DevOps - an Introduction
Chef for DevOps - an IntroductionChef for DevOps - an Introduction
Chef for DevOps - an Introduction
 
Newvem Community - Cloud Management
Newvem Community - Cloud ManagementNewvem Community - Cloud Management
Newvem Community - Cloud Management
 

Recently uploaded

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 

Recently uploaded (20)

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 

Getting started with Puppet

  • 1. Getting started with Puppet Jeremy MATHEVET 12/09/2012
  • 2. Topics  Configuration management  Puppet Installation  Puppetmaster  Puppet language basics  Puppet language advanced
  • 3. Configuration management Puppet, Chef, Cfengine
  • 4. Configuration management Definition Configuration Management is the process of standardizing resource configurations and enforcing their state across IT infrastructure in an automated yet agile manner. — Puppet Labs
  • 5. Configuration management Why do we need it  Heterogeneous Operating Systems  Servers profusion  Increasing deployment needs  Cloud
  • 6. Configuration management Different solutions 3 ways for deploying software to the SI Manually  Could take very long time By scripts  Could be quite tricky  Multi-environment case By configuration management software
  • 7. Configuration management Configuration management software Pros :  Centralized management  Automated management  Mass deployment  Configuration customization  Abstraction layer  Idempotence  “DevOps ready”
  • 8. Configuration management Principle  A client/server architecture.  The server has a reference configuration.  The client queries the server.  The client makes change in order to match the reference configuration.
  • 9. Configuration management Principle 1. Pull Request 2. Reference configuration 3. Operations 4. (optionnal) Message code / error
  • 10. Configuration management Principle Version control and security  Revision control used to keep a trace of config revisions  Not mandatory but hugely recommended  Encrypted connection
  • 11. Configuration management Principle What you can do  File transfer  File edition  Service management  Package management  Mount points management  Cron management  VLAN management  Command launching  …
  • 12. Configuration management Comparison 3 major solutions :  Puppet  The most popular  Easiest solution  Chef  Puppet fork  Still young but very promising  CFEngine  The first CM software  The most resource effective  More complex
  • 13. Configuration management Comparison Timeline :
  • 14. Configuration management Comparison Some differences Technology Ruby Ruby C Configuration Dedicated Ruby Dedicated langage langage Configuration Plain text files method Plain text files CLI tool Plain text files Web UI Licence Apache Apache GPL
  • 15. Configuration management Comparison Some similarities  Same origin  Specially designed for config management  Client/server model  Standalone mode possible  CLI interface  Need to increase your competence
  • 16. Configuration management Do you have any questions ?
  • 17. Puppet Installation Install && setup
  • 18. Puppet Installation Puppet Some details and features  Created in 2006 by Puppet Labs  Latest version : 3.0.0  The easiest solution  Dedicated declarative language  Inspired by Ruby  Modular configuration  System profiling with Facter  Template support  Asymmetric Key Encryption
  • 19. Puppet Installation Puppet Prerequisite and sources  Prerequisite  Configured DNS  Ruby  Installation sources :  Distribution repositories  RubyGem  Sources
  • 20. Puppet Installation Puppet Client and server Puppet server : Puppetmaster Puppet client : Puppet (agent) Main steps once installed :  Puppet agent installation on client hosts (also called a node).  Enter the server FQDN into /etc/puppet/puppet.conf  The agent checks every 30 mn by default  Certificate generation  CSR for the node generated on the puppetmaster during the first agent request
  • 21. Puppet Installation Working with Puppetmaster Working with Puppet CA [root@puppetmaster ~]# puppetca --sign fqdn.utopia.net Options Definitions --sign Sign the certificate request for the following host --list List certificate request --all Used with --sign, sign all certificate request --clean Remove all files related to the host from the CA --print Print the full text version of a host’s certificate --revoke Remove all files related to the host from the CA
  • 22. Puppet Installation Do you have any questions ?
  • 23. Puppet Puppetmaster Puppetmaster said…
  • 24. Puppetmaster One important thing Infrastructure is code.
  • 25. Puppetmaster Definition Manifest – Puppet programs are called « manifests » . They use the .pp file extension. These programs contain one or more class.
  • 26. Puppetmaster Puppet configuration tree Configuration files overview 1/2  puppet.conf  General Puppetmaster settings  auth.conf  General ACL  fileserver.conf  ACL for the Puppet fileserver  manifests directory  site.pp : global defaults configuration  nodes.pp : manage hosts
  • 27. Puppetmaster Puppet configuration tree Configuration files overview 2/2  modules directory  Contain one subdirectory per module  manifests/init.pp  The module code  The best way to use Puppet  templates directory  The default directory which contains templates.
  • 28. Puppetmaster Puppet configuration files puppet.conf [main] logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet factpath=$vardir/lib/facter templatedir=$confdir/templates server=debiantest.decilex.net downcasefacts = true
  • 29. Puppetmaster Puppet configuration files manifests/nodes.pp  Skeleton : node basenode {  node ‘fqdn’ { include include ssh module} include ntp }  Node declaration node 'test.utopia.net' inherits basenode {  Module inclusion include nagios  Inheritance }
  • 30. Puppetmaster Puppet configuration files Reading order manifests/site.pp manifests/nodes.pp modules/$nomdumodule/manifests/init.pp modules/$nomdumodule/files/
  • 31. Puppetmaster Do you have any questions ?
  • 32. Puppet Puppet language basics Puppet, Chef, Cfengine
  • 33. Puppet language basics The declarative language About the language  With Puppet, we declare how the node must be.  Everything you want to manage have to be explicitly declared.  A Puppet program is called a manifest  Central manifest : site.pp  Puppet load modules manifests  Into manifests, we define classes.  We write resources inside these classes
  • 34. Puppet language basics The declarative language Resources  The fundamental unit of modeling  Like a “function”  Inside, a series of attributes and their values  Resources types and attributes are predefined by Puppet  List of available resources  http://docs.puppetlabs.com/references/stable/type.html  Skeleton  Ressource-name { ‘title’ : attribute = value }
  • 35. Puppet language basics Resources File  Manage files file { '/etc/passwd':  Content owner => 'root', group => 'root',  Permissions mode => '0644',  Ownership source => ‘puppet:///base/passwd‘  }  Source attribute  Copy a file from the Puppetmaster to the node  puppet:/// followed by the relative source of the file placed in /etc/puppet/modules/module-name/files/
  • 36. Puppet language basics Resources Package package { ‘openssh-server’: ensure => installed }  Manage packages  Wide provider support package { ‘openssh-server’: ensure => latest  APT }  Aptitude package { ‘openssh-server’:  YUM ensure => absent }  And more..  Install, upgrade, uninstall packages  The last or defined package version
  • 37. Puppet language basics Resources Service  Manage services  Wide provider support service { ‘snmpd’:  Init ensure => running, enable => true,  Systemd hasrestart => true,  Upstart hasstatus => true }  And more…  Start, stop, restart, start on boot (enable) services
  • 38. Puppet language basics Do you have any questions ?
  • 39. Puppet Puppet language advanced Dive into Puppet
  • 40. Puppet language advanced Facter The system profiler  Software used by Puppet ~ # facter architecture => i386  Installed on nodes domain => utopia.net facterversion => 1.5.7  Collect various data, "facts", fqdn => debiantest.utopia.net on node hardwaremodel => i686  Many facts already defined by hostname => debiantest Facter id => root […]  Possibility to create your own facts
  • 41. Puppet language advanced Variables Variables into classes  Begin by $ case $operatingsystem {  Can use facts or you centos, redhat: { $service_name = 'ntpd' } own defined debian, ubuntu: { $service_name = 'ntp' } variables }  Often used with service { 'ntp': conditional name => $service_name, statements ensure => running, enable => true  Case statement }  If statement
  • 42. Puppet language advanced Conditional statements If/Elsif/Else Statement if $variable { file { '/some/file': ensure => present } } else {  Based on file { '/some/other/file': ensure => present } }  the truth value of a variable  the value of an expression if $server == 'mongrel' { include mongrel  The truth of an } elsif $server == 'nginx' { arithmetic include nginx expression } else { include thin } if $ram > 1024 { $maxclient = 500 }
  • 43. Puppet language advanced Expressions Operators  Operators usable in if statements  Boolean expressions  And, or, not  Comparison expressions  == =! < > <= > >=  Arithmetic expressions  + - / * >> (left shift) << (right shift)  Regular expressions  =~ !~  “in” expressions  allows to find if the left operand is in the right one.
  • 44. Puppet language advanced Templates Personalized text files file {"hosts":  Permit to have path => "/etc/hosts", personalized owner => root, configuration per node group => root, mode => 644,  Use ERB language content => template("base/hosts.erb")  Retrieve and use } facts <%= ipadress %> <%fqdn> <%hostname>  Use file resource  ERB file placed in module template directory
  • 45. Puppet language advanced Resources relationship Relationship meta-parameters  before  Resource is applied before the target resource  require  Resource is applied after the target resource  notify  Like before + The target resource will refresh if the notifying resource changes  subscribe  Like require + The subscribing resource will refresh if the target resource changes.
  • 46. Puppet language advanced Resources relationship Ordering relationship package { 'openssh-server': ensure => present, before => File['/etc/ssh/sshd_config'], } file { '/etc/ssh/sshd_config': ensure => file, mode => 600, source => 'puppet:///modules/sshd/sshd_config', require => Package['openssh-server'], } These two examples are mutually-exclusive
  • 47. Puppet language advanced Resources relationship Notification relationship file { '/etc/ssh/sshd_config': ensure => file, mode => 600, source => 'puppet:///modules/sshd/sshd_config', notify => Service['sshd'] } service { 'sshd': ensure => running, enable => true, subscribe => File['/etc/ssh/sshd_config‘] } These two examples are mutually-exclusive
  • 48. Puppet language advanced Resources relationship Chaining and refreshing  Ordering resources  The resource on the left is applied before the resource on the right.  ->  Refreshing  Kind of trigger  Restart a service after a file update  ~> # ntp.conf is applied first, and will notify the ntpd service if it changes: File['/etc/ntp.conf'] ~> Service['ntpd']
  • 49. Puppet language advanced Do you have any questions ?
  • 50. Puppet Summary Configuration Configuration Puppetmaster Puppetmaster management management Puppet installation Puppet installation Puppet Language Puppet Language Puppet language Puppet language advanced advanced basics basics
  • 51. Contact Jeremy MATHEVET @Jeyg Content under Creative Commons BY 3.0 License