In our hierarchy defined in hiera.yaml
, we created an entry based on the hostname fact; in this section, we'll create yaml
files in the hosts
subdirectory of Hiera data with information specific to a particular host.
Install and configure Hiera as in the last section, and modify the hierarchy defined in the previous recipe to include a hosts/%{hostname}
entry, as follows:
--- # Hiera 5 Global configuration file version: 5 hierarchy: - name: "Per-host defaults" path: "hosts/%{::facts.hostname}.yaml" - name: "Per-OS defaults" path: "os/%{::facts.os.family}.yaml" - name: "Common data" path: "common.yaml"
message: 'This is the test node for the cookbook'
- Run Puppet on two different test nodes to note the...