SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
[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
 
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
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Kürzlich hochgeladen (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
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...
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[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
 
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
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

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