# Restrict hiera (version 5) lookup at environment and module layers

Hi, Recently I installed PE 2017.2 and got everything setup except hiera. Though I have used Hiera 3 it's going very tough to understand the configuration for all layers. However I have created a hiera.yaml in testing environment and defined the data structure like environment/data/node/mynode.yaml. Below is the content of hiera.yaml

---
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"
path: "nodes/%{trusted.certname}.yaml"


Directory structure as follows:

[root@mobf7l4z0k testing]# ls data/nodes/
qde1ar.yaml
[root@mobf7l4z0k testing]# ls