Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

no implicit conversion of Symbol into Integer : Issues with Hiera calls.

$
0
0
Seems im having issues with Hiera.. Every call to this function no mater what im trying to pull is giving me this syntax.. ive been pulling my hair out and im sure its simple.

File for hiera is common.yaml

ntpservers:     server1
Checking that hiera on the puppet master works.
[root@oc8086083754 manifests]# hiera ntpservers
server1
So i now try to make sure the simple script can pull the value
 [root@oc8086083754 manifests]# puppet apply --debug -e '$somevar = hiera('ntpservers') notify { $somevar: }'
Debug: hiera(): Hiera YAML backend starting
Debug: hiera(): Looking up ntpservers in YAML backend
Error: Evaluation Error: Error while evaluating a Function Call, no implicit conversion of Symbol into Integer at line 1:12 on node oc8086083754.ibm.com
Error: Evaluation Error: Error while evaluating a Function Call, no implicit conversion of Symbol into Integer at line 1:12 on node oc8086083754.ibm.com

Getting this with any hiera('xxxxxx') on the normal .pp files also.
What is happening am i doing wrong :O(

Second Test... Seems i cant get any thing to work :O(

puppet-3.6.2-3.el7.noarch
hiera-1.3.4-5.el7.noarch

[root@oc8086083754 environments]# hiera test::protocol
http://
[root@oc8086083754 environments]# hiera test::hostname
domain.com
[root@oc8086083754 environments]# hiera test::path
/index.html

[root@oc8086083754 environments]# cat /tmp/test.pp
class test (
  $protocol,
  $hostname,
  $path,
) {
  notify { 'Print an URL':
    message => "${protocol}${hostname}${path}"
  }
}

class { 'test': }
I run my test

[root@oc8086083754 environments]# puppet apply --debug /tmp/test.pp
Debug: hiera(): Hiera YAML backend starting
Debug: hiera(): Looking up test::protocol in YAML backend
Error: Evaluation Error: Error while evaluating a Resource Statement, Error from DataBinding 'hiera' while looking up 'test::protocol': no implicit conversion of Symbol into Integer at /tmp/test.pp:11:1 on node oc8086083754.ibm.com
Error: Evaluation Error: Error while evaluating a Resource Statement, Error from DataBinding 'hiera' while looking up 'test::protocol': no implicit conversion of Symbol into Integer at /tmp/test.pp:11:1 on node oc8086083754.ibm.com

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>