Writing and Sharing Great Modules on the Puppet Forge

  • 5,282 views
Uploaded on

Ryan Coleman, Puppet Forge product owner at Puppet Labs, talks about modules at Puppet Camp SF. Download puppet modules on the Puppet Forge: https://forge.puppetlabs.com/

Ryan Coleman, Puppet Forge product owner at Puppet Labs, talks about modules at Puppet Camp SF. Download puppet modules on the Puppet Forge: https://forge.puppetlabs.com/

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
5,282
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
23
Comments
0
Likes
4

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Writing and Sharing Great Modules with the Puppet Forge @ryanycoleman - Product Owner - Puppet ForgeTuesday, April 9, 13
  • 2. About Me#PuppetCampTuesday, April 9, 13Ryan was a RedHat sysadmin for Penn State before joining Puppet Labsas a professional services engineer. Now is product owner for the Forge.
  • 3. #PuppetCampTuesday, April 9, 13The Puppet Forge is a community driven web service for contributing and finding Puppetmodules.
  • 4. #PuppetCampTuesday, April 9, 13The following are examples of what you will find on the Forge.
  • 5. #PuppetCampTuesday, April 9, 13
  • 6. Tuesday, April 9, 13
  • 7. Tuesday, April 9, 13
  • 8. Tuesday, April 9, 13
  • 9. Tuesday, April 9, 13
  • 10. Tuesday, April 9, 13
  • 11. Tuesday, April 9, 13
  • 12. Tuesday, April 9, 13
  • 13. Tuesday, April 9, 13
  • 14. Tuesday, April 9, 13
  • 15. Tuesday, April 9, 13
  • 16. Forge Module Count 4000 3000 2000 1000 0 End Q3 End Q4 ~End Q1 ~End Q2 ~End Q3 ~End Q4#PuppetCampTuesday, April 9, 13
  • 17. #PuppetCampTuesday, April 9, 13
  • 18. #PuppetCampTuesday, April 9, 13
  • 19. #PuppetCampTuesday, April 9, 13
  • 20. Best Good Practices#PuppetCampTuesday, April 9, 13
  • 21. PL Style Guide#PuppetCampTuesday, April 9, 13
  • 22. #PuppetCampTuesday, April 9, 13
  • 23. #PuppetCampTuesday, April 9, 13
  • 24. #PuppetCampTuesday, April 9, 13
  • 25. #PuppetCampTuesday, April 9, 13
  • 26. Code VS Data#PuppetCampTuesday, April 9, 13As you get further along with your Puppet Deployments, separating your code (puppetresources) from the data (what package, what version) becomes increasingly important.
  • 27. Tuesday, April 9, 13Imagine that you’re doing a research project in the library.
  • 28. Tuesday, April 9, 13You’ve got some books that help accomplish your goal.
  • 29. Separate Code From DataTuesday, April 9, 13But you don’t write in those books. You keep your notes -- your data -- separate.
  • 30. Tuesday, April 9, 13
  • 31. Tuesday, April 9, 13So where do you express your data and how does Puppet find it?
  • 32. Automatic Data Lookup Built into Puppet 3Tuesday, April 9, 13
  • 33. Tuesday, April 9, 13The answer, use Hiera!Seriously, these docs rock. Read them. http://docs.puppetlabs.com/hiera/1/index.html
  • 34. It’s MAGIC But also, it’s not...#PuppetCampTuesday, April 9, 13But first, let’s take a closer look at a Puppet run.
  • 35. Tuesday, April 9, 13
  • 36. Tuesday, April 9, 13
  • 37. Hello! I’m James_Bond running the RedHat license to kill downtime.Tuesday, April 9, 13
  • 38. Good to know! Hmm, what does James_Bond need to enforce?.Tuesday, April 9, 13
  • 39. James_Bond? Enforce External Node Forge Classifier OK, what do I need for Forge? Modules Modules Modules ModulesTuesday, April 9, 13
  • 40. forge::package? Data Bindings Hiera Hiearchy Backends $clientcert $operatingsystem JSON YAML MySQL Foreman commonTuesday, April 9, 13The Puppet Master needs forge::package. To get this data...- It consults its data bindings terminus (abstraction for looking up data)- Default lookup to Hiera (key/value store for data)- Hiera consults its back-end data stores (defaults to yaml)- Hiera returns result of lookup to master (key/value or could not find)
  • 41. forge::package? Data Bindings It’s screen! Hiera Hiearchy Backends $clientcert $operatingsystem JSON YAML MySQL Redis commonTuesday, April 9, 13The Puppet Master needs forge::package. To get this data...- It consults its data bindings terminus (abstraction for looking up data)- Default lookup to Hiera (key/value store for data)- Hiera consults its back-end data stores (defaults to yaml)- Hiera returns result of lookup to master (key/value or could not find)
  • 42. ? $forge::package Hiearchy $clientcert $james_bond $operatingsystem $RedHat common commonTuesday, April 9, 13Hiera will examine the lookup order of its data backends and its lookup hierarchy. If youspecified a variable lookup in your hierarchy, Hiera will use available facts when choosing thebackend file to lookup.
  • 43. Expressing the configuration of hiera data backends and lookup hierarchyTuesday, April 9, 13Hiera lets you express data in some structured format (which is pluggable).You then establish a hierarchy of lookup, however you like, usually based on facts.
  • 44. Ok, so how do I use it with my Puppet classes?#PuppetCampTuesday, April 9, 13Thankfully, Puppet 3 has made implementing Hiera really simple.
  • 45. In the early days...Tuesday, April 9, 13Please don’t use the hiera() function. Consider it legacy.
  • 46. In the early days...Tuesday, April 9, 13This is better, as the user can override this default parameter value.With this, you’re locked into hiera.
  • 47. Here’s the magic!Tuesday, April 9, 13But really, just get yourself onto Puppet 3 and take advantage of automatic Hiera!
  • 48. Data Lookup Order • Use explicit class declaration values • Query Data Binding • Use the default value from class. • Fail compilation with an error if no value can be found.Tuesday, April 9, 13This slide could be more visual vs text-based
  • 49. Data Bindings don’t lock yourself in#PuppetCampTuesday, April 9, 13Additionally, protect yourself from a potential loss of Hiera.
  • 50. Built into Puppet 3Tuesday, April 9, 13data_bindings were implemented to be an abstraction for data lookup, defaulting to hiera fornow
  • 51. Tuesday, April 9, 13There’s already an alternative out there, for consulting foreman as your data backend
  • 52. Tuesday, April 9, 13But really, just get yourself onto Puppet 3 and take advantage of automatic Hiera!
  • 53. Tuesday, April 9, 13Hiera backends are pluggable too. Here are two examples.
  • 54. Tuesday, April 9, 13
  • 55. Best Practices • Confirm to the Style Guide • Use Parameterized Classes • Don’t use hiera() directly#PuppetCampTuesday, April 9, 13Re-cap.
  • 56. The TeamTuesday, April 9, 13
  • 57. What have we been up to? • Re-launch and Re-designTuesday, April 9, 13Though we’re small, we’ve been really busy!
  • 58. Tuesday, April 9, 13
  • 59. Tuesday, April 9, 13Lots of little features add up to a substantially nicer to use Forge.
  • 60. Tuesday, April 9, 13Download counts, now in your search results!
  • 61. GitHub-based Module Publish ryan@puppetlabs.comTuesday, April 9, 13Edit your Modulefile, push your commit and we’ll do the publishing! Coming soon to arepository near you.
  • 62. What’s Next? A Full & Public APITuesday, April 9, 13Also coming soon, an actual API for doing all sorts of things with the Forge.
  • 63. What’s Next?Tuesday, April 9, 13Just an experimental mock-up of search results. Actual feature will absolutely look andbehave differently.
  • 64. On-Premise Forge?Tuesday, April 9, 13Private Forge has been a common request. The requests I get are two-fold.A) How can I install public Forge content on a master that can’t reach the outside.B) How can I contribute company-specific content to a Forge-like thing inside my firewall
  • 65. On-Premise Forge?Tuesday, April 9, 13Private Forge has been a common request. The requests I get are two-fold.A) How can I install public Forge content on a master that can’t reach the outside.B) How can I contribute company-specific content to a Forge-like thing inside my firewall
  • 66. On-Premise Forge?Tuesday, April 9, 13Private Forge has been a common request. The requests I get are two-fold.A) How can I install public Forge content on a master that can’t reach the outside.B) How can I contribute company-specific content to a Forge-like thing inside my firewall
  • 67. On-Premise Forge?Tuesday, April 9, 13Private Forge has been a common request. The requests I get are two-fold.A) How can I install public Forge content on a master that can’t reach the outside.B) How can I contribute company-specific content to a Forge-like thing inside my firewall
  • 68. On-Premise Forge?Tuesday, April 9, 13Private Forge has been a common request. The requests I get are two-fold.A) How can I install public Forge content on a master that can’t reach the outside.B) How can I contribute company-specific content to a Forge-like thing inside my firewall
  • 69. On-Premise Forge?Tuesday, April 9, 13Private Forge has been a common request. The requests I get are two-fold.A) How can I install public Forge content on a master that can’t reach the outside.B) How can I contribute company-specific content to a Forge-like thing inside my firewall
  • 70. PulpProject.orgTuesday, April 9, 13RedHat’s Pulp Project is repository management software that recently added support forPuppet Modules.
  • 71. • Manage Modules on-premise • Mirror Public Forge • BUT, please work with me on this • Email me or comment on #5033 • ryan@puppetlabs.comTuesday, April 9, 13If you’re interested in this, email ryan@puppetlabs.com or add your thoughts to https://projects.puppetlabs.com/issues/5033.We’re going to do something in this space, but want to hear more from you on what youneed.
  • 72. Want to help?#PuppetCampTuesday, April 9, 13If you want to add your influence to our products, join the Puppet Labs Test Pilots program!https://puppetlabs.com/community/puppet-test-pilots-program/
  • 73. • Sharpen your skills • Get Certified • Online learning on the way • puppetlabs.com/education#PuppetCampTuesday, April 9, 13Our education courses are carefully crafted and delivered by our fabulous education teamand professional services team.Advanced course coming to LA 3/19Browse upcoming events at http://puppetlabs.eventbrite.com/
  • 74. Tuesday, April 9, 13
  • 75. Thank You! Please email (or tweet) feedback and questions ryan@puppetlabs.com - @ryanycoleman forge.puppetlabs.com puppetlabs.com/jobs#PuppetCampTuesday, April 9, 13Seriously, join our team. It’ll be awesome.