SlideShare a Scribd company logo
First Moves with Puppet New Delhi Puppet HackDay/ BarCamp March 13, 2010 Presented by  Slideshare Operations Engineering/Julie Tsai
Today Quick Primer Useful Commands PuppetingSudoers I — Permissions PuppetingSudoers II — OS Conditions PuppetingSudoers 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
PuppetingSudoers I — Permissions Configure /etc/puppet/manifests/sudoers.pp : file { "/etc/sudoers":     owner => root,     group => wheel,     mode  => 400, } 11 And run: [puppet@puppet manifests]# puppet –noop –d /etc/puppet/manifests/sudoers.pp
PuppetingSudoers 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
PuppetingSudoers 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
PuppetingSudoers III — Inheriting Class (cont.) /etc/puppet/manifests/sudoers3.pp node default {         include unix } node bastionhost {         include centos_mycompany } 14 And run: [puppet@puppet manifests]# puppet –d –noop sudoers3.pp [puppet@puppet manifests]# cat /var/lib/puppet/classes.txt
PuppetingSudoers III — Inheriting Class (cont. 2) Use Facter to defindnodename: [puppet@puppet manifests]#  facter | egrep -i 'fqdn|hostname’ 15 /etc/puppet/manifests/sudoers3.pp node'puppet.us-west-1.compute.internal' {         include centos_mycompany }
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 Guideshttp://docs.reductivelabs.com/guides/ Glossary of Terms  http://reductivelabs.com/trac/puppet/wiki/GlossaryOfTerms Resource Attributeshttp://reductivelabs.com/trac/puppet/wiki/TypeReference#metaparameters Nice vimrc for Puppethttp://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

More Related Content

What's hot

Training Slides: Basics 105: Backup, Recovery and Provisioning Within Tungste...
Training Slides: Basics 105: Backup, Recovery and Provisioning Within Tungste...Training Slides: Basics 105: Backup, Recovery and Provisioning Within Tungste...
Training Slides: Basics 105: Backup, Recovery and Provisioning Within Tungste...
Continuent
 
Bower introduction
Bower introductionBower introduction
Bower introduction
Oleksii Prohonnyi
 
Linux Command Line
Linux Command LineLinux Command Line
Linux Command Line
Prima Yogi Loviniltra
 
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
 
Ansible for Beginners
Ansible for BeginnersAnsible for Beginners
Ansible for Beginners
Arie Bregman
 
2.1.using the shell
2.1.using the shell2.1.using the shell
2.1.using the shelldonv214
 
(Practical) linux 104
(Practical) linux 104(Practical) linux 104
(Practical) linux 104
Arie Bregman
 
Mac OSX Terminal 101
Mac OSX Terminal 101Mac OSX Terminal 101
Mac OSX Terminal 101
Murugun Murugun
 
Apache Hadoop for System Administrators
Apache Hadoop for System AdministratorsApache Hadoop for System Administrators
Apache Hadoop for System Administrators
Allen Wittenauer
 
(Practical) linux 101
(Practical) linux 101(Practical) linux 101
(Practical) linux 101
Arie Bregman
 
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pmRyosuke IWANAGA
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
Simone Federici
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsSudharsan S
 
37562259 top-consuming-process
37562259 top-consuming-process37562259 top-consuming-process
37562259 top-consuming-processskumner
 
Puppet overview
Puppet overviewPuppet overview
Puppet overview
Mike_Foto
 
WordPress 運用を支える Perl
WordPress 運用を支える PerlWordPress 運用を支える Perl
WordPress 運用を支える Perl
鉄次 尾形
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
Hao-Ran Liu
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
Using the command line on macOS
Using the command line on macOSUsing the command line on macOS
Using the command line on macOS
AdamFallon4
 
Writing file system in CPython
Writing file system in CPythonWriting file system in CPython
Writing file system in CPython
delimitry
 

What's hot (20)

Training Slides: Basics 105: Backup, Recovery and Provisioning Within Tungste...
Training Slides: Basics 105: Backup, Recovery and Provisioning Within Tungste...Training Slides: Basics 105: Backup, Recovery and Provisioning Within Tungste...
Training Slides: Basics 105: Backup, Recovery and Provisioning Within Tungste...
 
Bower introduction
Bower introductionBower introduction
Bower introduction
 
Linux Command Line
Linux Command LineLinux Command Line
Linux Command Line
 
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...
 
Ansible for Beginners
Ansible for BeginnersAnsible for Beginners
Ansible for Beginners
 
2.1.using the shell
2.1.using the shell2.1.using the shell
2.1.using the shell
 
(Practical) linux 104
(Practical) linux 104(Practical) linux 104
(Practical) linux 104
 
Mac OSX Terminal 101
Mac OSX Terminal 101Mac OSX Terminal 101
Mac OSX Terminal 101
 
Apache Hadoop for System Administrators
Apache Hadoop for System AdministratorsApache Hadoop for System Administrators
Apache Hadoop for System Administrators
 
(Practical) linux 101
(Practical) linux 101(Practical) linux 101
(Practical) linux 101
 
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
"Ops Tools with Perl" 2012/05/12 Hokkaido.pm
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
37562259 top-consuming-process
37562259 top-consuming-process37562259 top-consuming-process
37562259 top-consuming-process
 
Puppet overview
Puppet overviewPuppet overview
Puppet overview
 
WordPress 運用を支える Perl
WordPress 運用を支える PerlWordPress 運用を支える Perl
WordPress 運用を支える Perl
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Using the command line on macOS
Using the command line on macOSUsing the command line on macOS
Using the command line on macOS
 
Writing file system in CPython
Writing file system in CPythonWriting file system in CPython
Writing file system in CPython
 

Viewers also liked

Royos X
Royos XRoyos X
Royos X
haza444
 
Glamping y aguas termales: vacaciones en contacto con la naturaleza para reca...
Glamping y aguas termales: vacaciones en contacto con la naturaleza para reca...Glamping y aguas termales: vacaciones en contacto con la naturaleza para reca...
Glamping y aguas termales: vacaciones en contacto con la naturaleza para reca...
GaliWonders
 
Cartoon 6 Linked In
Cartoon 6 Linked InCartoon 6 Linked In
Cartoon 6 Linked InLieke_Kemper
 
Para sicologia
Para sicologiaPara sicologia
Para sicologiamoira_IQ
 
Park Inn Cardiffs 50 50 Campaign
Park Inn Cardiffs 50 50 CampaignPark Inn Cardiffs 50 50 Campaign
Park Inn Cardiffs 50 50 Campaign
Jan Alfrink
 
05. semana 5
05. semana 505. semana 5
05. semana 5moira_IQ
 
Assemblea constitutiva Palamós i Sant Joan per l'Autodeterminació
Assemblea constitutiva Palamós i Sant Joan per l'AutodeterminacióAssemblea constitutiva Palamós i Sant Joan per l'Autodeterminació
Assemblea constitutiva Palamós i Sant Joan per l'Autodeterminació
Pere Minobas Suquet
 
Presentacion de video de stadistica
Presentacion de video de stadisticaPresentacion de video de stadistica
Presentacion de video de stadistica
keremcitha
 
Dificultades en el aprendizaje tac
Dificultades en el aprendizaje tacDificultades en el aprendizaje tac
Dificultades en el aprendizaje tac
belgica bultron
 
Oh no, I´ve lost my ducks. Help me find them and win a fun goodie...
Oh no, I´ve lost my ducks. Help me find them and win a fun goodie...Oh no, I´ve lost my ducks. Help me find them and win a fun goodie...
Oh no, I´ve lost my ducks. Help me find them and win a fun goodie...
Jan Alfrink
 
Cartoon Februari 2010 Linked In
Cartoon Februari 2010 Linked InCartoon Februari 2010 Linked In
Cartoon Februari 2010 Linked InLieke_Kemper
 
Mentefacto De Poder
Mentefacto De PoderMentefacto De Poder
Mentefacto De Poderguest485c5c0
 
Binary Trees
Binary TreesBinary Trees
Binary Trees
Sadaf Ismail
 
Tercer sector
Tercer sectorTercer sector
Tercer sector
Georgee Martz Cruz
 

Viewers also liked (19)

Royos X
Royos XRoyos X
Royos X
 
Photo Album Ahmad 047
Photo Album Ahmad 047Photo Album Ahmad 047
Photo Album Ahmad 047
 
Glamping y aguas termales: vacaciones en contacto con la naturaleza para reca...
Glamping y aguas termales: vacaciones en contacto con la naturaleza para reca...Glamping y aguas termales: vacaciones en contacto con la naturaleza para reca...
Glamping y aguas termales: vacaciones en contacto con la naturaleza para reca...
 
Cartoon 6 Linked In
Cartoon 6 Linked InCartoon 6 Linked In
Cartoon 6 Linked In
 
Para sicologia
Para sicologiaPara sicologia
Para sicologia
 
Park Inn Cardiffs 50 50 Campaign
Park Inn Cardiffs 50 50 CampaignPark Inn Cardiffs 50 50 Campaign
Park Inn Cardiffs 50 50 Campaign
 
05. semana 5
05. semana 505. semana 5
05. semana 5
 
Assemblea constitutiva Palamós i Sant Joan per l'Autodeterminació
Assemblea constitutiva Palamós i Sant Joan per l'AutodeterminacióAssemblea constitutiva Palamós i Sant Joan per l'Autodeterminació
Assemblea constitutiva Palamós i Sant Joan per l'Autodeterminació
 
Presentacion de video de stadistica
Presentacion de video de stadisticaPresentacion de video de stadistica
Presentacion de video de stadistica
 
Dificultades en el aprendizaje tac
Dificultades en el aprendizaje tacDificultades en el aprendizaje tac
Dificultades en el aprendizaje tac
 
Oh no, I´ve lost my ducks. Help me find them and win a fun goodie...
Oh no, I´ve lost my ducks. Help me find them and win a fun goodie...Oh no, I´ve lost my ducks. Help me find them and win a fun goodie...
Oh no, I´ve lost my ducks. Help me find them and win a fun goodie...
 
Cartoon Februari 2010 Linked In
Cartoon Februari 2010 Linked InCartoon Februari 2010 Linked In
Cartoon Februari 2010 Linked In
 
Urai Slideshare
Urai SlideshareUrai Slideshare
Urai Slideshare
 
Mentefacto De Poder
Mentefacto De PoderMentefacto De Poder
Mentefacto De Poder
 
Binary Trees
Binary TreesBinary Trees
Binary Trees
 
A logica dos_caes
A logica dos_caesA logica dos_caes
A logica dos_caes
 
Battle Code
Battle CodeBattle Code
Battle Code
 
Tercer sector
Tercer sectorTercer sector
Tercer sector
 
Tablas de contingencia
Tablas de contingenciaTablas de contingencia
Tablas de contingencia
 

Similar to Puppet barcampexercises.jzt

Puppet HackDay/BarCamp New Delhi Exercises
Puppet HackDay/BarCamp New Delhi ExercisesPuppet HackDay/BarCamp New Delhi Exercises
Puppet HackDay/BarCamp New Delhi Exercises
Julie Tsai
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and AgentRanjit Avasarala
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with Puppet
Alessandro Franceschi
 
Tame your Infrastructure with Puppet
Tame your Infrastructure with PuppetTame your Infrastructure with Puppet
Tame your Infrastructure with Puppet
delimiter
 
Puppet
PuppetPuppet
Puppet Troubleshooting
Puppet TroubleshootingPuppet Troubleshooting
Puppet TroubleshootingPuppet
 
Troubleshooting Puppet
Troubleshooting PuppetTroubleshooting Puppet
Troubleshooting Puppet
Thomas Howard Uphill
 
Puppi. Puppet strings to the shell
Puppi. Puppet strings to the shellPuppi. Puppet strings to the shell
Puppi. Puppet strings to the shell
Alessandro 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
 
A Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conferenceA Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conferenceohadlevy
 
Puppet slides for intelligrape
Puppet slides for intelligrapePuppet slides for intelligrape
Puppet slides for intelligrape
Sharad Aggarwal
 
Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013
Puppet
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
Jos Boumans
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
OlinData
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
Walter Heck
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
lutter
 
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
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with PuppetOlinData
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
Larry Cai
 

Similar to Puppet barcampexercises.jzt (20)

Puppet HackDay/BarCamp New Delhi Exercises
Puppet HackDay/BarCamp New Delhi ExercisesPuppet HackDay/BarCamp New Delhi Exercises
Puppet HackDay/BarCamp New Delhi Exercises
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and Agent
 
Puppet quick start guide
Puppet quick start guidePuppet quick start guide
Puppet quick start guide
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with Puppet
 
Tame your Infrastructure with Puppet
Tame your Infrastructure with PuppetTame your Infrastructure with Puppet
Tame your Infrastructure with Puppet
 
Puppet
PuppetPuppet
Puppet
 
Puppet Troubleshooting
Puppet TroubleshootingPuppet Troubleshooting
Puppet Troubleshooting
 
Troubleshooting Puppet
Troubleshooting PuppetTroubleshooting Puppet
Troubleshooting Puppet
 
Puppi. Puppet strings to the shell
Puppi. Puppet strings to the shellPuppi. Puppet strings to the shell
Puppi. Puppet strings to the shell
 
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
 
A Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conferenceA Presentation about Puppet that I've made at the OSSPAC conference
A Presentation about Puppet that I've made at the OSSPAC conference
 
Puppet slides for intelligrape
Puppet slides for intelligrapePuppet slides for intelligrape
Puppet slides for intelligrape
 
Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker 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
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with Puppet
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 

More from som_nangia

Testspeakernotes 090715053843 Phpapp02
Testspeakernotes 090715053843 Phpapp02Testspeakernotes 090715053843 Phpapp02
Testspeakernotes 090715053843 Phpapp02som_nangia
 
How Stupid Can We Get
How Stupid Can We GetHow Stupid Can We Get
How Stupid Can We Getsom_nangia
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpmsom_nangia
 
Audio one_in_each_slide
Audio one_in_each_slideAudio one_in_each_slide
Audio one_in_each_slidesom_nangia
 
Animation test_notes
Animation test_notesAnimation test_notes
Animation test_notessom_nangia
 
Animation test
Animation testAnimation test
Animation testsom_nangia
 
Animation test
Animation testAnimation test
Animation testsom_nangia
 
Futureoftheinternetciscocarriergradeipv6solutioncgv6 091110191821 Phpapp01
Futureoftheinternetciscocarriergradeipv6solutioncgv6 091110191821 Phpapp01Futureoftheinternetciscocarriergradeipv6solutioncgv6 091110191821 Phpapp01
Futureoftheinternetciscocarriergradeipv6solutioncgv6 091110191821 Phpapp01som_nangia
 
Pwnotes 1234179558850871-1
Pwnotes 1234179558850871-1Pwnotes 1234179558850871-1
Pwnotes 1234179558850871-1som_nangia
 
Animation test
Animation testAnimation test
Animation testsom_nangia
 

More from som_nangia (20)

Linktest
LinktestLinktest
Linktest
 
Escape Test
Escape TestEscape Test
Escape Test
 
Escape Test
Escape TestEscape Test
Escape Test
 
Escape Test
Escape TestEscape Test
Escape Test
 
Escape Test
Escape TestEscape Test
Escape Test
 
Escape Test
Escape TestEscape Test
Escape Test
 
Escape Test
Escape TestEscape Test
Escape Test
 
Escape Test
Escape TestEscape Test
Escape Test
 
Escape Test
Escape TestEscape Test
Escape Test
 
Escape Test
Escape TestEscape Test
Escape Test
 
Testspeakernotes 090715053843 Phpapp02
Testspeakernotes 090715053843 Phpapp02Testspeakernotes 090715053843 Phpapp02
Testspeakernotes 090715053843 Phpapp02
 
How Stupid Can We Get
How Stupid Can We GetHow Stupid Can We Get
How Stupid Can We Get
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
 
Audio one_in_each_slide
Audio one_in_each_slideAudio one_in_each_slide
Audio one_in_each_slide
 
Animation test_notes
Animation test_notesAnimation test_notes
Animation test_notes
 
Animation test
Animation testAnimation test
Animation test
 
Animation test
Animation testAnimation test
Animation test
 
Futureoftheinternetciscocarriergradeipv6solutioncgv6 091110191821 Phpapp01
Futureoftheinternetciscocarriergradeipv6solutioncgv6 091110191821 Phpapp01Futureoftheinternetciscocarriergradeipv6solutioncgv6 091110191821 Phpapp01
Futureoftheinternetciscocarriergradeipv6solutioncgv6 091110191821 Phpapp01
 
Pwnotes 1234179558850871-1
Pwnotes 1234179558850871-1Pwnotes 1234179558850871-1
Pwnotes 1234179558850871-1
 
Animation test
Animation testAnimation test
Animation test
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
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
 
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
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
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
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
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
 
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
 
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
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
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
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
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
 
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 !
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
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
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
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...
 
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
 
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
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
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...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 

Puppet barcampexercises.jzt

  • 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 PuppetingSudoers I — Permissions PuppetingSudoers II — OS Conditions PuppetingSudoers 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. PuppetingSudoers I — Permissions Configure /etc/puppet/manifests/sudoers.pp : file { "/etc/sudoers": owner => root, group => wheel, mode => 400, } 11 And run: [puppet@puppet manifests]# puppet –noop –d /etc/puppet/manifests/sudoers.pp
  • 12. PuppetingSudoers 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. PuppetingSudoers 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. PuppetingSudoers III — Inheriting Class (cont.) /etc/puppet/manifests/sudoers3.pp node default { include unix } node bastionhost { include centos_mycompany } 14 And run: [puppet@puppet manifests]# puppet –d –noop sudoers3.pp [puppet@puppet manifests]# cat /var/lib/puppet/classes.txt
  • 15. PuppetingSudoers III — Inheriting Class (cont. 2) Use Facter to defindnodename: [puppet@puppet manifests]# facter | egrep -i 'fqdn|hostname’ 15 /etc/puppet/manifests/sudoers3.pp node'puppet.us-west-1.compute.internal' { include centos_mycompany }
  • 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 Guideshttp://docs.reductivelabs.com/guides/ Glossary of Terms http://reductivelabs.com/trac/puppet/wiki/GlossaryOfTerms Resource Attributeshttp://reductivelabs.com/trac/puppet/wiki/TypeReference#metaparameters Nice vimrc for Puppethttp://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

Editor's Notes

  1. Instructs to participants to test--&gt; puppet -dsite.pp--&gt; optional -l $LOG + other window with tail of log--&gt; puppet --noop -dsite.pp --&gt; pgrep -lf puppetd (default incremen is 30 min)--&gt; pgrep -lf puppetmasterd
  2. 1) puppet --noopsudoers.pp2) puppet -dsudoers.pp* This faulty centos mode corrected by next exercise – this config actually changes file to faulty settings on purpose
  3. 1) demonstrate conditionals per OS &lt;&quot;puppet -d --noop sudoers2.pp&quot;&gt; 2) service, operations on resource &lt;&quot;puppet -d sudoers2.pp&quot;&gt;
  4. &lt;run site.pp to have something to change again&gt;  (c) 1) class w/ file &amp; service resources 2) inheritance &lt;run once in non-func. mode&gt; - to demo that nothing gets executed without resource instantiation, etc.
  5. 3)idefault &amp; bastionhost node instance 4) bastionhost node instance &lt;run once in non-func. mode&gt; - to demo what it meands for node to belong to a certain class 5) cat /var/lib/puppet/classes.txt (loaded by puppetd)
  6. 6)facter | egrep -i &apos;fqdn|hostname&apos; 7) specific node &apos;hostname&apos; &lt;run once in non-func. mode&gt; &lt;run once in func. mode&gt;Done
  7. !