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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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 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-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] 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
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 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-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 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] 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-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] 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] 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-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] 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 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] 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] 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-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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] Conflict between new docs and puppet

2017-03-01 Thread Henrik Lindberg
On 28/02/17 20:22, Joshua Schaeffer wrote: The docs on lookup() . state that in order to upgrade to to hiera v5 you should follow the below list: * Change any |hiera|/|hiera_array|/|hiera_hash| calls in your manifests to use

Re: [Puppet Users] Re: hiera deep hash merges broken

2017-02-17 Thread Henrik Lindberg
On 16/02/17 15:37, Francois Lafont wrote: Hi, On 02/16/2017 09:03 PM, Henrik Lindberg wrote: We are adding support for eyaml in hiera 5 which means you will get explain support and that you can use eyaml when also using the new format. We now also test with eyaml. By the way, and just

Re: [Puppet Users] Puppet erb template create loop

2017-02-16 Thread Henrik Lindberg
On 13/02/17 18:05, Rafael Tomelin wrote: Hi dear, I is create a module and need loop in puppet class and template The my class step is: 1) My class have array declared; $pools = [ { name => 'PoolDiario', poolType => 'Backup', recycle=>

Re: [Puppet Users] Re: hiera deep hash merges broken

2017-02-16 Thread Henrik Lindberg
On 16/02/17 08:16, Daniel Urist wrote: It turns out my issue was caused by eyaml no longer supporting deep hash merges. I've worked around my issue by separating out plain yaml and eyaml. Fortunately none of my existing code does a deep hash merge on the eyaml keys. It would be great to get

Re: [Puppet Users] Hiera 5 calling_class

2017-02-10 Thread Henrik Lindberg
sure this gets to the docs folks. Anyway in my case i can work around with module data. Excellent! - henrik thanks! -Ben On Fri, Feb 10, 2017 at 1:39 PM, Henrik Lindberg <henrik.lindb...@puppet.com <mailto:henrik.lindb...@puppet.com>> wrote: On 08/02/17 17:55, Ben

Re: [Puppet Users] hiera_hash, lookup, Hiera 5

2017-02-10 Thread Henrik Lindberg
On 10/02/17 13:32, Daniel Urist wrote: I have been using ":merge_behavior: deeper" in my hiera.yaml file to turn on deep hash merges with hiera_hash, but now this appears to be broken. Puppet 4.9.0/4.9.1 went out with a number of issues related to hiera. All reported problems (including

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:

Re: [Puppet Users] puppet 4.9.0 is not compatible with hiera-eyaml

2017-02-05 Thread Henrik Lindberg
On 05/02/17 20:25, Vadym Chepkov wrote: Hi, It looks like puppet 4.9.0 (installed with puppet-agent-1.9.0) is not compatible with hiera-eyaml # puppet lookup testkey Error: Could not run: Hiera type mismatch: expected Hash and got String I downgraded to puppet-agent-1.8.3 meanwhile and it

Re: [Puppet Users] puppet stop working

2017-02-03 Thread Henrik Lindberg
On 03/02/17 13:59, Albert Shih wrote: Le 02/02/2017 à 18:09:58+0100, Henrik Lindberg a écrit On 02/02/17 14:28, Albert Shih wrote: Hi, We just update puppet-agent (Debian, puppetlabs repot) on the puppetserver (last version), and every agent stop working with this error Info: Using

Re: [Puppet Users] puppet stop working

2017-02-02 Thread Henrik Lindberg
On 02/02/17 14:28, Albert Shih wrote: Hi, We just update puppet-agent (Debian, puppetlabs repot) on the puppetserver (last version), and every agent stop working with this error Info: Using configured environment 'jas' Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts

Re: [Puppet Users] drop-down list for class parameter values

2017-02-02 Thread Henrik Lindberg
On 02/02/17 00:46, James Boone wrote: Is there a way to define a list of allowed values for a class parameter so that it shows up as a drop-down menu in pe-console? If not, would this be a feasible feature to add? Have a common case where a parameter is a few set possible values, would like to

[Puppet Users] having hiera issues after upgrade to Puppet 4.9.0 ?

2017-02-02 Thread Henrik Lindberg
Puppet 4.9.0 just went live and we are waiting for the proper release notes to be sent out. Early users have started to upgrade and have been running into a couple of issues that are easily fixable. The new implementation is sensitive to errors in hiera.yaml

Re: [Puppet Users] Escape codes in collection types

2017-02-01 Thread Henrik Lindberg
On 01/02/17 00:20, Joshua Schaeffer wrote: I'm new to Puppet and learning the program and language so this question might seem novice. I'm confused why I can assign an escape character to a variable but not inside any collection types (arrays or hashes). I was doing the simply motd puppet module

Re: [Puppet Users] Local variables lost outside of .each loop

2017-02-01 Thread Henrik Lindberg
On 30/01/17 22:34, Martin Alfke wrote: AFAIK all variables inside a lambda are “private”: https://docs.puppet.com/puppet/latest/lang_lambdas.html#lambda-scope Correct - they are local and only visible to inner scopes in the lambda (a lambda in a lambda). If you need an iterative function

Re: [Puppet Users] Re: Puppet Actions in Parallel?

2017-01-30 Thread Henrik Lindberg
On 30/01/17 12:58, Michael Shaw wrote: The very clear use case for me is in the puppet management of infrastructure. Take the case of puppet being used to automate the creation of a database server. The Command to initiate the creation takes around 2 seconds to complete. The process to

Re: [Puppet Users] how to use external facts in a template?

2017-01-26 Thread Henrik Lindberg
e of fact x for node y". - henrik On Wednesday, January 25, 2017 at 11:23:06 PM UTC, Henrik Lindberg wrote: Do not ever reference Facter directly on the master side from functions or ERB templates used when compiling. Only reference Facter in logic that implements fact

Re: [Puppet Users] how to use external facts in a template?

2017-01-25 Thread Henrik Lindberg
On 25/01/17 20:20, Sans wrote: On Wednesday, January 25, 2017 at 7:05:03 PM UTC, R.I. Pienaar wrote: only if you enable structured facts and have a new facter Well, it's not "structured" i.e. it returns only a string. and didn't work as expected. It also an "external fact", not sure

Re: [Puppet Users] My Array and Hash datatype getting treated as simple string.

2017-01-23 Thread Henrik Lindberg
On 22/01/17 07:59, Arun Kumar wrote: Hi Guys, I am very new to Puppet and installed 3.8. I tried creating template using array type variable but I got output as string. My sample code as below: init.pp --- $servers = ['facter', 'hiera', 'mco', 'puppet', 'puppetserver'], config.pp

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

2017-01-13 Thread Henrik Lindberg
On 13/01/17 12:16, Tiago Delboni wrote: Em quarta-feira, 11 de janeiro de 2017 15:38:28 UTC-2, Henrik Lindberg escreveu: Maybe there is something wrong with that type. What does this give you: notice('C:\a\valid\path' =~ Stdlib::Windowspath) If that fails, please report

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] Trouble using type Stdlib::Windowspath

2017-01-11 Thread Henrik Lindberg
ng with that type. What does this give you: notice('C:\a\valid\path' =~ Stdlib::Windowspath) If that fails, please report the issue against stdlib. (Or I am blind and there is something not right about the path). Best, - henrik Em segunda-feira, 9 de janeiro de 2017 11:16:09 UTC-2, Henrik L

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

2017-01-11 Thread Henrik Lindberg
On 09/01/17 14:22, Martin Alfke wrote: Hi Henrik, A non-existent type will in some versions of puppet be taken as being a resource type. One thing you can check is that your module (where you are using Stdlib::XXX types have declared a dependency on Stdlib in its metadata. If it does not

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] 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] 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] 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] Puppet counter part for ruby caller function/object

2016-12-13 Thread Henrik Lindberg
On 12/12/16 11:11, Michel Verbraak wrote: I have been googling around to find an answer but was not able to find it. I have created my own custom type in puppet. According to the documentation here Puppet Resource Types manual

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] 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] Execute puppet manifest based on the OS family

2016-11-28 Thread Henrik Lindberg
On 28/11/16 10:06, Amrit Atmajit wrote: Hi, I am using puppet 4.7.0 in my Puppet Server where different OS families are used as nodes. I have created Puppet Manifests (Puppet Classes) where couple of them to be executed on windows Puppet agent nodes and others on Linux nodes. So, to do the

Re: [Puppet Users] How to comment multiple lines on configurations file

2016-11-23 Thread Henrik Lindberg
On 21/11/16 11:35, Amber Mehra wrote: Hey Guys, I need to comment multiple lines on some configuration files, Please let me know how to accomplish this task using puppet manifest? Best Comments in puppet are either # This is a line comment or /* this is a multiline comment */ The

Re: [Puppet Users] puppet 3 to 2016.4

2016-10-13 Thread Henrik Lindberg
On 13/10/16 22:25, kevin wrote: how do they do that. Who is they? Do what? What scripting language will thy be using for the. For the what? Puppet is mostly written in Ruby. Modules and your manifests are written in the Puppet Language. Upgrading from puppet 3.x to 4.x means that you not

Re: [Puppet Users] Issue with module from forge - Duplicate declaration Class[Rsyslog]

2016-10-12 Thread Henrik Lindberg
On 12/10/16 14:59, jcbollinger wrote: On Tuesday, October 11, 2016 at 3:54:25 PM UTC-5, re-g...@wiu.edu wrote: On Monday, October 10, 2016 at 9:07:35 AM UTC-5, jcbollinger wrote: On Friday, October 7, 2016 at 10:39:58 AM UTC-5, re-g...@wiu.edu wrote:

Re: [Puppet Users] duplicate resource with inherit and puppet apply

2016-10-03 Thread Henrik Lindberg
On 03/10/16 15:48, jcbollinger wrote: On Friday, September 30, 2016 at 2:03:06 PM UTC-5, Toni Schmidbauer wrote: Henrik Lindberg <henrik@puppet.com > writes: > On 28/09/16 14:30, Toni Schmidbauer wrote: > I tried this on latest puppet: > > === test.p

Re: [Puppet Users] Setting resource dependency from hiera problem

2016-09-28 Thread Henrik Lindberg
On 23/09/16 14:16, Matt Raso-Barnett wrote: require: "Network::If::Static['eth1']" Should be require: "Network::If::Static[eth1]" Since the string form of resource references does not include quotes around the title - thus it is searching for a resource named "'eth1'" instead of one

Re: [Puppet Users] duplicate resource with inherit and puppet apply

2016-09-28 Thread Henrik Lindberg
On 28/09/16 14:30, Toni Schmidbauer wrote: hi, it's a stupid example but nevertheless it would be interesting to now why the following throws a duplicate resource error under puppet 3.7.4 and puppet 4.2.1 test/manifests/init.pp: # start puppet code class test inherits test::subclass {

Re: [Puppet Users] Re: notify resource different between 3 and 4?

2016-09-23 Thread Henrik Lindberg
On 20/09/16 15:54, R.I.Pienaar wrote: - Original Message - From: "jcbollinger" To: "puppet-users" Sent: Tuesday, 20 September, 2016 15:37:21 Subject: Re: [Puppet Users] Re: notify resource different between 3 and 4? On

Re: [Puppet Users] Passing parameters to manifest from puppet agent

2016-09-09 Thread Henrik Lindberg
On 09/09/16 07:08, rakshatha.shetty via Puppet Users wrote: Hi, Im using puppet agent 4.5.3. I'm trying to send values to variables defined in manifest present in my puppet master through puppet agent. Is there any way to accomplish it? Have you looked at facts? They are the main mechanism

Re: [Puppet Users] puppet4 stdlib (4.12.0) error with .find method?

2016-09-07 Thread Henrik Lindberg
On 07/09/16 20:58, Matthew Pounsett wrote: Having just installed zleslie/pkgng in order to ma nage repositories on my FreeBSD hosts (which in turn required and installed puppetlabs/stdlib), I'm now getting the following error from my puppet runs: % sudo puppet agent -t Info: Using configured

Re: [Puppet Users] How to use class in different place

2016-08-25 Thread Henrik Lindberg
On 25/08/16 22:40, Albert Shih wrote: Hi, I would like to known how can I use a class in different place. Let's take a example. I have a module who manage a CMS, let's say something like drupal (or whatever you want). So in this CMS I need to use apache class. So I get in my node.yaml

Re: [Puppet Users] Re: hiera_hash lookup returns struct, how to pass to function written in puppet?

2016-08-13 Thread Henrik Lindberg
On 11/08/16 17:36, pokemon.master.metal...@gmail.com wrote: I ended up coming up with a way to reproduce it without hieradata: init.pp | classfoo(Hash[String,Struct[{ x =>Array[Integer], y =>Array[String]}]]$arg ) { notify{"$arg":} } classtest { class { 'foo': arg =>{propertya

Re: [Puppet Users] hiera_hash lookup returns struct, how to pass to function written in puppet?

2016-08-13 Thread Henrik Lindberg
On 11/08/16 17:07, pokemon.master.metal...@gmail.com wrote: Hi Henrik, thanks again for your help. I tried it and go the same result as you on puppet 4.3.2 Then it must be something wrong with the data from data binding since clearly, if you give it valid data it works. - henrik -- You

Re: [Puppet Users] hiera_hash lookup returns struct, how to pass to function written in puppet?

2016-08-11 Thread Henrik Lindberg
On 11/08/16 06:13, pokemon.master.metal...@gmail.com wrote: Thanks Henrik, I created a sample, here's what you need to reproduce the error (which is mentioned at the bottom) function | functiontest::myfunc(Struct[{ propertya =>Hash[String,Struct[{propertya_1 =>Array[Integer],propertya_2

Re: [Puppet Users] hiera_hash lookup returns struct, how to pass to function written in puppet?

2016-08-10 Thread Henrik Lindberg
On 10/08/16 18:28, pokemon.master.metal...@gmail.com wrote: I'm relatively new to puppet but I used hiera_hash to lookup what I would consider a "hash" in yaml. The data I tested with is rather complex in nature but it basically boils down to a hash of hashes with sub hashes / arrays. Ex: (my

Re: [Puppet Users] Using the Puppet Catalog Preview tool in a rspec-puppet workflow?

2016-07-27 Thread Henrik Lindberg
On 26/07/16 20:46, robbyt wrote: I'd like to use the Catalog Preview tool as part of module spec tests, to ensure that code in each module will work correctly in both versions of Puppet? Is it possible to use the Catalog Preview tool without a real Puppet Master infrastructure? Yes, except for

Re: [Puppet Users] Hiera question

2016-07-01 Thread Henrik Lindberg
On 01/07/16 06:20, Alex Samad wrote: Hi I have in my common.yaml --- classes: - ssh How do I say if the OS is linux then add that class ? I think it is best if you try to read the documentation and look at tutorials. This very first step is clearly shown there. - henrik Thanks

Re: [Puppet Users] Convert hiera_hash code to hiera_array?

2016-06-28 Thread Henrik Lindberg
On 28/06/16 18:34, potlipin wrote: Hi all, I'm trying to install a cron module in our Puppet 2.6 infrastructure, to be used with Hiera. Puppet 2.6 is really old. It is not even the latest of the 2.x series which was end of life quite some time ago (October 1, 2013). Now, soon 3.x is end of

<    1   2   3   4   5   >