Hierahandson

From Gridkaschool
Revision as of 12:01, 4 September 2014 by BenJones (talk | contribs)

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, "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. you will need to define the key in one of the yaml files that will apply to your machine. Note that only one of web/data/compute will apply to you! You can add different values to different parts of the hierarchy and see which apply
    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