Jira (HI-615) node specific variables not getting picked up from hiera

12 views
Skip to first unread message

uday (JIRA)

unread,
Oct 30, 2019, 4:58:03 AM10/30/19
to puppe...@googlegroups.com
uday created an issue
 
Hiera / New Feature HI-615
node specific variables not getting picked up from hiera
Issue Type: New Feature New Feature
Affects Versions: HI 3.4.2
Assignee: Unassigned
Components: Community, DOCS
Created: 2019/10/30 1:57 AM
Fix Versions: HI 3.4.2
Priority: Major Major
Reporter: uday

I have upgraded puppet master from 3 to 5. All the modules are working fine when run puppet agent -tv from the client (puppet agent 3 . But the hiera lookup values are not being taken properly

I have updated the hiera version from 3 to version 5 even that doesn't help, I am enclosing my hiera 3 file and hiera 5 file.

 

hiera 3 was working fine with puppet master 5

###hiera version 3 file #######


:backends:
  - yaml
  - json

:yaml:
  :datadir: /etc/puppet/hieradata

:json:
  :datadir: /etc/puppet/hieradata

:hierarchy:
  - "node/%{::hostname}"
  - "tspnode/%{::hostname}"
  - "tmpnode/%{::hostname}"
  - "%{::clientcert}"
  - "%{::custom_location}"
  - limits_rules
  - sudo_rules
  - virt_who
  - common

 

#############################################

#######hiera version 5 ##################

 


version: 5
defaults:
  datadir: /etc/puppet/hieradata
  data_hash: yaml_data
hierarchy:
  - name: "Per-node data"
    paths:
      - "node/%{facts.hostname}.yaml"
      - "tspnode/%{facts.hostname}.yaml"
      - "tmpnode/%{::hostname}.yaml"
      - "%{::clientcert}.yaml"

  - name: "Other YAML hierarchy levels"
    paths:
      - "%{::custom_location}.yaml"
      - "limits_rules.yaml"
      - "sudo_rules.yaml"
      - "virt_who.yaml"
      - "common.yaml"

 

##################

 

hiera -V
3.4.2

 

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Oct 30, 2019, 6:42:03 AM10/30/19
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Oct 30, 2019, 6:42:03 AM10/30/19
to puppe...@googlegroups.com

But the hiera lookup values are not being taken properly

How did you determine that?

Also, try the `puppet lookup` command line tool to debug what hiera is doing.

uday (JIRA)

unread,
Oct 30, 2019, 7:27:04 AM10/30/19
to puppe...@googlegroups.com
uday commented on New Feature HI-615

Hi

 

When I do puppet lookup I get the following message

Warning: Undefined variable '::hostname'; \n   (file & line not available)
Warning: Undefined variable '::clientcert'; \n   (file & line not available)
Warning: Undefined variable '::custom_location'; \n   (file & line not available)
Warning: hiera.yaml: Use of 'hiera.yaml' version 3 is deprecated. It should be converted to version 5
Warning: hiera.yaml version 3 found at the environment root was ignored
.yaml)

uday (JIRA)

unread,
Oct 30, 2019, 7:28:03 AM10/30/19
to puppe...@googlegroups.com
uday commented on New Feature HI-615

network configuration file, ntp file and sudoers file are the ones that we are managing via hiera

and only these files are not getting pulled correct.

Henrik Lindberg (JIRA)

unread,
Oct 30, 2019, 9:00:12 AM10/30/19
to puppe...@googlegroups.com
Henrik Lindberg commented on New Feature HI-615

You need to supply the facts that your hiera.yaml requires, or give it the name of the node you want facts from (that node must have called into the master with its facts for that to work).

Since I believe that hiera 5 works in general I think the issues you are seeing are caused by errors in your configuration. You will probably get help much quicker if you hop onto slack.

With `puppet lookup` you want to use the `--explain` flag to get detailed information how your paths gets expanded, if it finds the file, what it manages to look up, how it merges data (if merge is asked for) etc. etc.

I am going to close this ticket as there is no reproducible case showing that hiera does not work. Feel free to come back with questions here, but think you will get better help faster in the #puppet slack channel.

Reply all
Reply to author
Forward
0 new messages