• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Puppet HackDay/BarCamp New Delhi Exercises
 

Puppet HackDay/BarCamp New Delhi Exercises

on

  • 10,768 views

Guided exercise tutorial introduction for 1st Puppet BarCamp/HackDay in New Delhi, March 13, 2010

Guided exercise tutorial introduction for 1st Puppet BarCamp/HackDay in New Delhi, March 13, 2010

Statistics

Views

Total Views
10,768
Views on SlideShare
8,026
Embed Views
2,742

Actions

Likes
4
Downloads
106
Comments
1

17 Embeds 2,742

http://engineering.slideshare.com 1442
http://blog.slideshare.net 543
http://engineering.slideshare.net 503
http://barcamp.org 106
http://feeds.feedburner.com 66
http://www.barcamp.org 22
http://www.slideshare.net 20
http://translate.googleusercontent.com 17
http://www.linkedin.com 10
http://207.46.192.232 4
http://www.kapilmohan.com 3
http://66.39.50.149 1
http://fanyi.youdao.com 1
http://www.lmodules.com 1
http://www.anamonaldi.com.ar 1
http://static.slidesharecdn.com 1
https://www.linkedin.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Free Download : http://gg.gg/114bb

    Hey Guyz and girls, Today I am gonna show you perfact tool, Remember This video is old, But the download link with hack is brand new. Its very simple to using this tool and here are some instructions in video. Please REDOWNLOAD. Don't Forget to Comment Subscribe & Rate My Video :)

    Virus Scan :- This file has been scanned with avast! Antivirus. -- Status: FILE IS CLEANN.

    Copyright © 2014. All Rights Reserved
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Puppet HackDay/BarCamp New Delhi Exercises Puppet HackDay/BarCamp New Delhi Exercises Presentation Transcript

    • 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