Difference between revisions of "Hierahandson"

From Gridkaschool
Line 6: Line 6:
 
hieradata/common
 
hieradata/common
 
# Enhance the apache module with hiera
 
# Enhance the apache module with hiera
## In the root of your environment, "mkdir hieradata"
+
## In the root of your environment in git, at the same level as "modules" and "manifests" "mkdir hieradata"
 
## cd hieradata
 
## cd hieradata
 
## touch $(hostname).desy.de.yaml
 
## touch $(hostname).desy.de.yaml

Revision as of 15:22, 4 September 2014

This is our hiera hierarchy:

   environments/%{::environment}/hieradata/%{::certname}
   environments/%{::environment}/hieradata/%{::role}
   environments/%{::environment}/hieradata/%{::osfamily}
   environments/%{::environment}/hieradata/common
   hieradata/common
  1. Enhance the apache module with hiera
    1. In the root of your environment in git, at the same level as "modules" and "manifests" "mkdir hieradata"
    2. cd hieradata
    3. touch $(hostname).desy.de.yaml
    4. touch web.yaml data.yaml compute.yaml
    5. touch RedHat.yaml
    6. touch common.yaml
    7. convert params to hiera() calls
      1. use "common".yaml for now
    8. convert the direct heira() calls to automatic lookups. Remember that if a class is called "foo" and it has a parameter "$bar" then you need a hiera key foo::bar
  2. In your environment, using at least 2 of the fqdn / role or osfamily yaml files you've created, add different values and see how they get used / override values in other parts of the hierarchy

Bonus:

  1. Try using hiera_include to include a class