Re: [Puppet Users] hiera, template and array

2023-03-28 Thread Laci D
I tried both epp and erb templates. This is the manifest file: class site::profiles::ntp { $ntp = hiera_hash('ntp') case $::operatingsystem { 'freebsd': { file { "/etc/ntp.conf": ensure => file, recurse => true,

[Puppet Users] PDK 2.7.1 released

2023-03-28 Thread Puppet Product Updates
Puppet Content and Tooling Releases Development tools *PDK 2.7.1* The Puppet Development toolkit (PDK) provides integrated testing tools and a command line interface to help you develop, validate, and test modules *Where you can find it:* - https://www.puppet.com/downloads/puppet-development-kit

Re: [Puppet Users] hiera, template and array

2023-03-28 Thread Martin Alfke
My example is an epp template. What name does the variable have? $ntp? And: is this a hash with servers key set to an array? In this case your erb (!) template can look like the following: <% @ntp[’servers’].each { |server| -%> server: <%= server %> <% } -%> > On 28. Mar 2023, at 14:37, Laci

Re: [Puppet Users] hiera, template and array

2023-03-28 Thread Martin Alfke
You must iterate as servers is an array: <% $servers.each |$server| { -%> server: <%= $server %> <%- } -%> > On 27. Mar 2023, at 22:21, Laci D wrote: > > I'm working on defining NTP servers from Hiera. > > For Linux servers I have been using puppetlabs-ntp, which has been working > nicely.

Re: [Puppet Users] hiera, template and array

2023-03-28 Thread Laci D
Thank you Martin! I used your example and I think something is missing. Since "servers" is under "ntp" in the hiera file (see example in my original email) maybe we need to define that in the erb file? Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Internal Server

Re: [Puppet Users] hiera, template and array

2023-03-28 Thread 'Dirk Heinrichs' via Puppet Users
Am Dienstag, dem 28.03.2023 um 05:37 -0700 schrieb Laci D: Since "servers" is under "ntp" in the hiera file (see example in my original email) maybe we need to define that in the erb file? I think the example is slightly wrong. Should IMHO be "@servers" and then just "server" (without the

[Puppet Users] Service Graph Connector for Puppet 1.2.0 released

2023-03-28 Thread Puppet Product Updates
*Puppet Integration Releases* *ServiceNow* Service Graph Connector for Puppet 1.2.0 The Service Graph Connector for Puppet ingests data from multiple Puppet Enterprises directly into