Моя структура папок /etc/puppetlabs/code
:
[vagrant@client code]$ pwd
/etc/puppetlabs/code
[vagrant@client code]$ tree
.
├── environments
│ ├── production
│ │ ├── environment.conf
│ │ ├── hieradata
│ │ ├── manifests
│ │ └── modules
│ └── test
│ ├── hieradata
│ ├── manifests
│ │ └── site.pp
│ └── modules
├── hieradata
│ ├── common.yaml
│ └── hostname
│ └── client.yaml
├── hiera.yaml
└── modules
Затем для моих файлов YAML:
[vagrant@client code]$ cat hiera.yaml
---
:backends:
- yaml
:hierarchy:
- "hostname/%{facts.hostname}"
- "os/%{facts.osfamily}"
- common
:yaml:
:datadir: /etc/puppetlabs/code/hieradata
merge_behavior: deeper
[vagrant@client code]$ cat hieradata/common.yaml
---
users:
jill:
uid: 1000
home: '/home/jill'
jack:
uid: 1001
home: '/home/jack'
[vagrant@client code]$ cat hieradata/hostname/client.yaml
---
users:
jill:
home: '/homes/jill'
jack:
home: '/homes/jack'
jane:
uid : 999
home: '/homes/jane'
Тем не менее, когда я запускаю hiera, я получаю следующее:
[vagrant@client code]$ hiera --hash users
{"jill"=>{"uid"=>1000, "home"=>"/home/jill"},
"jack"=>{"uid"=>1001, "home"=>"/home/jack"}}
[vagrant@client code]$ hiera --hash users ::hostname=client
{"jill"=>{"uid"=>1000, "home"=>"/home/jill"},
"jack"=>{"uid"=>1001, "home"=>"/home/jack"}}
Мой hieradata/hostname/client.yaml
должен переопределять common.yaml
, заставляя команду hiera
возвращать что-то другое, когда передается ::hostname=client
.
Что я делаю не так?