Difference between revisions of "Hierahandson"
From Gridkaschool
Line 8: | Line 8: | ||
## In the root of your environment in git, at the same level as "modules" and "manifests" "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 <schoolmachine>.desy.de.yaml where <schoolmachine> is your puppet client machine (ie gridkaschool01.desy.de) |
||
## touch web.yaml data.yaml compute.yaml |
## touch web.yaml data.yaml compute.yaml |
||
## touch RedHat.yaml |
## touch RedHat.yaml |
||
Line 14: | Line 15: | ||
## convert params to hiera() calls |
## convert params to hiera() calls |
||
### use "common".yaml for now |
### use "common".yaml for now |
||
− | ## convert the direct |
+ | ## convert the direct hiera() 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 |
# 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 |
# 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: |
Bonus: |
Revision as of 09:52, 9 September 2015
This is our hiera hierarchy:
environments/%{::environment}/hieradata/%{::certname} environments/%{::environment}/hieradata/%{::role} environments/%{::environment}/hieradata/%{::osfamily} environments/%{::environment}/hieradata/common hieradata/common
- Enhance the apache module with hiera
- In the root of your environment in git, at the same level as "modules" and "manifests" "mkdir hieradata"
- cd hieradata
- touch <schoolmachine>.desy.de.yaml where <schoolmachine> is your puppet client machine (ie gridkaschool01.desy.de)
- touch web.yaml data.yaml compute.yaml
- touch RedHat.yaml
- touch common.yaml
- convert params to hiera() calls
- use "common".yaml for now
- convert the direct hiera() 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
- 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:
- Try using hiera_include to include a class