SlideShare a Scribd company logo
1 of 9
Puppet 4 Module Data
Pre-environment & per-module Hiera
Raleigh PUG 3/2017
Jere Julian
Where we were
Single, global hiera.yaml
Incantations to have per-environment hieradata/
Modules relied on params.pp model
Experimental (deprecated) - 2016.1 [4.4]
Puppet $var = hiera() replaced by $var = lookup()
Tiers: Classic Hiera, Environment Data, Module Data
Module Data lookup require module namespace!
New hiera.yaml format: v4
puppet.conf:
environment_data_provider = hiera
Hiera.yaml v4 (deprecated)
# /etc/puppetlabs/code/environments/production/hiera.yaml
---
version: 4
datadir: data
hierarchy:
- name: "Nodes"
backend: yaml
path: "nodes/%{trusted.certname}"
# Putting a JSON level between YAML levels like this was impossible in the old format.
- name: "Exported JSON nodes"
backend: json
paths:
# Puppet checks these in order. Even though this is a single item in the hierarchy,
it acts like multiple hierarchy levels.
- "nodes/%{trusted.certname}"
- "insecure_nodes/%{facts.fqdn}"
- name: "virtual/%{facts.virtual}"
backend: yaml
- name: "common"
backend: yaml
Current Module Data - Hiera 5 - 2017.1 [4.9]
Hiera 5 now included in Puppet
Environment and Module Data
lookup() function and 'puppet lookup' CLI command
hiera_* functions and hiera.yaml v4 deprecated
Layers: Global, Environment, Module
Hiera.yaml v5---
version: 5
defaults: # Used for any hierarchy level that omits these keys.
datadir: data # This path is relative to hiera.yaml's directory.
data_hash: yaml_data # Use the built-in YAML backend.
hierarchy:
- name: "Per-node data" # Human-readable name.
path: "nodes/%{trusted.certname}.yaml" # File path, relative to datadir.
# ^^^ IMPORTANT: include the file extension!
- name: "Per-datacenter business group data" # Uses custom facts.
path: "location/%{facts.whereami}/%{facts.group}.yaml"
- name: "Global business group data"
path: "groups/%{facts.group}.yaml"
- name: "Per-datacenter secret data (encrypted)"
lookup_key: eyaml_lookup_key # Uses non-default backend.
path: "secrets/%{facts.whereami}.eyaml"
options:
pkcs7_private_key: /etc/puppetlabs/puppet/eyaml/private_key.pkcs7.pem
pkcs7_public_key: /etc/puppetlabs/puppet/eyaml/public_key.pkcs7.pem
- name: "Per-OS defaults"
path: "os/%{facts.os.family}.yaml"
- name: "Common data"
path: "common.yaml"
Default hiera.yaml v5
---
version: 5
hierarchy:
- name: Common
path: common.yaml
defaults:
data_hash: yaml_data
datadir: data
Notes & Recommendations
lookup() does NOT merge values. Still use hiera_array & hiera_hash
Hiera_include does an array merge from all levels
Don't use the lookup() function within templates
Lookups within data.yaml:
profile::wordpress::database_server:
"%{lookup('profile::mysql::public_hostname')}"
Alias:
original:
- 'one'
- 'two'
aliased: "%{alias('original')}"
References
Don't use the lookup() function within templates
Hiera v5 syntax
Puppet 4.4 lookup() quick reference
Example Puppet module using hiera module data:
aristanetworks-cloudvision

More Related Content

Similar to Rpug - Puppet 4 Module Data

Using hiera with puppet
Using hiera with puppetUsing hiera with puppet
Using hiera with puppetScott Lackey
 
Puppet Camp Portland 2015: Introduction to Hiera (Beginner)
Puppet Camp Portland 2015: Introduction to Hiera (Beginner)Puppet Camp Portland 2015: Introduction to Hiera (Beginner)
Puppet Camp Portland 2015: Introduction to Hiera (Beginner)Puppet
 
Introduction to Hiera
Introduction to HieraIntroduction to Hiera
Introduction to Hieranibalizer
 
Puppet Camp Amsterdam 2015: How To Leverage The Power of the Puppet Forge
Puppet Camp Amsterdam 2015: How To Leverage The Power of the Puppet ForgePuppet Camp Amsterdam 2015: How To Leverage The Power of the Puppet Forge
Puppet Camp Amsterdam 2015: How To Leverage The Power of the Puppet ForgePuppet
 
Going beyond Code: Driving automation with data via Hiera
Going beyond Code: Driving automation with data via HieraGoing beyond Code: Driving automation with data via Hiera
Going beyond Code: Driving automation with data via HieraOnyxPoint Inc
 
Going beyond Code: Driving automation with data via Hiera
Going beyond Code: Driving automation with data via HieraGoing beyond Code: Driving automation with data via Hiera
Going beyond Code: Driving automation with data via HieraDylan Cochran
 
Solving real world data problems with Jerakia
Solving real world data problems with JerakiaSolving real world data problems with Jerakia
Solving real world data problems with JerakiaCraig Dunn
 
Thinking through puppet code layout
Thinking through puppet code layoutThinking through puppet code layout
Thinking through puppet code layoutTomas Doran
 
Thinking through styling and layout of modules, class and defines by Tom Doran
Thinking through styling and layout of modules, class and defines by Tom DoranThinking through styling and layout of modules, class and defines by Tom Doran
Thinking through styling and layout of modules, class and defines by Tom DoranNETWAYS
 
CfgMgmtCamp 2023 - Puppet is YAML.pdf
CfgMgmtCamp 2023 - Puppet is YAML.pdfCfgMgmtCamp 2023 - Puppet is YAML.pdf
CfgMgmtCamp 2023 - Puppet is YAML.pdfMartin Alfke
 
Getting Hiera and Hiera
Getting Hiera and HieraGetting Hiera and Hiera
Getting Hiera and HieraPuppet
 
Understanding the Data Lookup Pattern
Understanding the Data Lookup PatternUnderstanding the Data Lookup Pattern
Understanding the Data Lookup PatternCraig Dunn
 
Puppet Camp Berlin 2014: Manageable puppet infrastructure
Puppet Camp Berlin 2014: Manageable puppet infrastructurePuppet Camp Berlin 2014: Manageable puppet infrastructure
Puppet Camp Berlin 2014: Manageable puppet infrastructurePuppet
 
Drupal 8 configuration management
Drupal 8 configuration managementDrupal 8 configuration management
Drupal 8 configuration managementAlexander Tkachev
 
Oozie or Easy: Managing Hadoop Workloads the EASY Way
Oozie or Easy: Managing Hadoop Workloads the EASY WayOozie or Easy: Managing Hadoop Workloads the EASY Way
Oozie or Easy: Managing Hadoop Workloads the EASY WayDataWorks Summit
 
CCF #1: Taking the reins of your data with Hiera 5
CCF #1: Taking the reins of your data with Hiera 5CCF #1: Taking the reins of your data with Hiera 5
CCF #1: Taking the reins of your data with Hiera 5davidmogar
 
Manageable Puppet Infrastructure - PuppetConf 2014
Manageable Puppet Infrastructure - PuppetConf 2014Manageable Puppet Infrastructure - PuppetConf 2014
Manageable Puppet Infrastructure - PuppetConf 2014Puppet
 
Puppet atbazaarvoice
Puppet atbazaarvoicePuppet atbazaarvoice
Puppet atbazaarvoiceDave Barcelo
 
Delegated Configuration with Multiple Hiera Databases - PuppetConf 2014
Delegated Configuration with Multiple Hiera Databases - PuppetConf 2014Delegated Configuration with Multiple Hiera Databases - PuppetConf 2014
Delegated Configuration with Multiple Hiera Databases - PuppetConf 2014Puppet
 

Similar to Rpug - Puppet 4 Module Data (20)

Using hiera with puppet
Using hiera with puppetUsing hiera with puppet
Using hiera with puppet
 
Puppet Camp Portland 2015: Introduction to Hiera (Beginner)
Puppet Camp Portland 2015: Introduction to Hiera (Beginner)Puppet Camp Portland 2015: Introduction to Hiera (Beginner)
Puppet Camp Portland 2015: Introduction to Hiera (Beginner)
 
Introduction to Hiera
Introduction to HieraIntroduction to Hiera
Introduction to Hiera
 
Puppet Camp Amsterdam 2015: How To Leverage The Power of the Puppet Forge
Puppet Camp Amsterdam 2015: How To Leverage The Power of the Puppet ForgePuppet Camp Amsterdam 2015: How To Leverage The Power of the Puppet Forge
Puppet Camp Amsterdam 2015: How To Leverage The Power of the Puppet Forge
 
Going beyond Code: Driving automation with data via Hiera
Going beyond Code: Driving automation with data via HieraGoing beyond Code: Driving automation with data via Hiera
Going beyond Code: Driving automation with data via Hiera
 
Going beyond Code: Driving automation with data via Hiera
Going beyond Code: Driving automation with data via HieraGoing beyond Code: Driving automation with data via Hiera
Going beyond Code: Driving automation with data via Hiera
 
Solving real world data problems with Jerakia
Solving real world data problems with JerakiaSolving real world data problems with Jerakia
Solving real world data problems with Jerakia
 
Hiera in-motion
Hiera in-motionHiera in-motion
Hiera in-motion
 
Thinking through puppet code layout
Thinking through puppet code layoutThinking through puppet code layout
Thinking through puppet code layout
 
Thinking through styling and layout of modules, class and defines by Tom Doran
Thinking through styling and layout of modules, class and defines by Tom DoranThinking through styling and layout of modules, class and defines by Tom Doran
Thinking through styling and layout of modules, class and defines by Tom Doran
 
CfgMgmtCamp 2023 - Puppet is YAML.pdf
CfgMgmtCamp 2023 - Puppet is YAML.pdfCfgMgmtCamp 2023 - Puppet is YAML.pdf
CfgMgmtCamp 2023 - Puppet is YAML.pdf
 
Getting Hiera and Hiera
Getting Hiera and HieraGetting Hiera and Hiera
Getting Hiera and Hiera
 
Understanding the Data Lookup Pattern
Understanding the Data Lookup PatternUnderstanding the Data Lookup Pattern
Understanding the Data Lookup Pattern
 
Puppet Camp Berlin 2014: Manageable puppet infrastructure
Puppet Camp Berlin 2014: Manageable puppet infrastructurePuppet Camp Berlin 2014: Manageable puppet infrastructure
Puppet Camp Berlin 2014: Manageable puppet infrastructure
 
Drupal 8 configuration management
Drupal 8 configuration managementDrupal 8 configuration management
Drupal 8 configuration management
 
Oozie or Easy: Managing Hadoop Workloads the EASY Way
Oozie or Easy: Managing Hadoop Workloads the EASY WayOozie or Easy: Managing Hadoop Workloads the EASY Way
Oozie or Easy: Managing Hadoop Workloads the EASY Way
 
CCF #1: Taking the reins of your data with Hiera 5
CCF #1: Taking the reins of your data with Hiera 5CCF #1: Taking the reins of your data with Hiera 5
CCF #1: Taking the reins of your data with Hiera 5
 
Manageable Puppet Infrastructure - PuppetConf 2014
Manageable Puppet Infrastructure - PuppetConf 2014Manageable Puppet Infrastructure - PuppetConf 2014
Manageable Puppet Infrastructure - PuppetConf 2014
 
Puppet atbazaarvoice
Puppet atbazaarvoicePuppet atbazaarvoice
Puppet atbazaarvoice
 
Delegated Configuration with Multiple Hiera Databases - PuppetConf 2014
Delegated Configuration with Multiple Hiera Databases - PuppetConf 2014Delegated Configuration with Multiple Hiera Databases - PuppetConf 2014
Delegated Configuration with Multiple Hiera Databases - PuppetConf 2014
 

Recently uploaded

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Recently uploaded (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Rpug - Puppet 4 Module Data

  • 1. Puppet 4 Module Data Pre-environment & per-module Hiera Raleigh PUG 3/2017 Jere Julian
  • 2. Where we were Single, global hiera.yaml Incantations to have per-environment hieradata/ Modules relied on params.pp model
  • 3. Experimental (deprecated) - 2016.1 [4.4] Puppet $var = hiera() replaced by $var = lookup() Tiers: Classic Hiera, Environment Data, Module Data Module Data lookup require module namespace! New hiera.yaml format: v4 puppet.conf: environment_data_provider = hiera
  • 4. Hiera.yaml v4 (deprecated) # /etc/puppetlabs/code/environments/production/hiera.yaml --- version: 4 datadir: data hierarchy: - name: "Nodes" backend: yaml path: "nodes/%{trusted.certname}" # Putting a JSON level between YAML levels like this was impossible in the old format. - name: "Exported JSON nodes" backend: json paths: # Puppet checks these in order. Even though this is a single item in the hierarchy, it acts like multiple hierarchy levels. - "nodes/%{trusted.certname}" - "insecure_nodes/%{facts.fqdn}" - name: "virtual/%{facts.virtual}" backend: yaml - name: "common" backend: yaml
  • 5. Current Module Data - Hiera 5 - 2017.1 [4.9] Hiera 5 now included in Puppet Environment and Module Data lookup() function and 'puppet lookup' CLI command hiera_* functions and hiera.yaml v4 deprecated Layers: Global, Environment, Module
  • 6. Hiera.yaml v5--- version: 5 defaults: # Used for any hierarchy level that omits these keys. datadir: data # This path is relative to hiera.yaml's directory. data_hash: yaml_data # Use the built-in YAML backend. hierarchy: - name: "Per-node data" # Human-readable name. path: "nodes/%{trusted.certname}.yaml" # File path, relative to datadir. # ^^^ IMPORTANT: include the file extension! - name: "Per-datacenter business group data" # Uses custom facts. path: "location/%{facts.whereami}/%{facts.group}.yaml" - name: "Global business group data" path: "groups/%{facts.group}.yaml" - name: "Per-datacenter secret data (encrypted)" lookup_key: eyaml_lookup_key # Uses non-default backend. path: "secrets/%{facts.whereami}.eyaml" options: pkcs7_private_key: /etc/puppetlabs/puppet/eyaml/private_key.pkcs7.pem pkcs7_public_key: /etc/puppetlabs/puppet/eyaml/public_key.pkcs7.pem - name: "Per-OS defaults" path: "os/%{facts.os.family}.yaml" - name: "Common data" path: "common.yaml"
  • 7. Default hiera.yaml v5 --- version: 5 hierarchy: - name: Common path: common.yaml defaults: data_hash: yaml_data datadir: data
  • 8. Notes & Recommendations lookup() does NOT merge values. Still use hiera_array & hiera_hash Hiera_include does an array merge from all levels Don't use the lookup() function within templates Lookups within data.yaml: profile::wordpress::database_server: "%{lookup('profile::mysql::public_hostname')}" Alias: original: - 'one' - 'two' aliased: "%{alias('original')}"
  • 9. References Don't use the lookup() function within templates Hiera v5 syntax Puppet 4.4 lookup() quick reference Example Puppet module using hiera module data: aristanetworks-cloudvision

Editor's Notes

  1. Limited by some of the history and pitfalls of params.pp. To inherit or not to inherit? Separate models for storing/managing data… DSL & Hiera. Where did the value come from? Can you reliably debug the data sources? Having a single, global hiera.yaml is fine when the environments are deployment stages (dev/tage/prod) but limiting if you need different models for different environments (multi-tenant, multi-org).
  2. https://docs.puppet.com/puppet/4.4/lookup_quick.html Puppet 2016.1 (4.4) 'Puppet lookup' command for checking the data in hiera. Use the --node and --explain options. Example: sudo puppet lookup <KEY> --node <NAME> --explain Modules can set custom lookup_options for their data: first, unique, merge, hash, deep
  3. https://docs.puppet.com/puppet/4.4/lookup_quick.html Puppet 2016.1 (4.4) 'Puppet lookup' command for checking the data in hiera. Use the --node and --explain options. Example: sudo puppet lookup <KEY> --node <NAME> --explain
  4. https://docs.puppet.com/puppet/4.9/hiera_intro.html
  5. No more colons in keys!
  6. No more colons in keys!
  7. https://docs.puppet.com/hiera/latest/puppet.html#dont-use-the-lookup-functions-from-templates Non-obvious model. Assign to a local variable in manifest with lookup(), then use local variable in templates.
  8. https://docs.puppet.com/hiera/latest/puppet.html#dont-use-the-lookup-functions-from-templates Non-obvious model. Assign to a local variable in manifest with lookup(), then use local variable in templates.