Re: [Puppet Users] Over-engineering rant

2017-01-11 Thread Henrik Lindberg
On 11/01/17 02:50, John Gelnaw wrote: On Tuesday, January 10, 2017 at 3:19:45 PM UTC-5, Eric Sorenson wrote: I'd like to point out that this ntp module is also deliberately a test case for *all* of the puppet 4 language features, and as such is kind of a "reference module", so it

Re: [Puppet Users] Puppet Language Style Guide update

2017-01-13 Thread Henrik Lindberg
On 13/01/17 08:38, Peter Faller wrote: Has the Gepetto auto-formatter been updated (or will it be updated) to match the style guide? Or is there another way of automatically formatting manifests to match the style guide? Geppetto is pretty much up to date on the style guide as there are no

Re: [Puppet Users] Hiera 4 problems

2016-11-30 Thread Henrik Lindberg
On 30/11/16 16:59, Jonathan Gazeley wrote: I'm still setting up my new PE 2016.4 installation and I'm running into a problem with Hiera data per environment. I followed these steps: https://docs.puppet.com/puppet/4.7/reference/lookup_quick.html#if-you-already-use-hiera-in-environments Every

Re: [Puppet Users] Windows: puppet replaces Windows line endings by Linux line endings when using epp template

2016-12-02 Thread Henrik Lindberg
On 02/12/16 13:56, exx33...@gmail.com wrote: Hello out there, as puppet newbie I'm trying to create an ini file on Windows 2008 SP2 with puppet 4.8.0. I'm using an epp template for this purpose: | file {"${iniFileDir}\\CS2_PKCS11.INI": ensure=>file, content

Re: [Puppet Users] Could not find resource, but it's there.

2017-01-09 Thread Henrik Lindberg
On 09/01/17 02:52, chris smith wrote: Hi, This seems like a pretty simple thing but I can't figure out why this is throwing a warning. I'm using puppet 4.8.1 installed from the puppetlabs-pc1 on scientific linux 6. # puppet -V 4.8.1 # rpm -q puppet-agent puppet-agent-1.8.2-1.el6.x86_64 My

Re: [Puppet Users] Trouble using type Stdlib::Windowspath

2017-01-09 Thread Henrik Lindberg
On 09/01/17 13:02, Tiago Delboni wrote: Hi! I'm having trouble using type Stdlib::Windowspath, from module puppetlabs/stdlib, as a parameter type in a manifest. Is this "custom type" really available? In https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/types/windowspath.pp it is

Re: [Puppet Users] A substring operation does not accept a String as a charachter index

2016-12-16 Thread Henrik Lindberg
On 16/12/16 15:42, Andoreasu wrote: Hello together, we change from Puppet 3 to Puppet 4. In some of our Modules, we get Error message while the node is retrieving the catalog from the master server. It always said: | Error:Couldnotretrieve catalog fromremote server:Error500on SERVER:Serve r

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

Re: [Puppet Users] Re: Hiera fails to interpolate data path for a specific node

2017-03-16 Thread Henrik Lindberg
On 16/03/17 05:35, Wei Jianwen wrote: Thank you, Eric. I am using Puppet version 4.9.4 on all nodes and this issue persists. Best, Jianwen Jianwen, please file a ticket in Puppet's Jira for the PUP project and include the information you posted here. Best, - henrik 在 2017年3月15日星期三

Re: [Puppet Users] Re: Hiera isn't merging hashes

2017-08-11 Thread Henrik Lindberg
On 09/08/17 14:01, Leadel Ngalame wrote: Hey @Charlie, thanks for this post. I had been looking for this functionality for a while now. It works like a charm Note that you found very old information. While it still works you want to read the latest documentation for hiera

Re: [Puppet Users] Problems tagging resources with resource defaults

2017-07-27 Thread Henrik Lindberg
On 27/07/17 12:06, Jonathan Gazeley wrote: Hi folks, I'm trying to track down an issue with my PE installation. I've been using exported resources to configure my Nagios monitoring since Puppet 0.2.6 but I've just noticed that tags are not behaving as I expected. The VMs in my estate all

Re: [Puppet Users] How to disable Parser value future in Puppet enterprise 3.8.7 as modules wont support future parser

2017-07-27 Thread Henrik Lindberg
On 27/07/17 16:15, Siva nagi reddy wrote: Hi, My puppet enterprise 3.8.7 is installed with parser as future in puppet.conf and I want to disable this as by modules are not supported with future parser. I removed the value in puppet.conf and restarted the service to disable parser value but

Re: [Puppet Users] Puppet 5.0.1 : Alernate for import funcation

2017-07-28 Thread Henrik Lindberg
On 27/07/17 18:56, Jegadeesh Kumar wrote: Hi Team, I am recently installed puppet 5.0.1, earlier i used import on site.pp file in puppet 3.8. now its doesn't work. do you know the alternate way to achieve the same funcation. Site.pp [root@puppet nodes]# cat ../site.pp # Main Site.pp file

Re: [Puppet Users] How to disable Parser value future in Puppet enterprise 3.8.7 as modules wont support future parser

2017-07-28 Thread Henrik Lindberg
On 27/07/17 18:25, Siva nagi reddy wrote: Hi Henrik, Thanks for your response. We are not using any environment approach in our master. We are directly using /etc/puppetlabs/puppet/modules and manifests directory and one more thing is we created non root user account to deploy our modules on

Re: [Puppet Users] Error: Could not autoload puppet/type/dism: Attempt to redefine method set_present with block

2017-07-26 Thread Henrik Lindberg
On 21/07/17 08:39, Vikram Varma wrote: Hi All, I am getting the following error wheile running "puppet apply -v d:\default.pp" Error: Could not autoload puppet/type/dism: Attempt to redefine method set_present with block Error: Evaluation Error: Error while evaluating a Resource Statement,

Re: [Puppet Users] Getting Hiera error in Puppet enterprise environment with non root account

2017-07-26 Thread Henrik Lindberg
On 24/07/17 22:37, Siva nagi reddy wrote: Hi, We had setup Puppet enterprise master agent environment to deploy one application. We setup non-root user account by following Puppet dcos to deploy application as we dont have permissions for root account. 1) Installed the Sample module

Re: [Puppet Users] Re: hiera_hash string key variable

2017-06-28 Thread Henrik Lindberg
On 28/06/17 13:58, João Matos wrote: tks. tried both ways. didnt work Then something else is wrong, impossible to say what since "didnt work" does not say much. I am absolutely positive the example I showed does what you wanted "interpolates a value into the key you are looking up" -

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

2017-08-22 Thread Henrik Lindberg
On 22/08/17 18:30, John Baird wrote: Henrik, I have something that appears to be at least "attempting" to find the proper files.  The issue I am currently running into is that the "key" or file that I am looking for is being "chopped" at the first ".", which in this case is actually in

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

2017-08-22 Thread Henrik Lindberg
On 22/08/17 16:57, John Baird wrote: Henrik, Whether the existing YAML/JSON/HOCON backend is referenced, everything is using the context of `path` to do the lookups.  The issues with this in regards to a file backend, is I am unsure as to how to access the value or file being looked up.  The

Re: [Puppet Users] Data in Modules: Fail on unsupported OS

2017-08-22 Thread Henrik Lindberg
On 22/08/17 10:42, plapper...@gmail.com wrote: Good morning :) I'm currently writing a puppet module for the OpenBSD specific implementation of SNMPd, and was wondering if there is any elegant way  for the module to fail on unsupported operating systems? With the params.pp-pattern, you can

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

2017-08-23 Thread Henrik Lindberg
On 23/08/17 03:28, John Baird wrote: Henrik, Thanks for the feedback.  My concern stems, really, from being able to use this with Puppet.  I would think that I should be able to specify a filename and/or filepath that contain a "." without having to escape those myself.  The backend should

Re: [Puppet Users] if / case loop syntax help

2017-05-03 Thread Henrik Lindberg
On 03/05/17 18:28, Samir Gahirwal wrote: Thanks for your help Rob! Yes even, I have second doubts about if statement, I will find some other way to fix this conditional statement. You probably want: if !($env == 'test' or $env == 'qa) { # } i.e. "neither of", which you can also

Re: [Puppet Users] Re: Need to put iterative value in a file

2017-05-09 Thread Henrik Lindberg
On 09/05/17 16:39, Quentin lenglet wrote: > Hi and thx for your message. > > But now, i have an other problem. I move my lpsc::builder into a file > name builder.pp. Your { } needs to be balanced. It reaches the end and there is a '}' missing. Proper indenting of code and braces help a lot.

Re: [Puppet Users] Re: Need to put iterative value in a file

2017-05-09 Thread Henrik Lindberg
Hi, I made some comments in your code below. Most importantly perhaps is showing you where you have that syntax error. The error you get should tell you both line and the position on the line where the error occurs, but sometimes it is not possible for the parser to recognize a larger block of

Re: [Puppet Users] getting a syntax error on the puppet generated code from a forge module (theforeman/foreman_proxy)

2017-06-22 Thread Henrik Lindberg
On 21/06/17 15:24, Bill Sirinek wrote: I'm trying to set up the foreman_proxy module and getting a syntax error related to resource types. There should be no syntax errors from generated code - unless possibly using old generated code with a bug in the generator, or using generated code

Re: [Puppet Users] getting a syntax error on the puppet generated code from a forge module (theforeman/foreman_proxy)

2017-06-22 Thread Henrik Lindberg
`foreman_smartproxy` # resource. You will seldom need to specify this --- Puppet will usually # discover the appropriate provider for your platform.Available providers are: # # rest_v2 # : # # rest_v3 # : Puppet::Resource::Param(Any,'provider') ], { /(.*)/=>['name'] }, true, false) | On Thursda

Re: [Puppet Users] hiera_hash string key variable

2017-06-26 Thread Henrik Lindberg
On 26/06/17 18:33, João Matos wrote: Hi i wanted to had the value to hiera_hash string key from a variable something like: $variable= specific $newvariable = hiera_hash('data::hiera::$variable') is this possible what's the correct syntax? I think you want to interpolate a value into the

Re: [Puppet Users] getting a syntax error on the puppet generated code from a forge module (theforeman/foreman_proxy)

2017-06-22 Thread Henrik Lindberg
On 22/06/17 17:14, Henrik Lindberg wrote: On 22/06/17 15:06, Bill Sirinek wrote: Here's the file causing the error. I highlighted line 34 of the code, the slash at the end is where the error is pointing. Running puppet parser validate on the file using the 4.10.x agent does not produce

Re: [Puppet Users] Trouble translating Hiera 3 -> 5 config file

2017-05-31 Thread Henrik Lindberg
On 30/05/17 17:09, Bret Wortman wrote: I'm working on upgrading to the Hiera 5 spec and moving away from our global config, but to do that I need to first make sure I have a working H5 config file, so I set to translating our current one using the Puppetlabs documentation. I must be missing

Re: [Puppet Users] How to debug why a class is not applied to a node?

2017-06-13 Thread Henrik Lindberg
On 13/06/17 12:58, Abel Paz wrote: Hi everyone, I'm faced a really strange issue that I never saw before. I manage a complete infrastructure (~300 nodes, ~100.000 resources) using Puppet and this is the only case I saw behaving this way. 1. I have my own bacula module (class bacula). 2. I

Re: [Puppet Users] Re: Upgrading to Puppet 4 - what about the modules

2017-05-05 Thread Henrik Lindberg
On 04/05/17 08:35, mobios wrote: > As i updated to puppet 4 i had to modify my modules to be puppet 4 > ready. > > >For example: > >All custom defines need to be in there own manifest and cant be > included in other manifests. > While being a recommendation that is not true in

Re: [Puppet Users] Need to put iterative value in a file

2017-05-05 Thread Henrik Lindberg
On 04/05/17 09:26, Quentin lenglet wrote: Ho everyone, I have a lot of difficulty on Puppet for writing my own module and I don't succeed to understand how the module are made on Internet. I need to develop a custom module for put ssh keys into the right file. My ideas is to put an array with

Re: [Puppet Users] migrating from calling_* in hiera 3 to hiera 5

2017-05-25 Thread Henrik Lindberg
On 24/05/17 18:41, Martin Alfke wrote: Hi Rudy, I don’t know whether someone already replied. https://docs.puppet.com/puppet/4.10/hiera_migrate_v3_yaml.html#remove-hierarchy-levels-with-callingmodule-and-friends Quote from the link: Remove hierarchy levels with calling_module and friends

Re: [Puppet Users] passing a regex as a class parameter

2017-06-28 Thread Henrik Lindberg
On 27/06/17 17:44, Christopher Wood wrote: A little oddity I stumbled across while getting things wrong about somebody's pastebin entry in #puppet on freenode. This thing: class classname ( Regexp $param, ) { notice('yes') } class { 'classname': param => /^.$/, } Does this with

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

2017-09-15 Thread Henrik Lindberg
On 15/09/17 16:46, John Baird wrote: I just realized, while doing some other hiera work with a custom HTTP backend, that this won't work.  It's the same problem I have with the way scoping works for the HTTP backend.  If I don't specify the lookup() key in the manifest with a scope, then

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

2017-09-15 Thread Henrik Lindberg
lookup from within a module, it should automatically append the current namespace to it for lookup, then this issue goes away. On Friday, September 15, 2017 at 10:54:19 AM UTC-5, Henrik Lindberg wrote: On 15/09/17 16:46, John Baird wrote: > I just realized, while doing some other hiera w

Re: [Puppet Users] Re: hiera style guide

2017-10-06 Thread Henrik Lindberg
On 06/10/17 09:11, Michael Watters wrote: You do not *have* to quote strings however I have ran into issues with hiera turning strings that look like integers into an integer which causes problems when you attempt to do a key lookup using a string value or pass a value to a parameter that

Re: [Puppet Users] ERB variable scope

2017-10-06 Thread Henrik Lindberg
On 06/10/17 11:28, Daniel Urist wrote: I've noticed in classes with multiple templates that ERB variables seem to share a single scope. That caught me by surprise-- is that intended behavior? Intended or not - that is the behavior, and this is Ruby so it is possible to mutate things that

Re: [Puppet Users] Confusing error with file resource...

2017-10-03 Thread Henrik Lindberg
On 03/10/17 09:41, Sean wrote: Hi, I have a strange puppet error (v4.10.1) with a file resource that creates a cron job... |   file { '/etc/cron.daily/aide':     ensure  => $mymodule::ensure_aide,     owner   => 'root',     group   => 'root',     mode    => '0755',     source  =>

Re: [Puppet Users] Puppet Feature Request (lookup with keys containing ".")

2017-10-05 Thread Henrik Lindberg
On 04/10/17 08:54, John Baird wrote: Problem:   So, currently as has been explained to me, doing a lookup with keys containing "." chops the key at first "." because of scoping and namespace.  This makes file-based lookups impossible (as far as I can tell).  I would like to be able to use

Re: [Puppet Users] Re: hiera consul backend Puppet 4.10

2017-08-30 Thread Henrik Lindberg
a hiera 3 backend than what you get from hiera 5 backends. - henrik On Wednesday, August 30, 2017 at 4:31:11 AM UTC-7, Henrik Lindberg wrote: On 30/08/17 09:32, Justin DynamicD wrote: > I finally was able to solve this issue on my own, so posting for others > who may hav

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

2017-08-24 Thread Henrik Lindberg
On 24/08/17 15:52, John Baird wrote: Henrik,  I feel like this is becoming overly complicated and perhaps that is my fault for lack of explanation.  I am simply trying to return the contents of a file that is stored in hiera... Perhaps my gist would make more sense ?

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

2017-08-21 Thread Henrik Lindberg
If you have the start of this in Ruby somewhere I am happy to help you review and point out what to change. Best, - henrik On Monday, August 21, 2017 at 3:14:42 PM UTC-5, Henrik Lindberg wrote: On 21/08/17 22:03, John Baird wrote: > There was an old hiera 3.X hiera-file backend now

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.

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

2017-08-28 Thread Henrik Lindberg
On 28/08/17 00:45, John Baird wrote: The backend function receives a path in the options hash - that path is guaranteed to exist - all non existing paths are simply skipped by hiera (see the linked docs how it works). Thus, you do not need to use any of the find file, etc.

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

2017-08-24 Thread Henrik Lindberg
On 24/08/17 04:27, John Baird wrote: Henrik, Thanks for the feedback, while I wish there was a "better/native" way, I have accepted that I need to write my own function.  I would like to be able to use a similar syntax as "lookup()" and simply specify a filepath and have the contents

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

2017-09-02 Thread Henrik Lindberg
you need to deliver the value for a key per lookup of that key. The simple implementation takes the key appends it to the root path, reads that file and returns it as the value. If the file does not exist it should instead call $context.not_found(). - henrik On Monday, August 28, 2017 at 2:03

Re: [Puppet Users] Re: hiera consul backend Puppet 4.10

2017-08-30 Thread Henrik Lindberg
On 30/08/17 09:32, Justin DynamicD wrote: I finally was able to solve this issue on my own, so posting for others who may have been lost: the hiera () syntax is _very_ sensitive, even more-so than runnning hiera and the command prompt.  So while: hiera .Services would call back all the

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

2017-09-03 Thread Henrik Lindberg
tes. I hope you do not have to support those cases. (I suggest you simply document that it is illegal to use file names containing quotes, and possible check for that and give an error in the quoting function). - henrik On Sat, Sep 2, 2017 at 3:29 AM Henrik Lindberg <henrik.lindb...@puppet.c

Re: [Puppet Users] How can this become smarter (shorter) ?

2017-11-24 Thread Henrik Lindberg
On 24/11/17 16:09, mattf...@gmail.com wrote: Hi, this looks like lots of code and could be more efficient (Zesty & Xenial )? You have quite a lot of repetition - you can fix that by using a default section for your resources. It is a bit of work to find all repeated settings so I am only

Re: [Puppet Users] Differences between Resource Defaults statement and per block default?

2017-12-13 Thread Henrik Lindberg
On 13/12/17 14:46, Tobias Koeck wrote: Hi, I am wondering what the difference between a Resource Default statement like |Exec { path => '/usr/bin:/bin:/usr/sbin:/sbin', environment => 'RUBYLIB=/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0/', logoutput => true, timeout => 180, } What

Re: [Puppet Users] Differences between Resource Defaults statement and per block default?

2017-12-13 Thread Henrik Lindberg
On 13/12/17 17:40, R.I.Pienaar wrote: On Wed, 13 Dec 2017, at 16:31, Henrik Lindberg wrote: On 13/12/17 14:46, Tobias Koeck wrote: Hi, I am wondering what the difference between a Resource Default statement like |Exec { path => '/usr/bin:/bin:/usr/sbin:/sbin', environment => 'RUBYLI

Re: [Puppet Users] I need help please

2017-11-02 Thread Henrik Lindberg
On 30/10/17 21:11, Axel Ferreira wrote: Good morning everyone, I need help to make puppet work Since 9 days ago I am trying to make it work but there are no results in favor, could someone give me a guide on how to start from scratch ?, esque I have no experience and it is a task that I must

Re: [Puppet Users] rspec-puppet with custom types

2017-10-24 Thread Henrik Lindberg
On 23/10/17 22:29, Michael Watters wrote: Hello, Does anybody know how to make rspec-puppet work with modules that use custom types for class parameters?  I am getting an error when I run spec tests such as follows. # Puppet::ParseError:       #   Expected parameter 'ensure' of

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] 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] 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] 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] 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] 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] How use puppet data types in templates

2018-02-02 Thread Henrik Lindberg
On 02/02/18 12:16, Ilya wrote: Hi, how use in correct way puppet data types when you use call_function and lookup in templates, for example puppet server version 4.9 |<%=scope.call_function('lookup',['somekey','Array','deep'])-%>| In this way there is an error. Yes, that will not work

Re: [Puppet Users] Puppet 5 tests of forked module gives errors

2018-02-20 Thread Henrik Lindberg
On 19/02/18 14:36, jmp242 wrote: I've been on that page, but it doesn't really tell me what to do. I'm not using r10k, nor pe. I don't have a |.resource_types directory pro|bably because I can't get the isolation to do anything. Probably. The .resource_types is created if needed by the

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] 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] 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-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-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] 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-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] 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] 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] 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 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] 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] Customizing puppet run log format

2018-03-07 Thread Henrik Lindberg
On 07/03/18 01:31, Harish Narra wrote: Hi, I'm using --logdest to direct the logs to an external file. Is there a way to force the timestamp in the logs to be in UTC? Currently the timestamp is in the timezone of the appliance. Is there a way to specify the time format something like 

Re: [Puppet Users] Style regarding param data types

2018-03-07 Thread Henrik Lindberg
On 07/03/18 17:17, Gabriel Filion wrote: Hiya! I'm wondering if there's a current trend around style with parameter data types. I couldn't find a clear mention of how this is generally done in the community in the coding style guide on puppet.com. Is it better to align param names to the right

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

Re: [Puppet Users] How to require a define?

2018-03-09 Thread Henrik Lindberg
On 09/03/18 23:56, kmil...@seismicgames.com wrote: Hello, I'm having a issue with getting the order of my module correct. I have the PostgreSQL db define block as so: | postgresql::server::db {'my_db':     user =>'my_user',     password =>postgresql_password('my_user','my_pass'), } | I've

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

<    1   2   3   4   5   >