SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Introduction to Puppet
Scripting




Shawn S. Smiley
Lead Architect
Achieve Internet
shawn.smiley@achieveinternet.com
What is puppet?

                  “Puppet is IT automation software
                  that helps system administrators
                  manage infrastructure throughout its
                  lifecycle, from provisioning and
                  configuration to patch management
                  and compliance.”




Source: www.puppetlabs.com/puppet/what-is-puppet
What does that mean?

                                       • You can setup a new server in
                                         minutes vs. hours!
                                       • You can be sure your server
                                         configurations are consistent.
                                       • You can easily deploy
                                         configuration changes to
                                         multiple servers.




Image Source: http://www.forbes.com/sites/kenkrogue/2012/09/07/the-most-important-interview-question-never-asked/
Quick Demo




Image source: http://gyaniji.blogspot.com/2011/12/demo-of-ad-posting-job.html
What happened?

• Puppet analyzed the scripts to build a picture of what the
  server should look like.
• Puppet then compared that to what the server actually
  looks like.
• It then generates and executes scripts to make the server
  configuration match that in the puppet scripts.
How vs. What

• Why is it better to describe what a system looks like
  rather than how to configure a system?
• When you describe what a system looks like, you can
  repeatedly rerun the process without fear of breaking the
  system.
• Can build platform independent scripts.
What are the pieces?

•   Puppet Software
•   Module Library
•   Node configuration file
•   [optional] Puppet Master
Modules

What are they?
• Self-contained packages that describe an aspect of a
  system (e.g. “Apache” or “MySQL”)

Are there existing packages I can leverage?
• http://forge.puppetlabs.com
• http://github.com

Where do I put them?
• /usr/share/puppet/modules
• /etc/puppet/modules
File Organization

• manifests
      • site.pp
      • nodes.pp
• modules
      • module1
       • manifests
             init.pp
       • files
       • templates
      • module2
Demo: Folder Structure




Image source: http://gyaniji.blogspot.com/2011/12/demo-of-ad-posting-job.html
Basic Syntax

• Follows basic Ruby language syntax.
• Does not fully implement the Ruby language though, only
  a subset is allowed in your puppet files.
To define an item:                To execute an item:
type title($arg1) {               include “title”
  description of resource state
}                                 type {“title”: }

                                  type {“title”:
                                    arg1 => ‘hello’
                                   }
Demo: Simple script




Image source: http://gyaniji.blogspot.com/2011/12/demo-of-ad-posting-job.html
Resource Types

• Are puppet libraries that are used to interact with the
  system.
• Puppet comes with a wide range of resource types:
       •   exec
       •   package
       •   file
       •   service
       •   notify
Full list:
http://docs.puppetlabs.com/references/latest/type.html
Facter

What are facts?
• Global variables with information about the system that
  the script is running on.

How do I see the available variables?
• facter -p

How do I use them?
• $::variable_name
Templates

• Templates are files that use a simple markup language to
  insert dynamic values.
• Templates have an .erb extension
• Typically used with the File resource. e.g.:

   file {'ntp.conf':
     path => '/etc/ntp.conf',
     ensure => file,
     content => template('ntp/ntp.conf.erb'),
     owner => root,
     mode => 0644,
   }
Relationships

• Package[“ntp”] -> File[„ntp.conf‟] ~> Service[„ntpd‟]
• “before”, “require”
• “subscribe”, “notify”



http://docs.puppetlabs.com/puppet/2.7/reference/lang_relati
onships.html#relationship-metaparameters

http://docs.puppetlabs.com/puppet/2.7/reference/lang_relati
onships.html#chaining-arrows
User-Defined Types

• Similar to functions in most languages.
• Only way to do iterations currently.
         • Call the Type with an array.


 define apache::vhost() {
   $docroot = “/var/www/${name}”
 }

 $sites = [‘site1’, ‘site2’]
 apache::vhost {$sites: }
References

Books
• Managing Infrastructure with Puppet
  (ISBN: 978-1-4493-0763-9)
• Pro Puppet (ISBN: 978-1-4302-3057-1)

Websites
• http://www.puppetlabs.com
• http://docs.puppetlabs.com/
• http://forge.puppetlabs.com/
Q&A

Weitere ähnliche Inhalte

Was ist angesagt?

Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Keith Resar
 
Learn you some Ansible for great good!
Learn you some Ansible for great good!Learn you some Ansible for great good!
Learn you some Ansible for great good!David Lapsley
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleArnaud LEMAIRE
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabricandymccurdy
 
Using Puppet - Real World Configuration Management
Using Puppet - Real World Configuration ManagementUsing Puppet - Real World Configuration Management
Using Puppet - Real World Configuration ManagementJames Turnbull
 
Learn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMLearn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMKumaran Balachandran
 
Using Puppet in Small Infrastructures
Using Puppet in Small InfrastructuresUsing Puppet in Small Infrastructures
Using Puppet in Small InfrastructuresRachel Andrew
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with AnsibleIvan Serdyuk
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Richard Donkin
 
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPortland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPuppet
 
Augeas, swiss knife resources for your puppet tree
Augeas, swiss knife resources for your puppet treeAugeas, swiss knife resources for your puppet tree
Augeas, swiss knife resources for your puppet treeJulien Pivotto
 
De-centralise and Conquer: Masterless Puppet in a Dynamic Environment
De-centralise and Conquer: Masterless Puppet in a Dynamic EnvironmentDe-centralise and Conquer: Masterless Puppet in a Dynamic Environment
De-centralise and Conquer: Masterless Puppet in a Dynamic EnvironmentPuppet
 
Puppet Development Workflow
Puppet Development WorkflowPuppet Development Workflow
Puppet Development WorkflowJeffery Smith
 
Superb Supervision of Short-lived Servers with Sensu
Superb Supervision of Short-lived Servers with SensuSuperb Supervision of Short-lived Servers with Sensu
Superb Supervision of Short-lived Servers with SensuPaul O'Connor
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with AnsibleMartin Etmajer
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansiblewajrcs
 

Was ist angesagt? (20)

Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
 
Learn you some Ansible for great good!
Learn you some Ansible for great good!Learn you some Ansible for great good!
Learn you some Ansible for great good!
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & Ansible
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
Using Puppet - Real World Configuration Management
Using Puppet - Real World Configuration ManagementUsing Puppet - Real World Configuration Management
Using Puppet - Real World Configuration Management
 
Learn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VMLearn Puppet : Quest Guide for the Learning VM
Learn Puppet : Quest Guide for the Learning VM
 
Ansible intro
Ansible introAnsible intro
Ansible intro
 
Using Puppet in Small Infrastructures
Using Puppet in Small InfrastructuresUsing Puppet in Small Infrastructures
Using Puppet in Small Infrastructures
 
Ansible Case Studies
Ansible Case StudiesAnsible Case Studies
Ansible Case Studies
 
Getting started with Ansible
Getting started with AnsibleGetting started with Ansible
Getting started with Ansible
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)
 
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPortland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
 
Ansible
AnsibleAnsible
Ansible
 
Augeas, swiss knife resources for your puppet tree
Augeas, swiss knife resources for your puppet treeAugeas, swiss knife resources for your puppet tree
Augeas, swiss knife resources for your puppet tree
 
Network automation (NetDevOps) with Ansible
Network automation (NetDevOps) with AnsibleNetwork automation (NetDevOps) with Ansible
Network automation (NetDevOps) with Ansible
 
De-centralise and Conquer: Masterless Puppet in a Dynamic Environment
De-centralise and Conquer: Masterless Puppet in a Dynamic EnvironmentDe-centralise and Conquer: Masterless Puppet in a Dynamic Environment
De-centralise and Conquer: Masterless Puppet in a Dynamic Environment
 
Puppet Development Workflow
Puppet Development WorkflowPuppet Development Workflow
Puppet Development Workflow
 
Superb Supervision of Short-lived Servers with Sensu
Superb Supervision of Short-lived Servers with SensuSuperb Supervision of Short-lived Servers with Sensu
Superb Supervision of Short-lived Servers with Sensu
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansible
 

Andere mochten auch

Improving Operations Efficiency with Puppet
Improving Operations Efficiency with PuppetImproving Operations Efficiency with Puppet
Improving Operations Efficiency with PuppetNicolas Brousse
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetMichael Lessard
 
Demystifying TLS
Demystifying TLSDemystifying TLS
Demystifying TLSPuppet
 
Introduction to Puppet Enterprise
Introduction to Puppet EnterpriseIntroduction to Puppet Enterprise
Introduction to Puppet EnterprisePuppet
 
College fest anchoring script
College fest anchoring scriptCollege fest anchoring script
College fest anchoring scriptLata A G
 

Andere mochten auch (8)

The importance of puppets
The importance of puppetsThe importance of puppets
The importance of puppets
 
Improving Operations Efficiency with Puppet
Improving Operations Efficiency with PuppetImproving Operations Efficiency with Puppet
Improving Operations Efficiency with Puppet
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with Puppet
 
Introduction to Puppetry
Introduction to PuppetryIntroduction to Puppetry
Introduction to Puppetry
 
Demystifying TLS
Demystifying TLSDemystifying TLS
Demystifying TLS
 
Puppets ppt
Puppets pptPuppets ppt
Puppets ppt
 
Introduction to Puppet Enterprise
Introduction to Puppet EnterpriseIntroduction to Puppet Enterprise
Introduction to Puppet Enterprise
 
College fest anchoring script
College fest anchoring scriptCollege fest anchoring script
College fest anchoring script
 

Ähnlich wie Introduction to Puppet Scripting

Ansible top 10 - 2018
Ansible top 10 -  2018Ansible top 10 -  2018
Ansible top 10 - 2018Viresh Doshi
 
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesLarge-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesHiroshi SHIBATA
 
Puppet talk at OSCON 2010.
Puppet talk at OSCON 2010.Puppet talk at OSCON 2010.
Puppet talk at OSCON 2010.teyotyree
 
DCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production ParityDCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production ParityGeoff Harcourt
 
Portable infrastructure with puppet
Portable infrastructure with puppetPortable infrastructure with puppet
Portable infrastructure with puppetlkanies
 
Ansible: What, Why & How
Ansible: What, Why & HowAnsible: What, Why & How
Ansible: What, Why & HowAlfonso Cabrera
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...Gaetano Giunta
 
Puppet Keynote by Ralph Luchs
Puppet Keynote by Ralph LuchsPuppet Keynote by Ralph Luchs
Puppet Keynote by Ralph LuchsNETWAYS
 
Puppet & Perforce: Versioning Everything for Deployments
Puppet & Perforce: Versioning Everything for DeploymentsPuppet & Perforce: Versioning Everything for Deployments
Puppet & Perforce: Versioning Everything for DeploymentsPerforce
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentationlalitjangra9
 
Habitat Overview
Habitat OverviewHabitat Overview
Habitat OverviewMandi Walls
 
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Puppet
 
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014Miguel Zuniga
 
Top 10 dev ops tools (1)
Top 10 dev ops tools (1)Top 10 dev ops tools (1)
Top 10 dev ops tools (1)yalini97
 
State of Puppet 2013 - Puppet Camp DC
State of Puppet 2013 - Puppet Camp DCState of Puppet 2013 - Puppet Camp DC
State of Puppet 2013 - Puppet Camp DCPuppet
 
Ninja, Choose Your Weapon!
Ninja, Choose Your Weapon!Ninja, Choose Your Weapon!
Ninja, Choose Your Weapon!Anton Weiss
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Michael Lihs
 
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...garrett honeycutt
 

Ähnlich wie Introduction to Puppet Scripting (20)

Ansible top 10 - 2018
Ansible top 10 -  2018Ansible top 10 -  2018
Ansible top 10 - 2018
 
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesLarge-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 Minutes
 
Puppet talk at OSCON 2010.
Puppet talk at OSCON 2010.Puppet talk at OSCON 2010.
Puppet talk at OSCON 2010.
 
DCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production ParityDCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production Parity
 
Portable infrastructure with puppet
Portable infrastructure with puppetPortable infrastructure with puppet
Portable infrastructure with puppet
 
Ansible: What, Why & How
Ansible: What, Why & HowAnsible: What, Why & How
Ansible: What, Why & How
 
Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
 
Devops
DevopsDevops
Devops
 
Puppet Keynote by Ralph Luchs
Puppet Keynote by Ralph LuchsPuppet Keynote by Ralph Luchs
Puppet Keynote by Ralph Luchs
 
Puppet & Perforce: Versioning Everything for Deployments
Puppet & Perforce: Versioning Everything for DeploymentsPuppet & Perforce: Versioning Everything for Deployments
Puppet & Perforce: Versioning Everything for Deployments
 
PowerPoint Presentation
PowerPoint PresentationPowerPoint Presentation
PowerPoint Presentation
 
Habitat Overview
Habitat OverviewHabitat Overview
Habitat Overview
 
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
 
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
 
Top 10 dev ops tools (1)
Top 10 dev ops tools (1)Top 10 dev ops tools (1)
Top 10 dev ops tools (1)
 
State of Puppet 2013 - Puppet Camp DC
State of Puppet 2013 - Puppet Camp DCState of Puppet 2013 - Puppet Camp DC
State of Puppet 2013 - Puppet Camp DC
 
Ninja, Choose Your Weapon!
Ninja, Choose Your Weapon!Ninja, Choose Your Weapon!
Ninja, Choose Your Weapon!
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
 

Mehr von Achieve Internet

Planning & Executing Custom Drupal Integration Projects
Planning & Executing Custom Drupal Integration ProjectsPlanning & Executing Custom Drupal Integration Projects
Planning & Executing Custom Drupal Integration ProjectsAchieve Internet
 
Communicating Drupal: Documentation and Discovery
Communicating Drupal: Documentation and DiscoveryCommunicating Drupal: Documentation and Discovery
Communicating Drupal: Documentation and DiscoveryAchieve Internet
 
Advancing Healthcare Technology with Open Source Software
Advancing Healthcare Technology with Open Source SoftwareAdvancing Healthcare Technology with Open Source Software
Advancing Healthcare Technology with Open Source SoftwareAchieve Internet
 
Showcasing Human Capital: How to Effectively Market a Professional Services Firm
Showcasing Human Capital: How to Effectively Market a Professional Services FirmShowcasing Human Capital: How to Effectively Market a Professional Services Firm
Showcasing Human Capital: How to Effectively Market a Professional Services FirmAchieve Internet
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetAchieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetAchieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetAchieve Internet
 
Drupal secure code checklist
Drupal secure code checklistDrupal secure code checklist
Drupal secure code checklistAchieve Internet
 
Helping the LatinGRAMMYs Reach a Global Audience
Helping the LatinGRAMMYs Reach a Global Audience Helping the LatinGRAMMYs Reach a Global Audience
Helping the LatinGRAMMYs Reach a Global Audience Achieve Internet
 
Drupal and the Future of Healthcare
Drupal and the Future of HealthcareDrupal and the Future of Healthcare
Drupal and the Future of HealthcareAchieve Internet
 
Responsive Web Design_2013
Responsive Web Design_2013Responsive Web Design_2013
Responsive Web Design_2013Achieve Internet
 

Mehr von Achieve Internet (11)

Planning & Executing Custom Drupal Integration Projects
Planning & Executing Custom Drupal Integration ProjectsPlanning & Executing Custom Drupal Integration Projects
Planning & Executing Custom Drupal Integration Projects
 
Communicating Drupal: Documentation and Discovery
Communicating Drupal: Documentation and DiscoveryCommunicating Drupal: Documentation and Discovery
Communicating Drupal: Documentation and Discovery
 
Advancing Healthcare Technology with Open Source Software
Advancing Healthcare Technology with Open Source SoftwareAdvancing Healthcare Technology with Open Source Software
Advancing Healthcare Technology with Open Source Software
 
Showcasing Human Capital: How to Effectively Market a Professional Services Firm
Showcasing Human Capital: How to Effectively Market a Professional Services FirmShowcasing Human Capital: How to Effectively Market a Professional Services Firm
Showcasing Human Capital: How to Effectively Market a Professional Services Firm
 
Harmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and PuppetHarmonious Development: Via Vagrant and Puppet
Harmonious Development: Via Vagrant and Puppet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Drupal secure code checklist
Drupal secure code checklistDrupal secure code checklist
Drupal secure code checklist
 
Helping the LatinGRAMMYs Reach a Global Audience
Helping the LatinGRAMMYs Reach a Global Audience Helping the LatinGRAMMYs Reach a Global Audience
Helping the LatinGRAMMYs Reach a Global Audience
 
Drupal and the Future of Healthcare
Drupal and the Future of HealthcareDrupal and the Future of Healthcare
Drupal and the Future of Healthcare
 
Responsive Web Design_2013
Responsive Web Design_2013Responsive Web Design_2013
Responsive Web Design_2013
 

Kürzlich hochgeladen

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Kürzlich hochgeladen (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Introduction to Puppet Scripting

  • 1. Introduction to Puppet Scripting Shawn S. Smiley Lead Architect Achieve Internet shawn.smiley@achieveinternet.com
  • 2. What is puppet? “Puppet is IT automation software that helps system administrators manage infrastructure throughout its lifecycle, from provisioning and configuration to patch management and compliance.” Source: www.puppetlabs.com/puppet/what-is-puppet
  • 3. What does that mean? • You can setup a new server in minutes vs. hours! • You can be sure your server configurations are consistent. • You can easily deploy configuration changes to multiple servers. Image Source: http://www.forbes.com/sites/kenkrogue/2012/09/07/the-most-important-interview-question-never-asked/
  • 4. Quick Demo Image source: http://gyaniji.blogspot.com/2011/12/demo-of-ad-posting-job.html
  • 5. What happened? • Puppet analyzed the scripts to build a picture of what the server should look like. • Puppet then compared that to what the server actually looks like. • It then generates and executes scripts to make the server configuration match that in the puppet scripts.
  • 6. How vs. What • Why is it better to describe what a system looks like rather than how to configure a system? • When you describe what a system looks like, you can repeatedly rerun the process without fear of breaking the system. • Can build platform independent scripts.
  • 7. What are the pieces? • Puppet Software • Module Library • Node configuration file • [optional] Puppet Master
  • 8. Modules What are they? • Self-contained packages that describe an aspect of a system (e.g. “Apache” or “MySQL”) Are there existing packages I can leverage? • http://forge.puppetlabs.com • http://github.com Where do I put them? • /usr/share/puppet/modules • /etc/puppet/modules
  • 9. File Organization • manifests • site.pp • nodes.pp • modules • module1 • manifests  init.pp • files • templates • module2
  • 10. Demo: Folder Structure Image source: http://gyaniji.blogspot.com/2011/12/demo-of-ad-posting-job.html
  • 11. Basic Syntax • Follows basic Ruby language syntax. • Does not fully implement the Ruby language though, only a subset is allowed in your puppet files. To define an item: To execute an item: type title($arg1) { include “title” description of resource state } type {“title”: } type {“title”: arg1 => ‘hello’ }
  • 12. Demo: Simple script Image source: http://gyaniji.blogspot.com/2011/12/demo-of-ad-posting-job.html
  • 13. Resource Types • Are puppet libraries that are used to interact with the system. • Puppet comes with a wide range of resource types: • exec • package • file • service • notify Full list: http://docs.puppetlabs.com/references/latest/type.html
  • 14. Facter What are facts? • Global variables with information about the system that the script is running on. How do I see the available variables? • facter -p How do I use them? • $::variable_name
  • 15. Templates • Templates are files that use a simple markup language to insert dynamic values. • Templates have an .erb extension • Typically used with the File resource. e.g.: file {'ntp.conf': path => '/etc/ntp.conf', ensure => file, content => template('ntp/ntp.conf.erb'), owner => root, mode => 0644, }
  • 16. Relationships • Package[“ntp”] -> File[„ntp.conf‟] ~> Service[„ntpd‟] • “before”, “require” • “subscribe”, “notify” http://docs.puppetlabs.com/puppet/2.7/reference/lang_relati onships.html#relationship-metaparameters http://docs.puppetlabs.com/puppet/2.7/reference/lang_relati onships.html#chaining-arrows
  • 17. User-Defined Types • Similar to functions in most languages. • Only way to do iterations currently. • Call the Type with an array. define apache::vhost() { $docroot = “/var/www/${name}” } $sites = [‘site1’, ‘site2’] apache::vhost {$sites: }
  • 18. References Books • Managing Infrastructure with Puppet (ISBN: 978-1-4493-0763-9) • Pro Puppet (ISBN: 978-1-4302-3057-1) Websites • http://www.puppetlabs.com • http://docs.puppetlabs.com/ • http://forge.puppetlabs.com/
  • 19. Q&A

Hinweis der Redaktion

  1. Startup an AWS instance and run puppet apply to show what puppet does.
  2. Default modulepath: /etc/puppet/modules:/usr/share/puppet/modules
  3. Show the File Structure and examples of some modules.
  4. Defining an item is called a “Resource Declaration”
  5. Demo a simple module: The Lynx module.