starting hiera + ntp module

707 views
Skip to first unread message

TimV

unread,
Oct 9, 2013, 11:11:46 AM10/9/13
to puppet...@googlegroups.com
Hello,

I am trying to extend my puppet installation by utilising hiera for dynamic data for particular hosts.  To that end, I'm testing hiera with the puppetlabs ntp module. However, I am getting this error:

"Error: Could not retrieve catalog from remote server: Error 400 on SERVER: "false," is not an Array.  It looks to be a String at /etc/puppet/modules/ntp/manifests/init.pp:34 on node blah.blah", when I run puppet agent --test --noop.

Init.pp is straight from puppetlabs.

I have a hiera.yaml file in the root of my puppet install (/etc/puppet)
hiera.yaml references my datadir as /etc/puppet/hieradata and the hierarchy as common

Inside hieradata, I have a simple common.yaml file, and in that file I have:

---
testmsg : 'Tim was here'
ntp::restrict : false,
ntp::autoupdate : true,
ntp::enable : false,
ntp::servers : [
  "ntp.example.org iburst",
  "0.us.pool.ntp.org iburst",
  "1.us.pool.ntp.org iburst",
  "2.us.pool.ntp.org iburst"
  ]

I can test the hiera file with a "hiera -c /etc/puppet/hiera.yaml ntp::enable and get "false," as a response.

Like I  mentioned, I grabbed the puppetlabs module for testing. I used the above hiera values for testing purposes.  Yet, it's not working. My other non-hiera modules are working, but are limited to the hardcoded values I have in them.  I'd like to be be able to pass specific values to specific hosts for example, for a sudoers file, all hosts get base admins, but specific hosts get different admins...

Anyways, I am pretty new to hiera, so any help appreciated!

Thanks.

Tim


jcbollinger

unread,
Oct 10, 2013, 10:33:11 AM10/10/13
to puppet...@googlegroups.com


On Wednesday, October 9, 2013 10:11:46 AM UTC-5, TimV wrote:
Hello,

I am trying to extend my puppet installation by utilising hiera for dynamic data for particular hosts.  To that end, I'm testing hiera with the puppetlabs ntp module. However, I am getting this error:

"Error: Could not retrieve catalog from remote server: Error 400 on SERVER: "false," is not an Array.  It looks to be a String at /etc/puppet/modules/ntp/manifests/init.pp:34 on node blah.blah", when I run puppet agent --test --noop.

Init.pp is straight from puppetlabs.

I have a hiera.yaml file in the root of my puppet install (/etc/puppet)
hiera.yaml references my datadir as /etc/puppet/hieradata and the hierarchy as common

Inside hieradata, I have a simple common.yaml file, and in that file I have:

---
testmsg : 'Tim was here'
ntp::restrict : false,
ntp::autoupdate : true,
ntp::enable : false,
ntp::servers : [
  "ntp.example.org iburst",
  "0.us.pool.ntp.org iburst",
  "1.us.pool.ntp.org iburst",
  "2.us.pool.ntp.org iburst"
  ]


The module expects its 'restrict' parameter, if given, to be an array.  The docs are not clear about that (so feel free to file a ticket).  If you want to suppress the default restrictions without providing any of your own then try making the value an empty array.


John

Matthew Herzog

unread,
May 26, 2014, 4:03:05 PM5/26/14
to puppet...@googlegroups.com
I'm following the instructions on http://docs.puppetlabs.com/hiera/1/complete_example.htm too and they do not work.

Boos to puppetlabs. Fix that page.

Felix Frank

unread,
May 30, 2014, 4:38:34 AM5/30/14
to puppet...@googlegroups.com
On 05/26/2014 10:03 PM, Matthew Herzog wrote:
> Boos to puppetlabs.

Disclaimer: I've no affiliation with Puppet Labs.

This rubs me wrong regardless.

Please note that the documentation *is* also open source, and you are
more than welcome to improve it as you see fit. Barring your ability to
contribute directly, you can still help by raising issues as bug report
tickets (as John has advised in this very thread).

Spencer Krum

unread,
May 30, 2014, 12:31:52 PM5/30/14
to puppet...@googlegroups.com

I actually already made this change and pushed it. Nick merged it yesterday.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/5388431B.80403%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.

Sans

unread,
Jun 1, 2014, 6:16:43 AM6/1/14
to puppet...@googlegroups.com


On Wednesday, October 9, 2013 4:11:46 PM UTC+1, TimV wrote:

Inside hieradata, I have a simple common.yaml file, and in that file I have:

---
testmsg : 'Tim was here'
ntp::restrict : false,
ntp::autoupdate : true,
ntp::enable : false,
ntp::servers : [
  "ntp.example.org iburst",
  "0.us.pool.ntp.org iburst",
  "1.us.pool.ntp.org iburst",
  "2.us.pool.ntp.org iburst"
  ]


One this noticed about your ntp::servers here: I don't know if you can do that way but normally I define an array in hiera like this:

ntp::servers:
    - ntp.example.org iburst
    - 0.us.pool.ntp.org iburst
    - 1.us.pool.ntp.org iburst
    - 2.us.pool.ntp.org iburst
 

In that case, the error message: Error 400 on SERVER: "false," is not an Array - seems right. Best!


Reply all
Reply to author
Forward
0 new messages