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

Re: [Puppet Users] puppetlabs/accounts - separate user list and declaration of users

2020-09-21 Thread Henrik Lindberg
On 2020-09-20 16:31, Devminded wrote: Hi. We are using the *puppetlabs/accounts* module to setup user accounts and SSH keys but finds it lacking. We are using *Hiera* and have divided users up by role, type of machine and region/environment. The issue here is that if a user should exist on

Re: [Puppet Users] parsejson is removing all back slashes that are returned from puppet task

2020-09-13 Thread Henrik Lindberg
On 2020-09-13 18:40, Raghu Ram Baisani wrote: Hi I'm returning a JSON output from the puppet task which is written in PowerShell(.ps1) file. The output returned from the task is a JSON value. I have a plan in which I'm calling puppet task which is written in PowerShell and after getting the

Re: [Puppet Users] Is "Sensitive" broken?

2020-09-11 Thread Henrik Lindberg
On 2020-09-11 20:52, Josh Cooper wrote: On Wed, Sep 9, 2020 at 11:16 PM 'Dirk Heinrichs' via Puppet Users mailto:puppet-users@googlegroups.com>> wrote: Am Mittwoch, den 09.09.2020, 08:59 -0700 schrieb Josh Cooper: The issue you're running into is due to the sensitive value being

Re: [Puppet Users] Puppet Unrecognized escape sequence

2020-09-11 Thread Henrik Lindberg
On 2020-09-11 08:03, alexey@gmail.com wrote: Hi everyone! I receive warnings in the logs, I would like to know how I can ignore these warnings so that they are not written to the log? This is a block of code calling the executable file, each time it is called, I get 3 entries in the log:

Re: [Puppet Users] Re: I'm struggling with some node specific heria

2020-08-01 Thread Henrik Lindberg
, Henrik Lindberg wrote: On 2020-07-31 19:41, A Manzer wrote: > Did you update site.pp to use the include syntax? That is not needed to make automatic parameter lookup to work. - henrik -- Visit my Blog "Puppet on the Edge" http://puppet-on-the-edg

Re: [Puppet Users] Re: I'm struggling with some node specific heria

2020-07-31 Thread Henrik Lindberg
On 2020-07-31 19:41, A Manzer wrote: Did you update site.pp to use the include syntax? That is not needed to make automatic parameter lookup to work. - henrik -- Visit my Blog "Puppet on the Edge" http://puppet-on-the-edge.blogspot.se/ -- You received this message because you are

Re: [Puppet Users] reversing the processing sequence of hiera data

2020-07-15 Thread Henrik Lindberg
) The reverse_each function only iterates over the top level (and in reverse) so impossible that it inverts everything that is nested. - henrik Best regards Frank Am Montag, 22. Juni 2020 15:41:56 UTC+2 schrieb Henrik Lindberg: On 2020-06-16 13:56, 'Frank Ihringer' via Puppet Users

Re: [Puppet Users] Question about Deferred functions

2020-07-07 Thread Henrik Lindberg
On 2020-07-03 14:09, Vincent Lamers wrote: Hi All, as I understood a Deferred function is invoked as the first part of enforcing a catalog. I have a deferred function which depends on the results of a certain resource. So I have to make sure the resource is applied before the deferred

Re: [Puppet Users] reversing the processing sequence of hiera data

2020-06-22 Thread Henrik Lindberg
On 2020-06-16 13:56, 'Frank Ihringer' via Puppet Users wrote: hello I/'/m just taking my first steps with puppet and aws (puppetlabs/aws module). Setting up resources (controlled by hiera)  works fine (using .each loop). But if I want to delete the resources afterwards (with absent) I get

Re: [Puppet Users] Array shuffle

2020-06-11 Thread Henrik Lindberg
There are a couple of ways to achieve this. You can write a shuffle function in Ruby, take a copy of the input array and return a shuffled copy using Fischer-Yate algorithm. Or write in Puppet using random numbers and sorting. Create an array of equal length of the original, containing

Re: [Puppet Users] puppet catalog security?

2020-03-28 Thread Henrik Lindberg
On 2020-03-28 16:23, Matt Zagrabelny wrote: On Sat, Mar 28, 2020 at 10:05 AM Henrik Lindberg mailto:henrik.lindb...@puppet.com>> wrote: On 2020-03-28 14:36, Matt Zagrabelny wrote: > > > On Sat, Mar 28, 2020 at 7:31 AM Henrik Lindberg > m

Re: [Puppet Users] puppet catalog security?

2020-03-28 Thread Henrik Lindberg
On 2020-03-28 14:36, Matt Zagrabelny wrote: On Sat, Mar 28, 2020 at 7:31 AM Henrik Lindberg mailto:henrik.lindb...@puppet.com>> wrote: On 2020-03-28 02:42, Matt Zagrabelny wrote: > Greetings, > > Suppose I have a class foo that host A gets via its c

Re: [Puppet Users] puppet catalog security?

2020-03-28 Thread Henrik Lindberg
On 2020-03-28 02:42, Matt Zagrabelny wrote: Greetings, Suppose I have a class foo that host A gets via its catalog. Suppose host B does not have foo in its catalog. Can host B do anything malicious to obtain the sensitive data in foo? My puppet master is using an ENC to generate the

Re: [Puppet Users] Access variable defined in each {}

2020-03-19 Thread Henrik Lindberg
On 2020-03-19 22:11, Helmut Schneider wrote: Hi, class abc {   keys($netconfig['interfaces']).each |String $interface| {     if $netconfig['interfaces'][$interface]['ip6'] {   $myvariable = 'yes'   break()     }   }   if $myvariable == 'yes' {     do something   } } How can I

Re: [Puppet Users] Nested interpolation

2020-03-13 Thread Henrik Lindberg
On 2020-03-13 10:45, Helmut Schneider wrote: Hi, I'm using something like this: netconfig:   hostname:    'BSDHelmut'   interfaces:     "%{facts.networking.primary}":   ip4:     '192.168.124.35'   cidr4:    '192.168.124.35/24'   ip4aliases:     -

Re: [Puppet Users] Knocking out values

2020-03-09 Thread Henrik Lindberg
On 2020-03-07 17:53, Helmut Schneider wrote: Hi, using Puppet 5.5 and Hiera 3.4.6: common.yaml: profiles:   webserver:     apache:   server:     modules:   enable:     - mpm_event     - status host.yaml: profiles:   webserver:     apache:  

Re: [Puppet Users] Questions reg. Hiera v3 to v5 migration

2020-03-03 Thread Henrik Lindberg
On 2020-03-03 11:17, Dirk Heinrichs wrote: Hi, while reading through the documentation about migrating to Hiera v5, the following questions came to my mind: * Can /hiera.yaml be a symlink? Our setup is as such that each subdirectory (modules, manifests, hiera) of each environment is

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-26 Thread Henrik Lindberg
t 12:58:02 PM UTC, Henrik Lindberg wrote: 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

Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-02-25 Thread Henrik Lindberg
    Path not found     Hierarchy entry "Common data"       Path "/etc/puppetlabs/code/environments/production/data/common.yaml"         Original path: "common.yaml"         Path not found Function lookup() did not find a value for the name 'match_address' Still no luck

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

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, -

Re: [Puppet Users] Could not find data item in any Hiera data file

2020-02-05 Thread Henrik Lindberg
You can try using the lookup CLI tool with --explain turned on to get detailed information about exactly what hiera is reading and what decisions it is making when producing a value (or not finding anything). You can also get that level of detail in your logs by running the server with --debug

Re: [Puppet Users] RFE Proposal: lookup_options in the manifest

2019-12-12 Thread Henrik Lindberg
On 2019-12-12 02:59, Alan Evans wrote: I love Automatic Parameter Lookup (APL) and hiera in general.  But one thing I have found awkward is that `lookup_options` are found in the hiera data.  In general the idea is to separate data from code right? Exactly, and that is why the options should

Re: [Puppet Users] Re: Hiera value not being passed

2019-10-04 Thread Henrik Lindberg
64b362083d182a1' Notice: Applied catalog in 0.03 seconds -- Am I missing something? On Thursday, October 3, 2019 at 2:47:25 AM UTC-7, Henrik Lindberg wrote: On 2019-10-02 23:21, Jagga Soorma wrote: > Looks like I figured it out.  I was passing the hiera variable &

Re: [Puppet Users] Re: Hiera value not being passed

2019-10-03 Thread Henrik Lindberg
On 2019-10-02 23:21, Jagga Soorma wrote: Looks like I figured it out. I was passing the hiera variable incorrectly. Changed from passing in to class String $nodetype, to $nodetype=hiera('nodetype') Note that all functions starting with "hiera" are deprecated. Use the "lookup()" function

Re: [Puppet Users] accessing out of class/scope variables in template

2019-08-16 Thread Henrik Lindberg
On 2019-08-16 16:31, Matt Zagrabelny wrote: Hello, I'm running puppet 5.5 OSE. I've got a class foo: class foo {     $bar = 'hi' } class foo::configure {     file { '/tmp/foo.conf':         content => template('foo/foo.conf.erb'),     } } and then in the template: <%= scope['foo::bar']

Re: [Puppet Users] Sensitive type?

2019-06-21 Thread Henrik Lindberg
On 2019-06-20 13:31, Jason McMahan wrote: Good day, We were attempting to secure passwords appearing in files. In the node manifest we changed $password = lookup("user_cred.${username}.${domain_lookup}.password")) to $password =

Re: [Puppet Users] merging hashes with puppet lookup function

2019-06-10 Thread Henrik Lindberg
On 2019-06-09 02:34, Chris Southall wrote: I'm trying to merge hiera hashes using the lookup function as described here: https://puppet.com/docs/puppet/5.5/hiera_automatic.html#puppet-lookup Here's my test: Hiera config file: == --- version: 5 defaults:   datadir:

Re: [Puppet Users] class invocation conflicts

2019-05-20 Thread Henrik Lindberg
On 2019-05-20 18:57, Peter Berghold wrote: So here I am I have a base profile for my Ubuntu (Debian family) machines that invokes the class class{'apt':     ... some paramters } I then invoke the class class{'postgresql': } and now Puppet is screaming that the class 'apt' cannot be invoked

Re: [Puppet Users] help with Hello world puppet file

2019-05-12 Thread Henrik Lindberg
, Asmae Le dim. 12 mai 2019 à 14:55, Henrik Lindberg mailto:henrik.lindb...@puppet.com>> a écrit : On 2019-05-12 01:06, Asmae Azbeg wrote: > Hi everyone , > i installed puppet server and agent version 5.5.10. The communication

Re: [Puppet Users] help with Hello world puppet file

2019-05-12 Thread Henrik Lindberg
On 2019-05-12 01:06, Asmae Azbeg wrote: Hi everyone , i installed puppet server and agent version 5.5.10. The  communication was successful and i want to crreate and deploy the hello warld file but it was'nt working. I followed the steps in this link:

Re: [Puppet Users] converting Puppet reports to JUnit

2019-05-10 Thread Henrik Lindberg
On 2019-05-10 14:44, Luke Bigum wrote: Hello, Has anyone had the need to convert Puppet's YAML reports into another format, such as JUnit XML?  I'm thinking of taking the reports of Acceptance test runs of Roles (potentially thousands of resources), and parsing them into reports for a CI

Re: [Puppet Users] Replace some text

2019-04-08 Thread Henrik Lindberg
On 2019-04-07 14:47, KRouth Clinipace wrote: Question - is it possible to use the puppet regsubst function in place of the exec used here (to save spawning a new shell process) ? kevin Well, functions are ordinary on the compiling side. If you can figure out what to do when compiling that

Re: [Puppet Users] Syntax of a class reference in Hiera

2019-03-12 Thread Henrik Lindberg
On 2019-03-12 18:09, Stephen Kenny wrote: I want to create a directory that will contain NFS mount points. Therefore, it makes sense to have it in place before any of the NFS-related Puppet stuff.  I can do it in either of two ways. 1. In a manifest, with a regular file resource, which

Re: [Puppet Users] Referencing Deferred functions in Puppet Code or Hiera YAML

2019-03-12 Thread Henrik Lindberg
getting what you want is to write your own custom ruby function that does the unwrap and dig. And lastly - you could avoid having to dig out a detailed value and instead look it up separately. - henrik On Friday, March 8, 2019 at 8:43:55 PM UTC+11, Henrik Lindberg wrote: On 201

Re: [Puppet Users] Referencing Deferred functions in Puppet Code or Hiera YAML

2019-03-08 Thread Henrik Lindberg
the following: message => Deferred('get', [$secret_lookup, 'mysql_root_password']) To get what I think you want. - henrik On Thursday, February 28, 2019 at 4:29:15 AM UTC+11, Henrik Lindberg wrote: On 2019-02-27 00:01, comport3 wrote: > Hi Henrik and Group, > >

Re: [Puppet Users] Problem querying PuppetDB from within a Puppet class

2019-02-28 Thread Henrik Lindberg
On 2019-02-28 16:12, Henrik Lindberg wrote: Where in documentation did you get that example? It is wrong so needs to be corrected. You definitively need to use `map` to map the result to what you want. Already fixed in later versions of the documentation: ticket is here: https

Re: [Puppet Users] Problem querying PuppetDB from within a Puppet class

2019-02-28 Thread Henrik Lindberg
On 2019-02-28 14:46, Dirk Heinrichs wrote: Am Donnerstag, den 28.02.2019, 13:53 +0100 schrieb Henrik Lindberg: On 2019-02-28 13:37, Dirk Heinrichs wrote: following the example in the PuppetDB documentation, I tried this code: $debian_nodes_query = 'nodes[certname]{facts{name

Re: [Puppet Users] Problem querying PuppetDB from within a Puppet class

2019-02-28 Thread Henrik Lindberg
On 2019-02-28 13:37, Dirk Heinrichs wrote: Hi, following the example in the PuppetDB documentation, I tried this code: $debian_nodes_query = 'nodes[certname]{facts{name = "operatingsystem" and value = "Debian"}}' $debian_nodes = puppetdb_query($debian_nodes_query).each |$value| { The line

Re: [Puppet Users] Referencing Deferred functions in Puppet Code or Hiera YAML

2019-02-27 Thread Henrik Lindberg
On 2019-02-27 00:01, comport3 wrote: Hi Henrik and Group, Thank you very much, this sounds like exactly what we are after. After reviewing https://puppet.com/docs/puppet/6.3/hiera_custom_backends.html we are a little lost as to how to get started. Does anyone have any example code of using a

Re: [Puppet Users] Referencing Deferred functions in Puppet Code or Hiera YAML

2019-02-20 Thread Henrik Lindberg
of: { some_key => Deferred('vault_lookup', [params, ...]), some_other_key => Deferred(...) } The hiera 5 documentation should show how to write those functions. Also checkout video of my Hiera 5 talk from Puppetconf and ConfigMgmntCamp. best, - henrik On Wed, Feb 20, 2019, 4:42 AM

Re: [Puppet Users] Referencing Deferred functions in Puppet Code or Hiera YAML

2019-02-19 Thread Henrik Lindberg
On 2019-02-18 01:17, comport3 wrote: Does anyone have any real world examples of referencing Deferred lookups, either in Puppet code or Hiera that you could share? Vault Lookup shows examples of how to use it to lookup secrets on the agent side.

Re: [Puppet Users] Puppetserver 6.0.2 timeouts in the puppetserver log and on the agent side

2019-02-12 Thread Henrik Lindberg
to look at the stacktrace you get when the timeout occur. This to figure out what it is that is timing out. Best, - henrik On Monday, February 11, 2019 at 2:06:11 PM UTC-6, Henrik Lindberg wrote: On 2019-02-11 14:42, Mike Sharpton wrote: > Hey all, > > We have recently

Re: [Puppet Users] Puppetserver 6.0.2 timeouts in the puppetserver log and on the agent side

2019-02-11 Thread Henrik Lindberg
On 2019-02-11 14:42, Mike Sharpton wrote: Hey all, We have recently upgraded our environment from Puppetserver 4.2.2 to Puppetserver 6.0.2.  We are running a mix of Puppet 4 and Puppet 6 agents until we can get them all upgraded to 6.  We have around 6000 nodes, and we had 4 Puppetservers,

Re: [Puppet Users] knockout_prefix

2019-02-09 Thread Henrik Lindberg
Judging from the version of Puppet Server you are on a version of Puppet that has reached EOL. The hiera 5 support with features like lookup_options was released late in the Puppet 4.x series but had some issues before stabilizing in Puppet 5. Can you try this with a newer puppet version? If

Re: [Puppet Users] Replacing extlookup to look up external things!

2019-01-31 Thread Henrik Lindberg
On 2019-01-30 01:16, Ben Ford wrote: Your simplest and most straightforward upgrade path would be to port the CSV file to a common.yaml file and then switch to using lookup() with hieradata. Later on, you can start differentiating and build a sane data hierarchy. Check out the docs at

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

Re: [Puppet Users] Ternary operator in puppet ?

2019-01-16 Thread Henrik Lindberg
On 2019-01-16 11:18, Karsten Heymann wrote: Hi Albert, Am Mi., 16. Jan. 2019 um 11:09 Uhr schrieb Albert Shih : Is they are something like the ruby ternary operator ?: in puppet ? Sort of, it's called selectors: https://puppet.com/docs/puppet/5.3/lang_conditional.html#selectors You can

Re: [Puppet Users] Concerns about Puppet 4 master serving Puppet 3 clients

2019-01-14 Thread Henrik Lindberg
On 2019-01-14 16:22, Peter Berghold wrote: I am about to have our first Puppet 4 Puppet master into our production environment. We have a very large community of Puppet 3 "leaf nodes" being managed by our old Puppet 3 infrastructure. What issues might I run into with that and what should I do

Re: [Puppet Users] PuppetDB exported resources with hiera-eyaml

2019-01-10 Thread Henrik Lindberg
On 2019-01-10 10:56, Jocelyn Thode wrote: Hey, I'm trying to use exported resources where one of the parameter of the resource is a variable from hiera. This variable is retrieved using automatic lookup and is encrypted in hiera using hiera-eyaml. However when the ressource is exported

Re: [Puppet Users] Re: leading double colons (::) for class instances

2019-01-08 Thread Henrik Lindberg
On 2019-01-08 15:16, jcbollinger wrote: On Monday, January 7, 2019 at 3:37:46 PM UTC-6, Matt Zagrabelny wrote: On Mon, Jan 7, 2019 at 3:31 PM Matt Zagrabelny > wrote: Greetings puppet-users! For many years I have been using the following convention for

Re: [Puppet Users] Elegant way to supply facts to `puppet apply`

2018-11-26 Thread Henrik Lindberg
On 2018-11-23 03:27, Abhijeet Rastogi wrote: Hi everyone, puppet lookup command has a nice --facts option which accepts a structured json/yaml file to upload files. Why does that option not exist for puppet apply? Is the environment variable the only option? There is a way to make it

Re: [Puppet Users] while installing apache in puppet5 getting below error

2018-11-12 Thread Henrik Lindberg
On 2018-11-12 18:06, vinodkumar mannem wrote: I have new to puppet.I am trying to install appache using puppet code but getting below error. please help me how to resolve this issue. Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: A

Re: [Puppet Users] create an array of hashes with reduce

2018-11-07 Thread Henrik Lindberg
On 2018-11-07 10:40, Arnau wrote: Hi Henrik, first of all, thanks for your answer. El mar., 6 nov. 2018 a las 20:12, Henrik Lindberg (mailto:henrik.lindb...@puppet.com>>) escribió: [...] > $dirs = ['static','media','photos'] > $proxy = $dirs.reduce([ { 'path'

Re: [Puppet Users] create an array of hashes with reduce

2018-11-06 Thread Henrik Lindberg
On 2018-11-06 17:13, Arnau wrote: Hi all, I'm using puppet 5.3. I'd like to build proxy_pass array of hashes using the /reduce /puppetbuilt-in function and picking the values from a nested hash in hiera. I first played a little bit

Re: [Puppet Users] Set default param value based on another param

2018-10-08 Thread Henrik Lindberg
ld need to (very tediously) be repeated for every parameter. New syntax in the language would be needed to support this a better way (i.e. very long fuse on that...) Best advice; be explicit about defaults, and get them via hiera and use APL. Hope something of this is of value. Best, - henrik /Eirik On 7

Re: [Puppet Users] Set default param value based on another param

2018-10-07 Thread Henrik Lindberg
If you are on a reasonably modern Puppet version you should do it like this: class myclass( String $base_dir, Optional[String] $conf_dir = "${base_dir}/conf" ) { } I tested it as well: class myclass( String $base_dir, Optional[String] $conf_dir = "${base_dir}/conf" ) {

Re: [Puppet Users] Remove key from hash

2018-09-21 Thread Henrik Lindberg
On 2018-09-20 10:17, Albert Shih wrote: Le 19/09/2018 à 16:00:20+0200, Henrik Lindberg a écrit On 2018-09-19 15:24, Albert Shih wrote: I'm would like to have a profile for example for apache. profile::apache who can pass some hash to apache. For example let's say I've profile

Re: [Puppet Users] Re: hiera can't find facts to read hierarchy files?

2018-09-19 Thread Henrik Lindberg
On 2018-09-19 17:41, ch...@fuzzyblender.com wrote: Hi Sean, I'm having the same issue, and I see what you said, I'm just too new to puppet.  Would it be possible for you (or others) to expand on how you fixed this (with and example)? Chris I had responded to Sean in an email - reposting

Re: [Puppet Users] Remove key from hash

2018-09-19 Thread Henrik Lindberg
On 2018-09-19 15:24, Albert Shih wrote: Hi, I'm would like to have a profile for example for apache. profile::apache who can pass some hash to apache. For example let's say I've profile::apache::vhosts: vhost1: vhost2: and I want to do class

Re: [Puppet Users] Re: Exported resource realized by resource collector, bug?

2018-09-14 Thread Henrik Lindberg
hat most users end up doing when their use case is not super trivial and works with the limitations of the collectors. Best, - henrik Thanks On Fri, Sep 14, 2018 at 8:07 AM Henrik Lindberg mailto:henrik.lindb...@puppet.com>> wrote: On 2018-09-14 14:47, jcbollinger wrote: &

Re: [Puppet Users] Re: Exported resource realized by resource collector, bug?

2018-09-14 Thread Henrik Lindberg
On 2018-09-14 14:47, jcbollinger wrote: On Friday, September 14, 2018 at 3:10:59 AM UTC-5, Johan De Wit wrote: Hi, check this ticket. https://tickets.puppetlabs.com/browse/PUP-6723 It is hard to explain, but the 'and' a

Re: [Puppet Users] Re: Exported resource realized by resource collector, bug?

2018-09-14 Thread Henrik Lindberg
On 2018-09-14 10:10, Johan De Wit wrote: Hi, check this ticket. https://tickets.puppetlabs.com/browse/PUP-6723 It is hard to explain, but the 'and' a resource collector does niot behave like the 'boolean and' as we expect this. It is not AND that is different; it is the == and != query

Re: [Puppet Users] New Deferred type and agent data lookups in Puppet 6

2018-09-01 Thread Henrik Lindberg
On 2018-09-01 01:40, Rob Nelson wrote: This sounds great. My only concern is that I don’t see tests mentioned in the example. Will rspec-puppet be updated at the same time so that we can test deferred functions out of the gate? If so, I’d love to see what that looks like, in case we have any

Re: [Puppet Users] user resource on darwin throws "undefined method `each' for nil:NilClass"

2018-08-31 Thread Henrik Lindberg
On 2018-08-31 20:23, Peter K wrote: I'm getting this error when I try and create a user on osx: '''Error: Failed to apply catalog: undefined method `each' for nil:NilClass''' My code looks like this: '''  class fakeadmin2 {   user { 'fakeadmin2':     name    => 'fakeadmin2',     ensure 

Re: [Puppet Users] Re: New Deferred type and agent data lookups in Puppet 6

2018-08-31 Thread Henrik Lindberg
down to the fact that your configuration state will no longer be fully represented in the catalog. So make sure you account for that when evaluating your options. [1] https://forge.puppet.com/binford2k/node_encrypt On Fri, Aug 31, 2018 at 10:42 AM Henrik Lindberg mailto:henrik.lindb

Re: [Puppet Users] Re: New Deferred type and agent data lookups in Puppet 6

2018-08-31 Thread Henrik Lindberg
On 2018-08-31 13:33, bert hajee wrote: Lindsy, Is it just ment for this use case? I can think of other situations where in might be vary valuable to fetch a value at run-time on the agent. Now whenever we have to get the current state, we need to make a fact. If we can make deferred

Re: [Puppet Users] Re: New Deferred type and agent data lookups in Puppet 6

2018-08-31 Thread Henrik Lindberg
On 2018-08-31 15:12, R.I.Pienaar wrote: On Fri, 31 Aug 2018, at 15:03, Chadwick Banning wrote: Would it be safe to consider this in a general context i.e. as enabling agent-side function execution? I dont think so - for general function calls to be usable you want to get the value and then

Re: [Puppet Users] Re: New Deferred type and agent data lookups in Puppet 6

2018-08-31 Thread Henrik Lindberg
On 2018-08-31 18:28, R.I.Pienaar wrote: On Fri, 31 Aug 2018, at 17:41, Chadwick Banning wrote: So for this example, there are some sort of limitations as to what the 'vault_lookup' function is able to do internally? I had just assumed that as long as the function returned a simple value, what

Re: [Puppet Users] Recent 5.5.x point releases are throwing some warnings for me

2018-08-29 Thread Henrik Lindberg
On 2018-08-29 15:11, jcbollinger wrote: On Tuesday, August 28, 2018 at 12:13:15 PM UTC-5, kris.b...@puppet.com wrote: Hi Jon, As you have read, this is part of our work implementing errors to enforce the standards set down in PUP-1434.  In particular, your example

Re: [Puppet Users] Issue with lookup / hiera in yaml

2018-08-16 Thread Henrik Lindberg
On 2018-08-16 15:51, Helmut Schneider wrote: Henrik Lindberg wrote: If your data looks like this: variables: baculaWorkingDirectory: '/var/lib/bacula' Then you do not have a variables.debug key - you can lookup variables, or variables.baculaWorkingDirectory common.yaml

Re: [Puppet Users] Issue with lookup / hiera in yaml

2018-08-16 Thread Henrik Lindberg
On 2018-08-16 14:47, Helmut Schneider wrote: Helmut Schneider wrote: common.yaml: variable: baculaWorkingDirectory: '/var/lib/bacula' variables: baculaWorkingDirectory: '/var/lib/bacula' config.pp: [...] $variables = lookup({ "name" => "variables", "merge" => {

Re: [Puppet Users] Help pulling data from hiera hash

2018-07-24 Thread Henrik Lindberg
On 2018-07-24 03:17, Nick Hasser wrote: I am required to configure FreeRADIUS with a white list of authorized MACs that are allowed on my network. I currently have a module that uses a file resource to drop the authorized_macs file selected by hostname of the server from my modules file

Re: [Puppet Users] epp: has_key

2018-07-19 Thread Henrik Lindberg
On 2018-07-19 17:15, Helmut Schneider wrote: Hi, --- profiles: vpn: openvpn: defaults: client: dev: 'tun' proto: 'udp' resolv-retry: 'infinite' nobind: user: 'nobody'

Re: [Puppet Users] undef / nil / empty in template

2018-07-16 Thread Henrik Lindberg
On 2018-07-16 10:21, Helmut Schneider wrote: Henrik Lindberg wrote: On 2018-07-15 15:45, Helmut Schneider wrote: <%- | Hash $openvpnConf, It is important that there is no text before the opening <%- Not sure if you have a blank line there. If so you will get a syntax error b

Re: [Puppet Users] undef / nil / empty in template

2018-07-15 Thread Henrik Lindberg
On 2018-07-15 15:45, Helmut Schneider wrote: Henrik Lindberg wrote: On 2018-07-14 13:47, Johan Fleury wrote: I meant bool2str, sorry. https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/README.md#bool2str Helmut, before digging yourself deeper into problems by using work around

Re: [Puppet Users] undef / nil / empty in template

2018-07-15 Thread Henrik Lindberg
On 2018-07-14 13:47, Johan Fleury wrote: I meant bool2str, sorry. https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/README.md#bool2str Helmut, before digging yourself deeper into problems by using work around on top of problems - do consider using EPP since it protects you from

Re: [Puppet Users] undef / nil / empty in template

2018-07-13 Thread Henrik Lindberg
On 2018-07-13 19:39, Helmut Schneider wrote: Christopher Wood wrote: Nice catch, wouldn't have figured on that. You gave the hint with "if value.is_a? String" ;) And now? Is that expected? What can I do, "if @openvpnConf[parameter].is_a? Symbol"?! And what is a symbol and how do I check if

Re: [Puppet Users] inline_template not working after migrated to puppet5

2018-07-09 Thread Henrik Lindberg
On 2018-07-09 18:12, Suresh P wrote: Hi, I used following code in puppet3.8.x,  it worked well. After i migrated to Puppet5 it throws error. $header="LD_LIBRARY_PATH=$destdir:\$LD_LIBRARY_PATH\n\nexport LD_LIBRARY_PATH\n" $content = inline_template('<%= header+"\n"+ports.map {|port|

Re: [Puppet Users] inline_template not working after migrated to puppet5

2018-07-09 Thread Henrik Lindberg
On 2018-07-09 19:06, Henrik Lindberg wrote: On 2018-07-09 18:12, Suresh P wrote: Hi, I used following code in puppet3.8.x,  it worked well. After i migrated to Puppet5 it throws error. $header="LD_LIBRARY_PATH=$destdir:\$LD_LIBRARY_PATH\n\nexport LD_LIBRARY_PATH\n"

Re: [Puppet Users] inline_template not working after migrated to puppet5

2018-07-09 Thread Henrik Lindberg
On 2018-07-09 18:12, Suresh P wrote: Hi, I used following code in puppet3.8.x,  it worked well. After i migrated to Puppet5 it throws error. $header="LD_LIBRARY_PATH=$destdir:\$LD_LIBRARY_PATH\n\nexport LD_LIBRARY_PATH\n" $content = inline_template('<%= header+"\n"+ports.map {|port| You

Re: [Puppet Users] class parameters that depend on other parameters

2018-06-13 Thread Henrik Lindberg
On 2018-06-12 22:14, Tim Mooney wrote: In regard to: Re: [Puppet Users] class parameters that depend on other...: On 2018-06-12 00:55, Tim Mooney wrote: [snip some of my original context] Here's an example: modules/sandbox/manifests/init.pp: # # This module exists only to serve as a

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

2018-06-13 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"

Re: [Puppet Users] class parameters that depend on other parameters

2018-06-12 Thread Henrik Lindberg
On 2018-06-12 00:55, Tim Mooney wrote: Hi All! We've been long-time users of puppet (opensource).  A lot of our home-grown modules were written to use direct hiera() calls (and before that extlookup()) for loading config.  Because of prior limitations with class parameters, we also mostly

Re: [Puppet Users] Dealing with hashes (again)

2018-05-09 Thread Henrik Lindberg
On 09/05/18 13:36, Arnau wrote: Hi all, I  have a hash of hashes in hiera: cb_data_sync:   localdata:     peers: peer1 peer2     source: /data/1     target: /data/2     ssh_key:       key: XYZ       type: ssh-rsa       user: root Then, in a main class, I call a define using the above

Re: [Puppet Users] converting Hiera v3 to v5 - :merge_behavior: deeper option?

2018-05-01 Thread Henrik Lindberg
On 01/05/18 17:00, jcbollinger wrote: CORRECTION: On Tuesday, May 1, 2018 at 9:52:31 AM UTC-5, jcbollinger wrote: | $hash_merge_behavior =lookup(':merge_behavior',String,'unique','hash') | ... but of course, I meant |$hash_merge_behavior = 

Re: [Puppet Users] converting Hiera v3 to v5 - :merge_behavior: deeper option?

2018-04-30 Thread Henrik Lindberg
On 30/04/18 15:18, jcbollinger wrote: On Saturday, April 28, 2018 at 7:29:29 AM UTC-5, Henrik Lindberg wrote: On 28/04/18 13:21, du wrote: > Thanks all for the responses > > I realise that the global option is no longer there and I am trying to >

Re: [Puppet Users] converting Hiera v3 to v5 - :merge_behavior: deeper option?

2018-04-28 Thread Henrik Lindberg
On 28/04/18 13:21, du wrote: Thanks all for the responses I realise that the global option is no longer there and I am trying to set v5 up so that I can get the similar behaviour. On Friday, April 27, 2018 at 6:12:32 PM UTC+1, Henrik Lindberg wrote: Depends on what you mean. The 'deep

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

Re: [Puppet Users] converting Hiera v3 to v5 - :merge_behavior: deeper option?

2018-04-27 Thread Henrik Lindberg
On 27/04/18 17:34, du wrote: Hi I am in the process of migrating v3 hiera.yaml to v5 and I would like all hash merges to merge 'deep' by default, the same way :merge_behavior: deeper in v3 parameter provides. I can't seem to find an easy way to do this after reading the docs - I

Re: [Puppet Users] concating a string from itself

2018-04-24 Thread Henrik Lindberg
On 24/04/18 20:55, Ryan Murphy wrote: So I've hit a limitation in puppet where I can't modify a variable after its been set.  how do I work around this.  I have a manifest that I need to be able to build up a list of contacts based on certain facts about a server. Here is an example of my

Re: [Puppet Users] Accessgin facts hash from manifests

2018-04-23 Thread Henrik Lindberg
On 23/04/18 08:33, Johan De Wit wrote: first notify, the index should be quoted notify { "OS: $facts['os']['family']": } That us unfortunately wrong - it will produce the entire $facts hash as a string followed by the *text* "['os']['family']". The correct way is to write: notify {

Re: [Puppet Users] Is freeze_main supposed to work this way?

2018-04-17 Thread Henrik Lindberg
On 17/04/18 16:46, jcbollinger wrote: On Tuesday, April 17, 2018 at 12:57:19 AM UTC-5, Henrik Lindberg wrote: I just fixed a bug regarding freeze_main that was found when an autoloaded class/define made use of a not already loaded custom data type. The logic raising the error

Re: [Puppet Users] Is freeze_main supposed to work this way?

2018-04-16 Thread Henrik Lindberg
On 17/04/18 00:10, jcbollinger wrote: This Puppet 5.4.0 error message wraps up the situation in a pretty tidy package: Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Cannot have code

Re: [Puppet Users] How can one communicate the $confdir to the catalog builder?

2018-04-13 Thread Henrik Lindberg
On 12/04/18 14:58, jcbollinger wrote: On Wednesday, April 11, 2018 at 11:28:12 AM UTC-5, Henrik Lindberg wrote: On 11/04/18 18:21, jcbollinger wrote: > I'm writing a module for Puppet self-management, or at least I think I > am.  I was surprised to not find very much

Re: [Puppet Users] How can one communicate the $confdir to the catalog builder?

2018-04-11 Thread Henrik Lindberg
On 11/04/18 18:21, jcbollinger wrote: I'm writing a module for Puppet self-management, or at least I think I am.  I was surprised to not find very much along those lines on the Forge, and maybe I should take that as a bad sign, but I want to explore it at least a little bit.  Maybe I just

Re: [Puppet Users] Updated manifest, now get Failed to apply catalog: "\xF8\xDD" on UTF-16LE on Windows

2018-03-27 Thread Henrik Lindberg
On 26/03/18 21:58, jmp242 wrote: I'm using puppet 5.3.3 and had been using a previous version of my module for a long time. Now I added another package to my management and started getting an odd error: Failed to apply catalog: "\xF8\xDD" on UTF-16LE The actual underlying chocolatey packages

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] puppet generate types on a standalone directory

2018-03-13 Thread Henrik Lindberg
On 13/03/18 09:29, Thomas Müller wrote: Hi For octocatalog-diff I'd wanted to `puppet generate types` in the bootstrap script [1]. But at this stage its just the env extracted into a directory and not $environmentpath/${envname}. I couldn't figure out how to run `puppet generate types` on

  1   2   3   4   5   >