SlideShare una empresa de Scribd logo
1 de 17
Descargar para leer sin conexión
First Moves
with Puppet
New Delhi Puppet HackDay/
BarCamp March 13, 2010
Presented by
Slideshare Operations Engineering/Julie Tsai
Today

  Quick Primer

  Useful Commands

  Puppeting Sudoers I — Permissions

  Puppeting Sudoers II — OS Conditions

  Puppeting Sudoers III — Inheriting Class

  Facter

  References
                                              2
Quick Primer: How It Flows




 Ref. http://www.linuxforu.com/wp-content/uploads/2009/06/puppet_diagram.png   3
Quick Primer: Learning the Lingo
 Resource – instance of native type, plugin, or
   definition, i.e. user, exec, file

   Capitalized resource: invoked by other resources of previously
   defined resource, i.e. file foo.txt laver invoked as File[“foo.txt”]

 Class - resource(s) description with title, file, attributes
 Definition – abstract description of class, can be
   invoked multiple times
 Node – host instance (physical or virtual)
 Collection – groups of resources

 Recipe – sample puppet code (manifests/*.pp)
                                                                          4
Quick Primer: Data Parameters

Variables – substitution values
Arrays – grouped list of values
Attributes – statement(s) describing
  resources
Literals – string values that needn’t be
   interpolated

                                           5
Quick Primer: Variable Scoping
  Overridable variable defaults defined only in
  outer scope of resource instances

  Declarative language: Within the same-level
  scope, variables can only be defined once

  Qualified variables are a method of passing
  parameters from a class
    class mothership {
       $server = “juno”
    }

    class satellite {
       $ms = $mothership::server
    }
                                                   6
Quick Primer: Where Things Are

Note: below assumes default install in /etc
  /etc/puppet/fileserver.conf (used by puppermasterd)

     path /var/lib/puppet/files
     allow 10.100.0.0/24
  /etc/puppet/puppet.conf (used by clients’ puppetd)

     vardir = /var/lib/puppet
     logdir = /var/log/puppet
     classfile = $vardir/classes.txt
  /etc/puppet/manifests/[../..]/*.pp (architecture varies)
                                                              7
Quick Primer: A Client Directory Tree


 puppetclient01:/var/lib/puppet
     |-> classes.txt – node’s class membership
     |-> cientbucket – hashed config artifacts
     |-> lib
     |-> localconfig.yaml
     |-> ssl – authentication certs
     |-> state – checksums, entropy-tracking



                                                 8
Quick Primer: Master Directory Tree
puppetmasterd:/var/lib/puppet
    |-> bucket
     |-> classes.txt
     |-> clientbucket
     |-> client_yaml
     |-> lib
     |-> localconfig.yaml
     |-> reports
     |-> rrd
     |-> ssl
     |-> state
     |-> yaml

                                      9
Useful Commands to Get Started

  puppet <puppetscript.pp> - run standalone script
      -l /path/to/file.log – logpath
     -d – debug
     --noop – dry-run

  puppetd – daemon on client that schedules retrieval of
    configs from puppetmaster and applies locally
    -d – debug
    --test – verbose logging
    --noop – dry-run
    -l /path/to/log – log path

  facter – find out local node’s values for reserved classes
                                                               10
Puppeting Sudoers I — Permissions
Configure /etc/puppet/manifests/sudoers.pp :

  file { "/etc/sudoers":
       owner => root,
       group => wheel,
       mode   => 400,
  }


 And run:

  [puppet@puppet manifests]# puppet –noop –d /etc/puppet/
  manifests/sudoers.pp


                                                            11
Puppeting Sudoers II — Operating Conditions
Now, correct with /etc/puppet/manifests/sudoers2.pp

  file { "/etc/sudoers”:
       mode => $operatingsystem ? {
            centos => "440",
            gentoo => "440",
            suse => "640",
            default => ”400",
       },


       owner => root,
       group => root,


  }                                                   12
Puppeting Sudoers III — Inheriting Class
/etc/puppet/manifests/sudoers3.pp

  class unix {
           file { "/etc/sudoers":
                   owner => root,
                   group => root,
           }
           service {
                   "sshd":
                   ensure => running,
           }
  }
  class centos_mycompany inherits unix {
           File["/etc/sudoers"] { mode => 440 }
  }
                                                  13
Puppeting Sudoers III — Inheriting Class (cont.)

/etc/puppet/manifests/sudoers3.pp

  node default {
            include unix
  }
  node bastionhost {
          include centos_mycompany
  }


 And run:
  [puppet@puppet manifests]# puppet –d –noop sudoers3.pp

  [puppet@puppet manifests]# cat /var/lib/puppet/classes.txt


                                                               14
Puppeting Sudoers III — Inheriting Class (cont. 2)

Use Facter to defind nodename:

  [puppet@puppet manifests]# facter | egrep -i 'fqdn|hostname’




/etc/puppet/manifests/sudoers3.pp


  node'puppet.us-west-1.compute.internal' {
          include centos_mycompany
  }




                                                                 15
Facts about Facter

 Facter is a Puppet utility that
  discovers relevant “facts” that
  puppet can use to dynamically
  populate puppet manifest variables
 Executing command-line Facter
  can show you the reserved
  variables like FQDN, hostname,
  kernel, architecture, sshdsakey, etc.
                                          16
References
  Reductive Labs Puppet Guides
   http://docs.reductivelabs.com/guides/

  Glossary of Terms
   http://reductivelabs.com/trac/puppet/wiki/
   GlossaryOfTerms

  Resource Attributes
   http://reductivelabs.com/trac/puppet/wiki/
   TypeReference#metaparameters

  Nice vimrc for Puppet
   http://www.davidpashley.com/blog/systems-
   administration/puppet/vim-highlighting.html

  Classic LISA ‘98 paper on best-practice infrastructures
   http://www.infrastructures.org/papers/bootstrap/
   bootstrap.html                                            17

Más contenido relacionado

La actualidad más candente

Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasaggarrett honeycutt
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installationhabeebulla g
 
Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell ScriptingJaibeer Malik
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with AugeasPuppet
 
Node.js basics
Node.js basicsNode.js basics
Node.js basicsBen Lin
 
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu 康志強 大人
 
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...Puppet
 
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)Nag Arvind Gudiseva
 
Unix Shell Script
Unix Shell ScriptUnix Shell Script
Unix Shell Scriptstudent
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsSudharsan S
 
Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Martijn Verburg
 
Documentation with sphinx @ PyHug
Documentation with sphinx @ PyHugDocumentation with sphinx @ PyHug
Documentation with sphinx @ PyHugJimmy Lai
 

La actualidad más candente (20)

Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
 
Sudo
SudoSudo
Sudo
 
Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell Scripting
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
 
Refcard en-a4
Refcard en-a4Refcard en-a4
Refcard en-a4
 
Solaris_quickref.pdf
Solaris_quickref.pdfSolaris_quickref.pdf
Solaris_quickref.pdf
 
Node.js basics
Node.js basicsNode.js basics
Node.js basics
 
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
Hadoop 2.2.0 Multi-node cluster Installation on Ubuntu
 
extending-php
extending-phpextending-php
extending-php
 
Linux Shell Basics
Linux Shell BasicsLinux Shell Basics
Linux Shell Basics
 
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
Puppet Camp Phoenix 2015: Managing Files via Puppet: Let Me Count The Ways (B...
 
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
 
Bower introduction
Bower introductionBower introduction
Bower introduction
 
Unix Shell Script
Unix Shell ScriptUnix Shell Script
Unix Shell Script
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2
 
Documentation with sphinx @ PyHug
Documentation with sphinx @ PyHugDocumentation with sphinx @ PyHug
Documentation with sphinx @ PyHug
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 

Destacado

Considerations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack CloudConsiderations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack CloudAll Things Open
 
OpenStack: Everything You Need to Know To Get Started
OpenStack: Everything You Need to Know To Get StartedOpenStack: Everything You Need to Know To Get Started
OpenStack: Everything You Need to Know To Get StartedAll Things Open
 
How I Learned to Stop Worrying and Love DevOps (March 2014)
How I Learned to Stop Worrying and Love DevOps (March 2014)How I Learned to Stop Worrying and Love DevOps (March 2014)
How I Learned to Stop Worrying and Love DevOps (March 2014)bridgetkromhout
 
State of the Stack April 2013
State of the Stack April 2013State of the Stack April 2013
State of the Stack April 2013Randy Bias
 
Overview of Puppet and Ansible
Overview of Puppet and AnsibleOverview of Puppet and Ansible
Overview of Puppet and AnsibleKyle Smith
 
DevOps, from inception to conclusion
DevOps, from inception to conclusionDevOps, from inception to conclusion
DevOps, from inception to conclusionAbhishek Gaurav
 
Puppet Intfrastructure as Code
Puppet Intfrastructure as CodePuppet Intfrastructure as Code
Puppet Intfrastructure as CodeSamir Chekkal
 
Switching from Puppet to Ansible
Switching from Puppet to AnsibleSwitching from Puppet to Ansible
Switching from Puppet to AnsibleDennis Rowe
 
Devops : Automate Your Infrastructure with Puppet
Devops : Automate Your Infrastructure with PuppetDevops : Automate Your Infrastructure with Puppet
Devops : Automate Your Infrastructure with PuppetEdureka!
 
How Docker Fits into DevOps Ecosystem
How Docker Fits into DevOps EcosystemHow Docker Fits into DevOps Ecosystem
How Docker Fits into DevOps EcosystemEdureka!
 
Netflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and OpsNetflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and OpsAdrian Cockcroft
 
Introduction to Puppet Enterprise
Introduction to Puppet EnterpriseIntroduction to Puppet Enterprise
Introduction to Puppet EnterprisePuppet
 
Introduction to Puppet Enterprise 2016.5
Introduction to Puppet Enterprise 2016.5Introduction to Puppet Enterprise 2016.5
Introduction to Puppet Enterprise 2016.5Puppet
 
5 Best Practices DevOps Culture
5 Best Practices DevOps Culture5 Best Practices DevOps Culture
5 Best Practices DevOps CultureEdureka!
 
Puppet for SysAdmins
Puppet for SysAdminsPuppet for SysAdmins
Puppet for SysAdminsPuppet
 
Continuous Integration for Oracle Database Development
Continuous Integration for Oracle Database DevelopmentContinuous Integration for Oracle Database Development
Continuous Integration for Oracle Database DevelopmentVladimir Bakhov
 
Getting started with Puppet
Getting started with PuppetGetting started with Puppet
Getting started with Puppetjeyg
 
Puppet overview
Puppet overviewPuppet overview
Puppet overviewjoshbeard
 
Architectures for open and scalable clouds
Architectures for open and scalable cloudsArchitectures for open and scalable clouds
Architectures for open and scalable cloudsRandy Bias
 

Destacado (20)

Considerations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack CloudConsiderations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack Cloud
 
OpenStack: Everything You Need to Know To Get Started
OpenStack: Everything You Need to Know To Get StartedOpenStack: Everything You Need to Know To Get Started
OpenStack: Everything You Need to Know To Get Started
 
How I Learned to Stop Worrying and Love DevOps (March 2014)
How I Learned to Stop Worrying and Love DevOps (March 2014)How I Learned to Stop Worrying and Love DevOps (March 2014)
How I Learned to Stop Worrying and Love DevOps (March 2014)
 
State of the Stack April 2013
State of the Stack April 2013State of the Stack April 2013
State of the Stack April 2013
 
Overview of Puppet and Ansible
Overview of Puppet and AnsibleOverview of Puppet and Ansible
Overview of Puppet and Ansible
 
DevOps, from inception to conclusion
DevOps, from inception to conclusionDevOps, from inception to conclusion
DevOps, from inception to conclusion
 
Puppet Intfrastructure as Code
Puppet Intfrastructure as CodePuppet Intfrastructure as Code
Puppet Intfrastructure as Code
 
Switching from Puppet to Ansible
Switching from Puppet to AnsibleSwitching from Puppet to Ansible
Switching from Puppet to Ansible
 
Devops : Automate Your Infrastructure with Puppet
Devops : Automate Your Infrastructure with PuppetDevops : Automate Your Infrastructure with Puppet
Devops : Automate Your Infrastructure with Puppet
 
How Docker Fits into DevOps Ecosystem
How Docker Fits into DevOps EcosystemHow Docker Fits into DevOps Ecosystem
How Docker Fits into DevOps Ecosystem
 
Netflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and OpsNetflix on Cloud - combined slides for Dev and Ops
Netflix on Cloud - combined slides for Dev and Ops
 
Introduction to Puppetry
Introduction to PuppetryIntroduction to Puppetry
Introduction to Puppetry
 
Introduction to Puppet Enterprise
Introduction to Puppet EnterpriseIntroduction to Puppet Enterprise
Introduction to Puppet Enterprise
 
Introduction to Puppet Enterprise 2016.5
Introduction to Puppet Enterprise 2016.5Introduction to Puppet Enterprise 2016.5
Introduction to Puppet Enterprise 2016.5
 
5 Best Practices DevOps Culture
5 Best Practices DevOps Culture5 Best Practices DevOps Culture
5 Best Practices DevOps Culture
 
Puppet for SysAdmins
Puppet for SysAdminsPuppet for SysAdmins
Puppet for SysAdmins
 
Continuous Integration for Oracle Database Development
Continuous Integration for Oracle Database DevelopmentContinuous Integration for Oracle Database Development
Continuous Integration for Oracle Database Development
 
Getting started with Puppet
Getting started with PuppetGetting started with Puppet
Getting started with Puppet
 
Puppet overview
Puppet overviewPuppet overview
Puppet overview
 
Architectures for open and scalable clouds
Architectures for open and scalable cloudsArchitectures for open and scalable clouds
Architectures for open and scalable clouds
 

Similar a Puppet HackDay/BarCamp New Delhi Exercises

Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with PuppetAlessandro Franceschi
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetOmar Reygaert
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and AgentRanjit Avasarala
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013grim_radical
 
Writing & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp BostonWriting & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp BostonPuppet
 
Tame your Infrastructure with Puppet
Tame your Infrastructure with PuppetTame your Infrastructure with Puppet
Tame your Infrastructure with Puppetdelimiter
 
Puppet atbazaarvoice
Puppet atbazaarvoicePuppet atbazaarvoice
Puppet atbazaarvoiceDave Barcelo
 
Puppet Troubleshooting
Puppet TroubleshootingPuppet Troubleshooting
Puppet TroubleshootingPuppet
 
PuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into OperationsPuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into Operationsgrim_radical
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with PuppetOlinData
 
Writing & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet ForgeWriting & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet ForgePuppet
 
Puppet Modules for Fun and Profit
Puppet Modules for Fun and ProfitPuppet Modules for Fun and Profit
Puppet Modules for Fun and ProfitPuppet
 
Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet
 

Similar a Puppet HackDay/BarCamp New Delhi Exercises (20)

Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with Puppet
 
Puppet
PuppetPuppet
Puppet
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 
Puppet quick start guide
Puppet quick start guidePuppet quick start guide
Puppet quick start guide
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and Agent
 
Puppi. Puppet strings to the shell
Puppi. Puppet strings to the shellPuppi. Puppet strings to the shell
Puppi. Puppet strings to the shell
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
Writing & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp BostonWriting & Sharing Great Modules - Puppet Camp Boston
Writing & Sharing Great Modules - Puppet Camp Boston
 
Tame your Infrastructure with Puppet
Tame your Infrastructure with PuppetTame your Infrastructure with Puppet
Tame your Infrastructure with Puppet
 
Puppet atbazaarvoice
Puppet atbazaarvoicePuppet atbazaarvoice
Puppet atbazaarvoice
 
Puppet Troubleshooting
Puppet TroubleshootingPuppet Troubleshooting
Puppet Troubleshooting
 
Troubleshooting Puppet
Troubleshooting PuppetTroubleshooting Puppet
Troubleshooting Puppet
 
PuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into OperationsPuppetDB: Sneaking Clojure into Operations
PuppetDB: Sneaking Clojure into Operations
 
Intro to-puppet
Intro to-puppetIntro to-puppet
Intro to-puppet
 
Puppet
PuppetPuppet
Puppet
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with Puppet
 
Writing & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet ForgeWriting & Sharing Great Modules on the Puppet Forge
Writing & Sharing Great Modules on the Puppet Forge
 
Puppet modules for Fun and Profit
Puppet modules for Fun and ProfitPuppet modules for Fun and Profit
Puppet modules for Fun and Profit
 
Puppet Modules for Fun and Profit
Puppet Modules for Fun and ProfitPuppet Modules for Fun and Profit
Puppet Modules for Fun and Profit
 
Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013
 

Más de Julie Tsai

pbc_devsecops_eastereggs.2022oct06.jt.pptx
pbc_devsecops_eastereggs.2022oct06.jt.pptxpbc_devsecops_eastereggs.2022oct06.jt.pptx
pbc_devsecops_eastereggs.2022oct06.jt.pptxJulie Tsai
 
Building Towards the New Security & Privacy Landscape: Where Do We Go From Here?
Building Towards the New Security & Privacy Landscape: Where Do We Go From Here?Building Towards the New Security & Privacy Landscape: Where Do We Go From Here?
Building Towards the New Security & Privacy Landscape: Where Do We Go From Here?Julie Tsai
 
Everything you know is wrong: How Computer-Ing While Leading People Will Be Y...
Everything you know is wrong: How Computer-Ing While Leading People Will Be Y...Everything you know is wrong: How Computer-Ing While Leading People Will Be Y...
Everything you know is wrong: How Computer-Ing While Leading People Will Be Y...Julie Tsai
 
Carrot hammer olivebranch.devopseast.20.2019nov08
Carrot hammer olivebranch.devopseast.20.2019nov08Carrot hammer olivebranch.devopseast.20.2019nov08
Carrot hammer olivebranch.devopseast.20.2019nov08Julie Tsai
 
Build It and They Will Come-Pliant
Build It and They Will Come-PliantBuild It and They Will Come-Pliant
Build It and They Will Come-PliantJulie Tsai
 
API Security: Assume Possible Interference
API Security: Assume Possible InterferenceAPI Security: Assume Possible Interference
API Security: Assume Possible InterferenceJulie Tsai
 
Why the org_matters_shorter.jzt.2018sept25
Why the org_matters_shorter.jzt.2018sept25Why the org_matters_shorter.jzt.2018sept25
Why the org_matters_shorter.jzt.2018sept25Julie Tsai
 
Dev ops and_infrastructure_immunology_v0.4
Dev ops and_infrastructure_immunology_v0.4Dev ops and_infrastructure_immunology_v0.4
Dev ops and_infrastructure_immunology_v0.4Julie Tsai
 
Automate your systems with puppet, and change your life
Automate your systems with puppet, and change your lifeAutomate your systems with puppet, and change your life
Automate your systems with puppet, and change your lifeJulie Tsai
 

Más de Julie Tsai (9)

pbc_devsecops_eastereggs.2022oct06.jt.pptx
pbc_devsecops_eastereggs.2022oct06.jt.pptxpbc_devsecops_eastereggs.2022oct06.jt.pptx
pbc_devsecops_eastereggs.2022oct06.jt.pptx
 
Building Towards the New Security & Privacy Landscape: Where Do We Go From Here?
Building Towards the New Security & Privacy Landscape: Where Do We Go From Here?Building Towards the New Security & Privacy Landscape: Where Do We Go From Here?
Building Towards the New Security & Privacy Landscape: Where Do We Go From Here?
 
Everything you know is wrong: How Computer-Ing While Leading People Will Be Y...
Everything you know is wrong: How Computer-Ing While Leading People Will Be Y...Everything you know is wrong: How Computer-Ing While Leading People Will Be Y...
Everything you know is wrong: How Computer-Ing While Leading People Will Be Y...
 
Carrot hammer olivebranch.devopseast.20.2019nov08
Carrot hammer olivebranch.devopseast.20.2019nov08Carrot hammer olivebranch.devopseast.20.2019nov08
Carrot hammer olivebranch.devopseast.20.2019nov08
 
Build It and They Will Come-Pliant
Build It and They Will Come-PliantBuild It and They Will Come-Pliant
Build It and They Will Come-Pliant
 
API Security: Assume Possible Interference
API Security: Assume Possible InterferenceAPI Security: Assume Possible Interference
API Security: Assume Possible Interference
 
Why the org_matters_shorter.jzt.2018sept25
Why the org_matters_shorter.jzt.2018sept25Why the org_matters_shorter.jzt.2018sept25
Why the org_matters_shorter.jzt.2018sept25
 
Dev ops and_infrastructure_immunology_v0.4
Dev ops and_infrastructure_immunology_v0.4Dev ops and_infrastructure_immunology_v0.4
Dev ops and_infrastructure_immunology_v0.4
 
Automate your systems with puppet, and change your life
Automate your systems with puppet, and change your lifeAutomate your systems with puppet, and change your life
Automate your systems with puppet, and change your life
 

Último

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
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
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
 

Último (20)

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
 
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...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
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...
 

Puppet HackDay/BarCamp New Delhi Exercises

  • 1. First Moves with Puppet New Delhi Puppet HackDay/ BarCamp March 13, 2010 Presented by Slideshare Operations Engineering/Julie Tsai
  • 2. Today   Quick Primer   Useful Commands   Puppeting Sudoers I — Permissions   Puppeting Sudoers II — OS Conditions   Puppeting Sudoers III — Inheriting Class   Facter   References 2
  • 3. Quick Primer: How It Flows Ref. http://www.linuxforu.com/wp-content/uploads/2009/06/puppet_diagram.png 3
  • 4. Quick Primer: Learning the Lingo Resource – instance of native type, plugin, or definition, i.e. user, exec, file Capitalized resource: invoked by other resources of previously defined resource, i.e. file foo.txt laver invoked as File[“foo.txt”] Class - resource(s) description with title, file, attributes Definition – abstract description of class, can be invoked multiple times Node – host instance (physical or virtual) Collection – groups of resources Recipe – sample puppet code (manifests/*.pp) 4
  • 5. Quick Primer: Data Parameters Variables – substitution values Arrays – grouped list of values Attributes – statement(s) describing resources Literals – string values that needn’t be interpolated 5
  • 6. Quick Primer: Variable Scoping   Overridable variable defaults defined only in outer scope of resource instances   Declarative language: Within the same-level scope, variables can only be defined once   Qualified variables are a method of passing parameters from a class class mothership { $server = “juno” } class satellite { $ms = $mothership::server } 6
  • 7. Quick Primer: Where Things Are Note: below assumes default install in /etc   /etc/puppet/fileserver.conf (used by puppermasterd) path /var/lib/puppet/files allow 10.100.0.0/24   /etc/puppet/puppet.conf (used by clients’ puppetd) vardir = /var/lib/puppet logdir = /var/log/puppet classfile = $vardir/classes.txt   /etc/puppet/manifests/[../..]/*.pp (architecture varies) 7
  • 8. Quick Primer: A Client Directory Tree puppetclient01:/var/lib/puppet |-> classes.txt – node’s class membership |-> cientbucket – hashed config artifacts |-> lib |-> localconfig.yaml |-> ssl – authentication certs |-> state – checksums, entropy-tracking 8
  • 9. Quick Primer: Master Directory Tree puppetmasterd:/var/lib/puppet |-> bucket |-> classes.txt |-> clientbucket |-> client_yaml |-> lib |-> localconfig.yaml |-> reports |-> rrd |-> ssl |-> state |-> yaml 9
  • 10. Useful Commands to Get Started puppet <puppetscript.pp> - run standalone script -l /path/to/file.log – logpath -d – debug --noop – dry-run puppetd – daemon on client that schedules retrieval of configs from puppetmaster and applies locally -d – debug --test – verbose logging --noop – dry-run -l /path/to/log – log path facter – find out local node’s values for reserved classes 10
  • 11. Puppeting Sudoers I — Permissions Configure /etc/puppet/manifests/sudoers.pp : file { "/etc/sudoers": owner => root, group => wheel, mode => 400, } And run: [puppet@puppet manifests]# puppet –noop –d /etc/puppet/ manifests/sudoers.pp 11
  • 12. Puppeting Sudoers II — Operating Conditions Now, correct with /etc/puppet/manifests/sudoers2.pp file { "/etc/sudoers”: mode => $operatingsystem ? { centos => "440", gentoo => "440", suse => "640", default => ”400", }, owner => root, group => root, } 12
  • 13. Puppeting Sudoers III — Inheriting Class /etc/puppet/manifests/sudoers3.pp class unix { file { "/etc/sudoers": owner => root, group => root, } service { "sshd": ensure => running, } } class centos_mycompany inherits unix { File["/etc/sudoers"] { mode => 440 } } 13
  • 14. Puppeting Sudoers III — Inheriting Class (cont.) /etc/puppet/manifests/sudoers3.pp node default { include unix } node bastionhost { include centos_mycompany } And run: [puppet@puppet manifests]# puppet –d –noop sudoers3.pp [puppet@puppet manifests]# cat /var/lib/puppet/classes.txt 14
  • 15. Puppeting Sudoers III — Inheriting Class (cont. 2) Use Facter to defind nodename: [puppet@puppet manifests]# facter | egrep -i 'fqdn|hostname’ /etc/puppet/manifests/sudoers3.pp node'puppet.us-west-1.compute.internal' { include centos_mycompany } 15
  • 16. Facts about Facter  Facter is a Puppet utility that discovers relevant “facts” that puppet can use to dynamically populate puppet manifest variables  Executing command-line Facter can show you the reserved variables like FQDN, hostname, kernel, architecture, sshdsakey, etc. 16
  • 17. References   Reductive Labs Puppet Guides http://docs.reductivelabs.com/guides/   Glossary of Terms http://reductivelabs.com/trac/puppet/wiki/ GlossaryOfTerms   Resource Attributes http://reductivelabs.com/trac/puppet/wiki/ TypeReference#metaparameters   Nice vimrc for Puppet http://www.davidpashley.com/blog/systems- administration/puppet/vim-highlighting.html   Classic LISA ‘98 paper on best-practice infrastructures http://www.infrastructures.org/papers/bootstrap/ bootstrap.html 17