Hiera in-motion

1,725 views

Published on

Introduction to Hiera and Hiera Data Structures. I presented this as the DevOps Tech In Motion Meetup in San Francisco on 9/26.

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,725
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
22
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Hiera in-motion

  1. 1. Introduction to Hiera & Basic Hiera Data Structures David Kramer, RHCA Sr. DevOps Manager
  2. 2. 2 © Jive confidential Introduction to Hiera Agenda • Quick intro about myself • What is this presentation and what isn’t it? • Overview of Puppet • Overview of Hiera • Overview of Hiera Data Structures • Tying it all together
  3. 3. 3 © Jive confidential Overview of Puppet • What is Puppet? – Should I mention facter? • How do we manage nodes in Puppet? – Every node always gets a node object • Nodes.pp • ENC – Node_terminus • Hiera • Common question Im asked, can you have multiple ENC’s? Yes you can!
  4. 4. 4 © Jive confidential What is Hiera? • Hiera is a Key/Pair lookup tool • Provides an Environment Hierarchy within your data roles • Reduces data repetition – Write data for most scenarios – Allows you to focus on difference data! • Allows you to specify node specific data – Provides Hierarchical Overriding
  5. 5. 5 © Jive confidential Brief Installation Overview of Hiera • Package Info – Hiera Gem – Puppet 2.7.x needs hiera-puppet package installed. – Puppet 3.0+ does not need hiera-puppet, hiera is native! • /etc/puppet/hiera.yaml – Role Hierarchy definitions • Modify your sites.pp to be hiera aware! – classes: - hiera_include('classes') – parameterized_classes: – hiera_hash(‘parameterized_classes’ )
  6. 6. 6 © Jive confidential Walking thru the hiera.yaml • :backends: – Yaml – Json • :datadir: – :yaml /etc/puppet/hieradata • :gpg: – Tired of storing secret information in the clear? • :hierarchy: – %{::clientcert} – roles/%{role}
  7. 7. 7 © Jive confidential Hierarchy for your Environments • Meta Data, Meta Data, Meta Data – Custom Facts using Facter.add • This is all up to you!! • Some Jivin examples: – Data Center – Deployment Environment –Your SDLC! – Roles
  8. 8. 8 © Jive confidential Overview of Hiera Data Structures • Hiera Variable – hiera(‘variable name’,’empty’) • Hiera Array – hiera_array( ‘array name’, ‘empty’) • Hiera Hashes – hiera_hash(‘hash name’, ‘empty’)
  9. 9. 9 © Jive confidential Yaml Data Structure Examples • Yaml Variable: • Yaml Array:
  10. 10. 10 © Jive confidential Yaml Data Structure Examples • Yaml Hash:
  11. 11. 11 © Jive confidential Hooking your Yaml into your Puppet  • Tying all of this together by making your Puppet Class Hiera aware:
  12. 12. 12 © Jive confidential Questions?
  13. 13. 13 © Jive confidential http://docs.puppetlabs. com/hiera/1/index.html http://www.yaml.org/YA ML_for_ruby.html#sim ple_sequence Resources

×