Re: [Puppet Users] Hiera: Using mapped_paths with a hashmap

2024-09-04 Thread 'Dirk Heinrichs' via Puppet Users
Am Mittwoch, dem 04.09.2024 um 10:00 + schrieb 'Dirk Heinrichs' via Puppet Users: However, if the given fact is a hash, then - name: Foo mapped_paths: [facts.foo, name, "foo/%{name}.yaml"] Got it: The path template must look like "foo/%{name.0}.yaml" to access the key. Bye... Dirk

Re: [Puppet Users] hiera, template and array

2023-03-30 Thread Laci D
*puppetlabs-ntp* doesn't support FreeBSD. I do use this module to manage ntp on Ubuntu. On Wednesday, March 29, 2023 at 4:44:21 PM UTC-4 LinuxDan wrote: > Silly question: Why not use > https://forge.puppet.com/modules/puppetlabs/ntp ? > ___ >

Re: [Puppet Users] hiera, template and array

2023-03-29 Thread 'Dan White' via Puppet Users
Silly question: Why not use https://forge.puppet.com/modules/puppetlabs/ntp ? ___ Dan White : d_e_wh...@icloud.com “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact

Re: [Puppet Users] hiera, template and array

2023-03-29 Thread Laci D
The following configuration is finally working, yay! I replaced "servers" with "*ntp_host*" in hiera to have a clean separation between "server" and "servers". Thank you for the help! templates/ntp/ntp.conf.erb # File is managed by Puppet <% if @ntp['ntp_host'] -%> server <%= @ntp['ntp_host']

Re: [Puppet Users] hiera, template and array

2023-03-29 Thread Martin Alfke
In EPP the template must look different: <% $site::profiles::ntp::ntp[‘servers'].each |$server| { -%> server: <%= $server %> <% } -%> An array may consist of a single entry only. > On 28. Mar 2023, at 16:30, Laci D wrote: > > I tried both epp and erb templates. > > This is the manifest file:

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,

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 D

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 leadi

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 E

Re: [Puppet Users] hiera, template and array

2023-03-27 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. No

Re: [EXTERNAL] - Re: [Puppet Users] Hiera 5 and Deferred / Sensitive

2022-11-02 Thread 'Dirk Heinrichs' via Puppet Users
Am Mittwoch, dem 02.11.2022 um 00:21 -0700 schrieb Aaron Russo: There is petems-hiera_vault which is close -- Didn't know thi

Re: [Puppet Users] Hiera 5 and Deferred / Sensitive

2022-11-02 Thread Aaron Russo
If you're referring to hiera-eyaml-vault , that's not pulling secrets out of Vault -- it's using the transit encryption provider in place of gpg keys and storing those in yaml. It's a neat approach but not what I'm looking for. There is petems-hiera_

Re: [Puppet Users] Hiera 5 and Deferred / Sensitive

2022-11-01 Thread 'Dirk Heinrichs' via Puppet Users
Am Freitag, dem 21.10.2022 um 11:49 -0700 schrieb Aaron Russo: However it feels like an anti-pattern by forcing lookups into our manifests when we want to keep that in Hiera. I found a previous related thread[2] where Henrik suggested writing a custom backend for Hiera and return a Deferred. hi

Re: [Puppet Users] Hiera 5 and Deferred / Sensitive

2022-10-31 Thread Aaron Russo
Closing the loop on this for anyone else trying this in the future. The custom backend was correct the entire time and was returning the Deferred function. However since I was defining a key prefix that wasn't actually used in Hiera for the custom backend to key off of, I was making use of the

Re: [Puppet Users] Hiera 5 and Deferred / Sensitive

2022-10-31 Thread Aaron Russo
So I managed to get this to work by changing hiera data slightly, replacing the `lookup` function with `alias` so that the type wasn't automatically converted to a string. ``` # this works! note the weird quoting is to avoid hiera treating fqdn dots as sub-keys and is intentional. profile::gitlab_

Re: [Puppet Users] Hiera values in provider

2022-08-02 Thread Matthias K
Thank you for the example. Right now I'm going a different route to avoid having to store the password locally in plaintext and switched to an approach where I parse and filter the output of "dnf repolist" which is "good enough" for our current usecase, but I will look into the nexus provider a

Re: [Puppet Users] Hiera values in provider

2022-08-01 Thread 'Dirk Heinrichs' via Puppet Users
Am Montag, dem 01.08.2022 um 12:47 -0700 schrieb Matthias K: > The provider subscribes and unsubscribes yum repo channels through a > remote xmlrpc interface. To do this we need a username and password, > this is part of the defined resource and comes from hiera. This is > fine for creating the re

Re: [Puppet Users] Hiera values in provider

2022-08-01 Thread Matthias K
Thank you. I was expecting something like that :-/ Your described process is in general what we are doing with all of our custom providers. Unfortunately, in this case, we have something "special". The provider does not manage anything which can be accessed locally from the system. The provide

Re: [Puppet Users] Hiera values in provider

2022-08-01 Thread Ben Ford
Not directly. Hiera provides data to the server for use when compiling the catalog. Providers run on the agent after the catalog has been compiled. If you need to get to Hiera data, write your type/provider such that it accepts a parameter, then look that up from Hiera and pass it in when you decl

Re: [Puppet Users] hiera 5 postgresql backend

2022-04-15 Thread 'Matt Zagrabelny' via Puppet Users
On Fri, Apr 15, 2022 at 12:34 PM Matt Zagrabelny wrote: > Hi Martin, > > Thanks for the email. I understand your concerns about using other > backends. We have a reasonably small puppet deployment, so I think I will > try a DB based backend and see how it performs. > > In that light, I've downloa

Re: [Puppet Users] hiera 5 postgresql backend

2022-04-15 Thread 'Matt Zagrabelny' via Puppet Users
Hi Martin, Thanks for the email. I understand your concerns about using other backends. We have a reasonably small puppet deployment, so I think I will try a DB based backend and see how it performs. In that light, I've downloaded a hiera-mysql2 module from github and installed it at: # tree /us

Re: [Puppet Users] hiera 5 postgresql backend

2022-04-13 Thread Martin Alfke
Hi, We usually recommend to not use any other backend, except for file based backends, due to performance. Any other backend must be able to deliver the same lookup speed. We did a calculation at a customer and we saw hiera answering 8000 queries in less than 1 second using the yaml file backend

Re: [Puppet Users] Hiera value and using looping on it

2021-12-16 Thread 'Dirk Heinrichs' via Puppet Users
Am Mittwoch, dem 15.12.2021 um 22:53 -0800 schrieb Tejas Bhosale: I have heira value as an example as ``` profile::candy::virtualhosts: abc.example.com: listen: '80' location: [v1, v2] backend_port: [3000, 3001] ``` Use profile::candy::virtualhosts: - name: abc.exacmple.com

Re: [Puppet Users] Hiera driving me round the bend

2021-10-14 Thread David Murphy
OK - I think my naming is a little confusing but I don't think that I am confusing the two - although I totally could be, The problem for me seems to be that the facts that the client should be passing through to the server don't seem to be handled properly. The way I'm trying to determine th

Re: [Puppet Users] Hiera driving me round the bend

2021-10-14 Thread Martin Alfke
Hi David, You seem to mix up hiera and facts. Your node has facts: --- derivedsite: 'cp1' hostdb: role: 'development' businessowner: ‘Infrastructure' attributes: - 'DNS-Slave' - 'Oracle' applicationlist: - ‘test' Now hiera jumps in (hiera.yaml file) and uses the facts

Re: [Puppet Users] hiera merge lookup/alias of array defined at multiple levels

2021-09-03 Thread Mark Dixon
Hi Dirk, Thanks so much for that, adding lookup_options in common.yaml worked :) Ideally I'd like to put the setting as an argument to %{lookup()} or %{alias()} within hiera documents, but they don't seem to support that. All the best, Mark On Friday, 3 September 2021 at 06:28:03 UTC+1 dhei..

Re: [Puppet Users] hiera merge lookup/alias of array defined at multiple levels

2021-09-02 Thread 'Dirk Heinrichs' via Puppet Users
Am Donnerstag, dem 02.09.2021 um 08:46 -0700 schrieb Mark Dixon: > I'd like to do a simple merge lookup of an array within a hiera yaml > file. At the moment I seem to be getting the array from the hiera > location that "wins", and not a merged version. You need to tell hiera to do so, probably i

Re: [Puppet Users] Hiera lookup in hiera lookup

2021-05-18 Thread Erwin Bogaard
Indeed it was about looking up a value to use as part of a following lookup, so a lookup in a lookup. I was already afraid this would not be possible. Thanks for the suggestion of using separate yaml files, I'll explore that idea further. On Tuesday, 18 May 2021 at 11:17:00 UTC+2 benri...@gmail.

Re: [Puppet Users] Hiera lookup in hiera lookup

2021-05-18 Thread Benjamin Ridley
Hi Erwin and Martin, I think there's a difference here - Erwin it seems you're trying to do nested interpolation, while Martin it appears your example is for lookups nested in hiera data. Erwin as far as I'm aware, nested interpolation in the manner you suggest is not possible. At least I've not

Re: [Puppet Users] Hiera lookup in hiera lookup

2021-05-18 Thread Martin Alfke
Hi Erwin, Nested lookups are possible. We did a blog post on this topic: https://blog.example42.com/2020/01/21/hiera-nested-lookups/ Just be sure: A nested lookup (like in your example) always returns a string. If you need arrays or

Re: [Puppet Users] Hiera data repetition

2021-02-28 Thread Martin Alfke
Hi Karsten, > On 27. Feb 2021, at 18:18, Karsten Heymann wrote: > > Hi Martin, > > regarding your "no lookup" policy, how do you handle for example deep merge > lookups. They cannot be used with automatic data binding, or am I wrong? > we set the merge behavior using hiera data lookup_option

Re: [Puppet Users] Hiera data repetition

2021-02-27 Thread Henrik Lindberg
On 2021-02-27 18:18, Karsten Heymann wrote: Hi Martin, regarding your "no lookup" policy, how do you handle for example deep merge lookups. They cannot be used with automatic data binding, or am I wrong? Regards Karsten You can specify lookup_options per key in the hiera data itself. One o

Re: [Puppet Users] Hiera data repetition

2021-02-27 Thread Karsten Heymann
Hi Martin, regarding your "no lookup" policy, how do you handle for example deep merge lookups. They cannot be used with automatic data binding, or am I wrong? Regards Karsten Am Sa., 27. Feb. 2021 um 13:06 Uhr schrieb Martin Alfke : > Hi > > > On 25. Feb 2021, at 11:59, Dmitry Nurislamov wrot

Re: [Puppet Users] Hiera data repetition

2021-02-27 Thread Martin Alfke
Hi > On 25. Feb 2021, at 11:59, Dmitry Nurislamov wrote: > > Hello. Sometimes it is desirable to define Hiera variables for usage in Hiera > itself, i.e. variables that won't be looked up from Puppet manifests. We do > this to avoid repetition. Here's an example of a variable used only in the

RE: [Puppet Users] hiera with environments

2020-06-12 Thread Bart-Jan Vrielink
11th June 2020 19:45 To: Puppet Users Subject: Re: [Puppet Users] hiera with environments hi, thanks for the reply.  This is all for PE, but i'm using puppet 6 OSS.. It used to work this way in 5.5 too, so I don't understand why its not seeing hiera in the preprod environment.  I could

Re: [Puppet Users] hiera with environments

2020-06-11 Thread solarflow 99
dohh! I can't believe I didn't even notice that darn typo, thats all it was too, its working fine now. Thanks a lot for pointing that out! Hopefully this example might help someone else out at least. I should have seen that... On Thursday, June 11, 2020 at 11:06:22 AM UTC-7, Nick Ber

Re: [Puppet Users] hiera with environments

2020-06-11 Thread Nick Bertrand
Hi, Perhaps it was just a typo in the email, but it looks like there might be a typo in one of your filenames: lrwxrwxrwx 1 root root 29 Jun 8 21:44 hierdata -> > gitclone/production/hieradata/ > Should this have been 'hieradata' instead of 'hierdata'? Nick -- You received this message bec

Re: [Puppet Users] hiera with environments

2020-06-11 Thread solarflow 99
hi, thanks for the reply. This is all for PE, but i'm using puppet 6 OSS.. It used to work this way in 5.5 too, so I don't understand why its not seeing hiera in the preprod environment. I could always do this: - make changed in preprod, and git commit there - cd to prod, then: - git remote up

Re: [Puppet Users] hiera with environments

2020-06-11 Thread Martin Alfke
Hi, You should change to using a control-repo and adopt your codebase. https://puppet.com/docs/pe/2018.1/control_repo.html https://github.com/puppetlabs/best-practices/blob/master/puppet-modules-and-the-control-repo.md

Re: [EXTERNAL] - Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-03-03 Thread Dirk Heinrichs
Am Dienstag, den 03.03.2020, 11:14 +0100 schrieb Martin Alfke: sshdconfig::match_address: "xx.xx.xx.xx" Just to clarify: Is "puppet lookup" supposed to find "sshdconfig::match_address" when only "match_address" was given No! That was my thought, too. So the "puppet lookup" command (see first

Re: [EXTERNAL] - Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-03-03 Thread Martin Alfke
Hi, > > Am Mittwoch, den 26.02.2020, 05:57 -0800 schrieb Dan Crisp: > >> sshdconfig::match_address: "xx.xx.xx.xx" > > Just to clarify: Is "puppet lookup" supposed to find > "sshdconfig::match_address" when only "match_address" was given No! Hiera looks for a string based key, not regex. You

Re: [EXTERNAL] - Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-03-03 Thread Dirk Heinrichs
Am Mittwoch, den 26.02.2020, 05:57 -0800 schrieb Dan Crisp: sshdconfig::match_address: "xx.xx.xx.xx" Just to clarify: Is "puppet lookup" supposed to find "sshdconfig::match_address" when only "match_address" was given? Bye... Dirk -- Dirk Heinrichs Senior Systems Engineer, Deliver

Re: [Puppet Users] Hiera Array Only Returns Last Line

2020-03-01 Thread Dan Crisp
Perfect!!! Thank you Martin. On Saturday, February 29, 2020 at 3:49:04 PM UTC, Martin Alfke wrote: > > Sorry. wrong function: > > content => $set.join("\n") > > hth, > martin > > > > On 29. Feb 2020, at 15:56, Dan Crisp > > wrote: > > > > Thanks for the respone Martin. Unfortunately that

Re: [Puppet Users] Hiera Array Only Returns Last Line

2020-02-29 Thread Martin Alfke
Sorry. wrong function: content => $set.join("\n") hth, martin > On 29. Feb 2020, at 15:56, Dan Crisp wrote: > > Thanks for the respone Martin. Unfortunately that made no difference. Still > only end up with one line. > > Thanks, > Dan. > > On Saturday, February 29, 2020 at 2:44:38 PM UTC

Re: [Puppet Users] Hiera Array Only Returns Last Line

2020-02-29 Thread Dan Crisp
Thanks for the respone Martin. Unfortunately that made no difference. Still only end up with one line. Thanks, Dan. On Saturday, February 29, 2020 at 2:44:38 PM UTC, Martin Alfke wrote: > > AFAIK content expects a string. > Maybe you can try > > content => $set.flatten > > hth, > martin >

Re: [Puppet Users] Hiera Array Only Returns Last Line

2020-02-29 Thread Martin Alfke
AFAIK content expects a string. Maybe you can try content => $set.flatten hth, martin > On 29. Feb 2020, at 14:42, Dan Crisp wrote: > > Hi, > > Attempting to popualte a file with a hiera array. > > I have the following hiera defined: > > # more common.yaml > vimrc: > - 'syntax on' >

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-29 Thread Dan Crisp
Thanks all. Have this working now. On Wednesday, February 26, 2020 at 4:04:34 PM UTC, Becca Robinson wrote: > > Hi Dan, > > I see that you have this `puppet lookup match_address --node > nodename.domain.com.yaml —explain` . > > Might want to ditch the .yaml from the node name. > > -- > *Becca

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-26 Thread Becca Robinson
Hi Dan, I see that you have this `puppet lookup match_address --node nodename.domain.com.yaml —explain` . Might want to ditch the .yaml from the node name. -- Becca Robinson Senior Professional Services Engineer be...@puppet.com | @_itgrl_ cell: (913) 752-7084 Puppet

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-26 Thread Dan Crisp
ruary 25, 2020 at 3:34:49 PM UTC, Bart-Jan Vrielink wrote: >> >> Hello, >> >> >> I see you are looking for 'match_address', but in Hiera it is stored as >> 'sshdconfig::match_address'. >> >> >> -Original message- >

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-26 Thread Dan Crisp
Look all good to me: puppet@puppet:/etc/puppetlabs/puppet$ ls -ltr total 40 -rw-r--r--. 1 puppet puppet 5487 Sep 23 22:22 auth.conf -rw-r--r--. 1 puppet puppet 657 Sep 24 12:17 puppet.conf drwxrwx--x. 1 puppet puppet 4096 Sep 27 16:22 ssl drwxr-x---. 2 puppet puppet 4096 Sep 27 22:32 devices -rw

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-26 Thread Henrik Lindberg
On 2020-02-25 16:51, Dan Crisp wrote: This is what I have: --- sshdconfig:   match_address: "xx.xx.xx.xx"   permit_root_login: without-password YAML Lint validates the YAML ok. However, it doesn't matter what I put in this file (Non YAML or a bunch of random characters ) the result is the s

RE: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-26 Thread Bart-Jan Vrielink
be automatically looked up in Hiera.   -Original message- From: Dan Crisp  Sent: Tuesday 25th February 2020 16:59 To: Puppet Users Subject: Re: [Puppet Users] Hiera Setup Lookup Complaining Hello Bart, Thanks for your reply.  Yes that threw me also.  I was originally looking for s

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-25 Thread Dan Crisp
;match_address', but in Hiera it is stored as > 'sshdconfig::match_address'. > > > -Original message- > *From:* Dan Crisp > > *Sent:* Tuesday 25th February 2020 13:42 > *To:* Puppet Users > > *Subject:* Re: [Puppet Users] Hiera

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-25 Thread Dan Crisp
This is what I have: --- sshdconfig: match_address: "xx.xx.xx.xx" permit_root_login: without-password YAML Lint validates the YAML ok. However, it doesn't matter what I put in this file (Non YAML or a bunch of random characters ) the result is the same so I suspect it's not being read. Ho

RE: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-25 Thread Bart-Jan Vrielink
Hello, I see you are looking for 'match_address', but in Hiera it is stored as 'sshdconfig::match_address'. -Original message- From: Dan Crisp  Sent: Tuesday 25th February 2020 13:42 To: Puppet Users Subject: Re: [Puppet Users] Hiera Setup Lookup Complai

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-25 Thread Henrik Lindberg
On 2020-02-25 13:42, Dan Crisp wrote: I included the --compile option.  Now (not sure whether as a result of use --option) I can see/etc/puppetlabs/code/environments/production/data/nodes/nodename.domain.com.yaml in the output: Probably because you got a run done by the agent? Anyway - firs

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-25 Thread Dan Crisp
I included the --compile option. Now (not sure whether as a result of use --option) I can see /etc/puppetlabs/code/environments/production/data/nodes/nodename.domain.com.yaml in the output: Searching for "lookup_options" Global Data Provider (hiera configuration version 5) No such key:

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-24 Thread Henrik Lindberg
Dan Crisp wrote: environment/production/data/nodes/nodename.domain.com.yaml As you can see in the output - the hiera path expanded to: Path "/etc/puppetlabs/code/environments/production/data/nodes/.yaml" Meaning that trusted.certname was empty. It would be empty if the node "nodename.domai

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-24 Thread Dan Crisp
Hello Henrik, thanks for your reply. This file: environment/production/data/nodes/nodename.domain.com.yaml On Monday, February 24, 2020 at 4:26:37 PM UTC, Henrik Lindberg wrote: > > On 2020-02-24 17:06, Dan Crisp wrote: > > Hello all, > > > > Strugling to get started with Hiera (all new to m

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-24 Thread Henrik Lindberg
On 2020-02-24 17:06, Dan Crisp wrote: Hello all, Strugling to get started with Hiera (all new to me): First glance that looks ok, as you can see it is not finding your key in any of the resulting paths. From where (which data file) was it supposed to find the key you looked up? Best, - hen

Re: [Puppet Users] Hiera and precedence

2019-01-18 Thread Henrik Lindberg
On 2019-01-17 18:40, Peter Berghold wrote: I'm having a revertment to my noob days with respect to how hiera works.  (Version 3 for now) If I have the hierarchy of - common - nodes/"%{fqdn}" - datacenter/"%{fdatacenter}" if in common.yaml I have "module::parms::server: server1" and in nodes/

Re: [Puppet Users] Hiera and precedence

2019-01-17 Thread 'Dan White' via Puppet Users
I think you have it bass-ackwards https://puppet.com/docs/puppet/5.0/hiera_hierarchy.html "Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us." Bill Waterson (Calvin & Hobbes) > On Jan 17, 2019, at 12:40 PM, Peter

Re: [Puppet Users] Hiera and nested / reuse variables

2018-07-13 Thread Helmut Schneider
Angel L. Mateo wrote: > El 21/06/18 a las 14:32, Helmut Schneider escribió: > > Hi, > > > > common.yaml: > > > > profiles: > >mailserver: > > postfix: > >instances: > > postfix-in: > >instance_path: '/etc/postfix-in' > >other_path:"%{instance

Re: [Puppet Users] Hiera and nested / reuse variables

2018-06-21 Thread Angel L. Mateo
El 21/06/18 a las 14:32, Helmut Schneider escribió: Hi, common.yaml: profiles: mailserver: postfix: instances: postfix-in: instance_path: '/etc/postfix-in' other_path:"%{instance_path}" <= required Is it possible to nest both variables somehow

Re: [Puppet Users] Hiera: Using multiple facts in one path

2018-06-12 Thread Henrik Lindberg
On 2018-06-13 08:19, Dirk Heinrichs wrote: Hi, is this possible? For example: :hierarchy:   - "kernel/%{::kernel}/%{::kernelmajversion}"   - "kernel/%{::kernel}"   - common yes - henrik Thanks...     Dirk -- Visit my Blog "Puppet on the Edge" http://puppet-on-the-edge

Re: [Puppet Users] hiera lookup

2018-05-31 Thread jcbollinger
On Wednesday, May 30, 2018 at 11:01:40 AM UTC-5, Ugo Bellavance wrote: > > >> >> Of course, where a resource type or class defines default values for its >> parameters and those values meet your requirements, it's fine to rely on >> those. You don't necessarily need to explicitly provide

Re: [Puppet Users] hiera lookup

2018-05-30 Thread Ugo Bellavance
When I leave just the class declaration it works: > > >> class {'postgresql::server::contrib': >> } >> > > > Well if that serves your needs (and it should) then it is better form to > use an include-like declaration instead: > > include 'postgresql::server::contrib' > > But that's mostly a style c

Re: [Puppet Users] hiera lookup

2018-05-30 Thread jcbollinger
On Tuesday, May 29, 2018 at 1:04:10 PM UTC-5, Ugo Bellavance wrote: > > That's awfully surprising if those data appear in an Hiera data file from >> which you are successfully loading other data. If that is in fact >> happening then the most likely reason would be that a resource-like class >

Re: [Puppet Users] hiera lookup

2018-05-29 Thread Ugo Bellavance
> > That's awfully surprising if those data appear in an Hiera data file from > which you are successfully loading other data. If that is in fact > happening then the most likely reason would be that a resource-like class > declaration for that class somewhere in your manifest set is explicitl

Re: [Puppet Users] hiera lookup

2018-05-29 Thread jcbollinger
On Tuesday, May 29, 2018 at 7:25:11 AM UTC-5, Ugo Bellavance wrote: > > > > On Tuesday, May 29, 2018 at 6:55:01 AM UTC-4, Arnau wrote: >> >> >> >> 2018-05-29 12:24 GMT+02:00 Ugo Bellavance : >> >>> >>> >>> On Tuesday, May 29, 2018 at 5:54:54 AM UTC-4, Arnau wrote: Hi, postgres

Re: [Puppet Users] hiera lookup

2018-05-29 Thread Ugo Bellavance
On Tuesday, May 29, 2018 at 6:55:01 AM UTC-4, Arnau wrote: > > > > 2018-05-29 12:24 GMT+02:00 Ugo Bellavance >: > >> >> >> On Tuesday, May 29, 2018 at 5:54:54 AM UTC-4, Arnau wrote: >>> >>> Hi, >>> >>> postgresql::server::contrib::package_name: 'rh-postgresql96-postgresql- >>> contrib' >>> postgr

Re: [Puppet Users] hiera lookup

2018-05-29 Thread Arnau
2018-05-29 12:24 GMT+02:00 Ugo Bellavance : > > > On Tuesday, May 29, 2018 at 5:54:54 AM UTC-4, Arnau wrote: >> >> Hi, >> >> postgresql::server::contrib::package_name: 'rh-postgresql96-postgresql- >> contrib' >> postgresql::server::contrib::packages_ensure: present >> >> > I don't get the error an

Re: [Puppet Users] hiera lookup

2018-05-29 Thread Ugo Bellavance
On Tuesday, May 29, 2018 at 5:54:54 AM UTC-4, Arnau wrote: > > Hi, > > postgresql::server::contrib::package_name: 'rh-postgresql96-postgresql- > contrib' > postgresql::server::contrib::packages_ensure: present > > I don't get the error anymore. It's not doing what it's supposed but I'll look in

Re: [Puppet Users] hiera lookup

2018-05-29 Thread Arnau
Hi, postgresql::server::contrib::package_name: 'rh-postgresql96-postgresql- contrib' postgresql::server::contrib::packages_ensure: present HTH, Arnau 2018-05-29 11:50 GMT+02:00 Ugo Bellavance : > Hi, > > Here's the content of my whole file, thanks: > > --- > > postgresql::globals::client_packag

Re: [Puppet Users] hiera lookup

2018-05-29 Thread Ugo Bellavance
Hi, Here's the content of my whole file, thanks: --- postgresql::globals::client_package_name: 'rh-postgresql96-postgresql' postgresql::globals::createdb_path: '/opt/rh/rh-postgresql96/root/usr/bin/createdb' postgresql::globals::datadir: '/var/opt/rh/rh-postgresql96/lib/pgsql/data' postgresql::

Re: [Puppet Users] hiera lookup

2018-05-29 Thread Arnau
Hi, are you sure the errors is about the contrib? can you show us the hiera content for ' postgresql::server::db' ? Could it be that you have an string when a Hash is expected (for the create_resource). Best, Arnau 2018-05-28 22:19 GMT+02:00 Ugo Bellavance : > Hi, > > I am using the postgresql

Re: [Puppet Users] Hiera brainstorming

2018-05-10 Thread Craig Dunn
On Sun, May 6, 2018 at 9:26 PM, Robert wrote: > > And the problem: sometimes I'd like to have teams to control only a > specific application, on a server which is already delegated to a team. > E.g. the backup admins should be able to configure the backup software's > agent on Oracle *and* webser

Re: [Puppet Users] hiera command line - search with structured facts (key.subkey)

2018-05-02 Thread Louis Coilliot
It works fine for me, thanks ! Sorry, I missed the switch to the new command and the doc here : https://puppet.com/docs/puppet/5.5/hiera_automatic.html#ariaid-title4 I was looking for 'hiera cli' Regards, Louis Coilliot 2018-04-27 19:13 GMT+02:00 Henrik Lindberg : > On 27/04/18 18:12, Louis C

Re: [Puppet Users] hiera command line - search with structured facts (key.subkey)

2018-04-27 Thread Henrik Lindberg
On 27/04/18 18:12, Louis Coilliot wrote: Hello, this work : hiera -d -c /etc/puppetlabs/puppet/hiera.yaml core::packages ::environment=production  ::osfamily=RedHat this does not (at least on my platform) : hiera -d -c /etc/puppetlabs/puppet/hiera.yaml core::packages ::environment=producti

Re: [Puppet Users] Hiera Interpolation of data

2018-03-20 Thread Henrik Lindberg
On 20/03/18 04:19, Gino Lisignoli wrote: Hello I'm using hiera with the http backend (as couchdb) which works for data lookup, but I want to user data interpolation (https://puppet.com/docs/puppet/5.0/hiera_interpolation.html). At the moment I am trying to do a simple test of: | classfoo (

Re: [Puppet Users] hiera key questions, key naming and per-file keys

2018-03-02 Thread Christopher Wood
(inline) On Thu, Mar 01, 2018 at 11:36:40PM +0100, Henrik Lindberg wrote: > On 01/03/18 16:03, Christopher Wood wrote: > > As background, for "reasons" I am looking at individual domains in hiera as > > keys. I do have questions beyond "why would I even". > > > > A) hiera lookup key format > >

Re: [Puppet Users] hiera key questions, key naming and per-file keys

2018-03-01 Thread Henrik Lindberg
On 01/03/18 16:03, Christopher Wood wrote: As background, for "reasons" I am looking at individual domains in hiera as keys. I do have questions beyond "why would I even". A) hiera lookup key format I notice that if I use puppet lookup to test things I get similar behaviour as using lookup()

Re: [Puppet Users] Hiera 5 + Puppet 5 File Backend

2017-08-21 Thread John Baird
Henrik, I would also like to add that having the ability to serve up binary files, not just ASCII files would also be a great bonus. Thanks! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving ema

Re: [Puppet Users] Hiera 5 + Puppet 5 File Backend

2017-08-21 Thread John Baird
Henrik, Thanks for helping... I tried originally using the hiera-file backend but, there's too much code to update since the repo hasn't been touched in nearly 2+ years. So I went down the path of trying to modify the json_data and/or yaml_data backends to suit my needs, since I noticed the bi

Re: [Puppet Users] Hiera 5 + Puppet 5 File Backend

2017-08-21 Thread Henrik Lindberg
On 21/08/17 22:18, John Baird wrote: I see the "yaml_data" and "json_data" backends, but unfortunately, I'm not a Ruby developer and trying to mock those into a file_data backend is proving frustratingly obnoxious.  Honestly, I wish a "file_data" backend was included by default as I feel there

Re: [Puppet Users] Hiera 5 + Puppet 5 File Backend

2017-08-21 Thread John Baird
I see the "yaml_data" and "json_data" backends, but unfortunately, I'm not a Ruby developer and trying to mock those into a file_data backend is proving frustratingly obnoxious. Honestly, I wish a "file_data" backend was included by default as I feel there a TON of value in it's existence, but

Re: [Puppet Users] Hiera 5 + Puppet 5 File Backend

2017-08-21 Thread Henrik Lindberg
On 21/08/17 22:03, John Baird wrote: There was an old hiera 3.X hiera-file backend now owned on github by voxpupuli... does anyone have a working example of how to reproduce this in Puppet 5 with the next data_hash contexts?  Puppet's documentation seems woefully lacking in this area. Basical

Re: [Puppet Users] hiera hierarchy by network

2017-04-28 Thread Nick Fagerlund
Forgot to paste the docs link: https://docs.puppet.com/puppet/latest/hiera_config_yaml_5.html#specifying-file-paths -- 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 emai

Re: [Puppet Users] hiera hierarchy by network

2017-04-28 Thread Nick Fagerlund
I THINK the new mapped_paths feature in Puppet 4.10 can do this, when combined with the networking fact. Um, I think it'd look something like this: hierarchy: - name: "Network interface (tries all interfaces)" mapped_paths: [facts.networking.interfaces, interface, "networks/%{interface.

Re: [Puppet Users] hiera hierarchy by network

2017-04-14 Thread Peter K
Thank you Rob. I've been close to experimenting with custom facts but haven't tried yet. I think I can stick with what I have for now and just watch out of breakage...at which point I'll create a custom fact. -peter -- You received this message because you are subscribed to the Google Groups "

Re: [Puppet Users] hiera hierarchy by network

2017-04-13 Thread Rob Nelson
Try the structured facts. $facts['networking']['network'] is probably somewhat indeterministic, but if your interface names are predictable, then $facts['networking']['interfaces']['ens192']['network'] (or 'eth0' or whatever) could conceivably be the value you need. Having tried to fight with this

Re: [Puppet Users] hiera level explosion

2017-03-21 Thread Henrik Lindberg
On 20/03/17 16:03, Darragh Bailey wrote: Hi, Looking at how our hiera levels are already exploding due to some preferences, I'm wondering how others describe use hiera. We have a preference to group related data within separate files, however some colleague concerns about using '%{module_name}

Re: [Puppet Users] hiera level explosion

2017-03-21 Thread Darragh Bailey
Hi Rob, Thanks for some of the suggestions, I suspect part of our problem is that we have multiple applications/services deployed per node using docker containers. We probably can't easily map a single role per machine because we want to be able to move the application/services between machin

Re: [Puppet Users] hiera level explosion

2017-03-20 Thread Rob Nelson
If you're looking up hiera data based on the calling class, I'd question whether that's useful to split out to hiera at all - every instance of the class would get the same values, right? And would you really want ALL nodes that `include jenkins` to get the same jenkins server? Even if they're in D

Re: [Puppet Users] Hiera 5 calling_class

2017-02-10 Thread Henrik Lindberg
On 10/02/17 14:10, Ben Hines wrote: Okay, thanks! From reading changelogs in git it looked like it was intended to be supported. It is supported when using hiera.yaml version 3 as we must keep that backwards compatible. It might be worth mentioning in the release notes. yes, will make sur

Re: [Puppet Users] Hiera 5 calling_class

2017-02-10 Thread Ben Hines
Okay, thanks! From reading changelogs in git it looked like it was intended to be supported. It might be worth mentioning in the release notes. Anyway in my case i can work around with module data. thanks! -Ben On Fri, Feb 10, 2017 at 1:39 PM, Henrik Lindberg wrote: > On 08/02/17 17:55, Ben H

Re: [Puppet Users] Hiera 5 calling_class

2017-02-10 Thread Henrik Lindberg
On 08/02/17 17:55, Ben Hines wrote: Perhaps this is just a bug, but does %{calling_class} function with Hiera 5? I haven't been able to get it to function. Perhaps it has a new syntax? It is deliberately not supported in the hiera 5 format. - henrik Notice it's blank: ==> test: Hier

Re: [Puppet Users] Hiera behaviour in PE 2016.5

2017-01-10 Thread Rob Nelson
On Tue, Jan 10, 2017 at 5:17 AM, Jonathan Gazeley < jonathan.gaze...@bristol.ac.uk> wrote: > $staticifs = lookup({"name" => "::network::if::static", "value_type" => > "hash", "default_value" => "default"}) The failure implies that it cannot find a value for `network::if::static` but your request

Re: [Puppet Users] hiera & profile & roles

2016-12-05 Thread Albert Shih
Le 16/11/2016 à 10:51:39+0100, Craig Dunn a écrit Hi, > > class { "my_application": > >   tomcat_root => $::tomcat::catalina_home > > } > > SUPER nice. > > I didn't think about that > > Don't know why but I always thought that was « bad practice » to access >

Re: [Puppet Users] Hiera 4 problems

2016-11-30 Thread Jonathan Gazeley
On 30/11/16 16:17, Henrik Lindberg wrote: - name: "Module" backend: yaml path: "module/%{calling_module}" The above does not work. It is not how it should be done. You should place the data in the module instead. You cannot vary what is bound to a key based on the caller. (super bad

  1   2   3   4   5   >