File { ensure => directory, mode => "0750", } file { '/etc/puppetlabs/code':; '/etc/puppetlabs/code/hieradata':; '/etc/puppetlabs/code/hieradata/roles':; '/etc/puppetlabs/code/environments':; '/etc/puppetlabs/code/environments/production':; } file { '/etc/puppetlabs/code/hiera.yaml': ensure => file, mode => "0640", content => ' --- :backends: - "yaml" :logger: "console" :hierarchy: - "global" - "roles/%{hiera(\'hello\')}" :yaml: :datadir: "/etc/puppetlabs/code/hieradata" ', } file { '/etc/puppetlabs/code/hieradata/global.yaml': ensure => file, mode => "0640", content => '--- hello: "world" ', } file { '/etc/puppetlabs/code/hieradata/roles/world.yaml': ensure => file, mode => "0640", content => '--- somekey: "someval" ', }