Hiera command and check classes for the nodes

50 views
Skip to first unread message

mike

unread,
Jul 9, 2014, 2:47:17 PM7/9/14
to puppet...@googlegroups.com
Hello,
I have Puppet and Hiera for in my configuration and i have the next question:  when i define some node use the particular class declared inside "fqdn/node.example.com.yaml" and after check with hiera command the classes for this node and list only the class declared inside  "node.example.com.yaml" but not list classes from common class (common.yaml) but this node executes this classes without problem when running puppet agent.

For example:

Node node1.example.com.yaml
[.................]
[root@puppet hieradata]# cat fqdn/node1.example.com.yaml 
---
classes: 
        - ssh
ssh::port: '22'
ssh::permit_root_login: 'no'
[.................]

Common YAML
[.................]
[root@puppet hieradata]# cat common.yaml 
---
classes:
        - ntp
ntp::restrict       : true
ntp::autoupdate : true
ntp::enable       : true
ntp::servers      : ["ntp1.example.com", "ntp2.example.com"]
[.................]

Check class with hiera command (list only ssh class but not ntp class)

[.................]
[root@puppet hieradata]# hiera classes ::fqdn=node1.example.com
["ssh"]
[.................]

My hiera value

[.................]
[root@puppet puppet]# cat hiera.yaml 
---
:backends:
  - yaml
:yaml:
  :datadir: /etc/puppet/hieradata
:hierarchy:
  - "fqdn/%{::fqdn}"
  - common
[.................]


Thanks.




Reply all
Reply to author
Forward
0 new messages