[Puppet Users] Re: Identifying file content change in subsequent client run

2014-10-10 Thread ganesh634
Thanks for your reply. In that case i need to cache the mtime for file and on subsequent client run need to check if mtime is same or not. How to cache this information for client running in cron mode. Is there a way to save context of previous client run. On Friday, 10 October 2014 10:50:58

Re: [Puppet Users] custom function error undefined local variable

2014-10-10 Thread Sebastiaan van Steenis
I cannot reproduce your error, but your function does conflict with some internals I guess. I have some other modules failing when I use your function. If I simplify your function (https://gist.github.com/superseb/fdb443e86a8470a276a5) it works just fine. What other modules and/or custom

Re: [Puppet Users] custom function error undefined local variable

2014-10-10 Thread Sebastiaan van Steenis
Second thought, could you show the init.pp file in vivox/manifests ? Or just the relevant parts around line 69? On 10 Oct 2014, at 08:10, Sebastiaan van Steenis pup...@superseb.nl wrote: I cannot reproduce your error, but your function does conflict with some internals I guess. I have some

Re: [Puppet Users] Re: Identifying file content change in subsequent client run

2014-10-10 Thread Ashish Jaiswal
Hi, Basically you don't need to cache it, you can store the reports in puppetdb or in filebucket. https://docs.puppetlabs.com/references/3.7.latest/type.html#file-attribute-mtime Or let us know what is your actual goal. You don't want your file to get change, if change (check mtime) then

Re: [Puppet Users] Re: Identifying file content change in subsequent client run

2014-10-10 Thread Ganesh Nalawade
The goal it to implement a new resource type that will read the config file and apply it on device on first client run. For subsequent client run the apply action should be done only if the content of config file is changed. On Fri, Oct 10, 2014 at 4:34 PM, Ashish Jaiswal ashish1...@gmail.com

Re: [Puppet Users] Is there a puppet module for installing Zookeeper in cluster mode?

2014-10-10 Thread Anastasios Zouzias
Hi Jeremy, Thanks for the reply. Yes, please let me know when you have your modules online. The Solr4 module sounds more interesting :-) PS. I wrote a simple (and naive) module for installing a zookeeper cluster which works well only under Ubunt 14.04. This was my first puppet module :-)

[Puppet Users] Re: Need help with simple hiera example

2014-10-10 Thread jcbollinger
On Thursday, October 9, 2014 5:23:39 PM UTC-5, Stack Kororā wrote: Wow! Thanks for the responses John! On Thursday, October 9, 2014 8:52:00 AM UTC-5, jcbollinger wrote: If the master had successfully looked up your datum then the result would have been as you expected. The behavior

[Puppet Users] Re: Best way to deploy the Puppet client to a large set of Windows servers?

2014-10-10 Thread jmp242
Do you have Active Directory? You could use group policy to deploy the msi. We used psexec way way back to bootstrap our deployment tool, so of course I just used it to deploy puppet. On Windows, puppet is ok, but not the best deployment tool IMHO, so we still use Fusion Inventory for that (it

[Puppet Users] Re: Writing modules to gracefully skip OS's they don't support

2014-10-10 Thread jmp242
I may be doing something really stupid per Felix.Frank, but we decided to make all our modules have: Case $kernel { 'linux': { } 'windows'{ } } form... It seems to work well for us? -- You received this message because you are subscribed to the Google Groups Puppet Users group.

[Puppet Users] Error: Could not retrieve local facts: undefined method `split' for [1, 2, 3, 4, 5]:Array

2014-10-10 Thread Spriya
Hi, when i am trying to do puppet custom facts to split [1,2,3,4,5] to 1 2 3 4 5 *It is throwing me error:* *Error: Could not retrieve local facts: undefined method `split' for [1, 2, 3, 4, 5]:Array* *Here is my facts* *require 'facter'ary = [1,2,3,4,5]ary.map { |i| ' + i.to_s +

Re: [Puppet Users] custom function error undefined local variable

2014-10-10 Thread jcbollinger
On Monday, October 6, 2014 11:07:46 AM UTC-5, Mark Rosedale wrote: Still haven't been able to hunt down the cause of this issue. Is there a way to test the code with the puppet wrapping on the cli? As Jose suggested, use irb to test the generic parts. As far as I can tell, however, your

Re: [Puppet Users] Re: Identifying file content change in subsequent client run

2014-10-10 Thread jcbollinger
On Friday, October 10, 2014 6:29:32 AM UTC-5, ganesh634 wrote: The goal it to implement a new resource type that will read the config file and apply it on device on first client run. For subsequent client run the apply action should be done only if the content of config file is changed.

Re: [Puppet Users] custom function error undefined local variable

2014-10-10 Thread Mark Rosedale
Don’t forget to restart the Puppetmaster if you are changing functions This turned out to be the issue. I don't typically restart the puppet master when I'm doing other fast fire development so it slipped my mind, but in this case it is absolutely required. I did some testing, and if you

Re: [Puppet Users] Re: Writing modules to gracefully skip OS's they don't support

2014-10-10 Thread Atom Powers
While this sounds like a good idea, I would argue that it breaks the principle of leas surprise. If I assign a module to a server I would expect that module to do what it is intended to do. If it can't do that and it doesn't tell me that it can't do that then I may assume that the module has done

[Puppet Users] Install Error

2014-10-10 Thread Adriano Ferreira
Hi, I'm a complete newbie on the puppet topic. I'm trying to install a software that is a bin file on a centOS machine using puppet. I have tried with a direct source path to my local disk but also without success. What am I doing wrong? Here is the code so far: exec {test_install: cwd

[Puppet Users] Install problem

2014-10-10 Thread Adriano Ferreira
Hi, I'm a complete newbie on puppet software. I'm trying to intall software toa cenOS machine using puppet but without success. I also tried to add a full source (c:/users/...) path but without success. exec {test_install: cwd = /opt/soft/test.bin, command = chmod +x test.bin,

[Puppet Users] Install error

2014-10-10 Thread Adriano Ferreira
Hi, I'm a complete newbie on puppet software. I'm trying to intall software toa cenOS machine using puppet but without success. I also tried to add a full source (c:/users/...) path but without success. exec {test_install: cwd = /opt/soft/test.bin, command = chmod +x test.bin,

[Puppet Users] Install error

2014-10-10 Thread Adriano Ferreira
Hi, I'm a complete newbie on puppet software. I'm trying to intall software toa cenOS machine using puppet but without success. I also tried to add a full source (c:/users/...) path but without success. exec {test_install: cwd = /opt/soft/test.bin, command = chmod +x test.bin,

[Puppet Users] Re: Error: Could not retrieve local facts: undefined method `split' for [1, 2, 3, 4, 5]:Array

2014-10-10 Thread Craig White
split is a string function your ary is an array as you defined it This will give you ruby functions for the Array class http://www.ruby-doc.org/core-2.1.3/Array.html Craig On Friday, October 10, 2014 7:39:05 AM UTC-7, Spriya wrote: Hi, when i am trying to do puppet custom facts to split

[Puppet Users] Re: Error: Could not retrieve local facts: undefined method `split' for [1, 2, 3, 4, 5]:Array

2014-10-10 Thread Spriya
Hi, require 'facter' ary = [1,2,3,4,5] ary.each do |numbers| Facter.add(base) do setcode do #{numbers} end end end In the fact it is returning only 1 value. In the fact it is returning base = 1 only not returning 2 3 4 Help me On Friday, October 10, 2014 1:38:41 PM UTC-4, Craig

[Puppet Users] Re: Error: Could not retrieve local facts: undefined method `split' for [1, 2, 3, 4, 5]:Array

2014-10-10 Thread Craig White
Facter is basically a hash. You would want to name each specific 'fact' with a unique name as it would have one value - hash is a key = value pair. On Friday, October 10, 2014 10:57:02 AM UTC-7, Spriya wrote: Hi, require 'facter' ary = [1,2,3,4,5] ary.each do |numbers| Facter.add(base)

[Puppet Users] Re: Error: Could not retrieve local facts: undefined method `split' for [1, 2, 3, 4, 5]:Array

2014-10-10 Thread Spriya
Are there any instructions how to do this kind of?. I dont know how to do it. help me On Friday, October 10, 2014 2:29:58 PM UTC-4, Craig White wrote: Facter is basically a hash. You would want to name each specific 'fact' with a unique name as it would have one value - hash is a key =

[Puppet Users] How to check if file exists on client without using exec command?

2014-10-10 Thread Stella
Hi all, I am using Puppet 3.6.2. I am trying to write a puppet module, which will replace a file with source template ONLY IF this file already exists. If this file doesn't exist, don't do anything. I have got it to work with the exec command, but that requires to use some command/script

[Puppet Users] Re: How to check if file exists on client without using exec command?

2014-10-10 Thread Juan Andres Ramirez
One way: $path onlyif = powershell.exe -ExecutionPolicy ByPass -command \if (Test-Path ${path}) { exit 1;} else { exit 0; }\ if puppet get exit 0 this finish without any error, so the path exist. for more info go powershell console and run command get-help test-path On Friday, October 10,

[Puppet Users] Re: Error: Could not retrieve local facts: undefined method `split' for [1, 2, 3, 4, 5]:Array

2014-10-10 Thread Spriya
Hi, I wrote it like this. But it is not loading base2 facts require 'facter' ary = [1,2,3,4,5] #ary.map { |i| ' + i.to_s + '}.join(,) #str = ary.each do |numbers| #id,val = row[i] #val = ary.split , Facter.add(base) do setcode do numbers = #{numbers} end end end *Facter.add(basevalue1)

Re: [Puppet Users] Re: EXEC resource fails but does not log a failure

2014-10-10 Thread Rob Reynolds
On Wed, Oct 8, 2014 at 2:51 PM, Paul Chernoch pachern...@gmail.com wrote: Thank you for your advice. While researching the problem with a colleague, we discovered the root cause: TF.EXE HISTORY returns an ERRORLEVEL of 0 (meaning success) in one narrow case when it should not. Case 1:

Re: [Puppet Users] Re: Passing Parameters to Powershell

2014-10-10 Thread Rob Reynolds
On Thu, Oct 9, 2014 at 4:18 PM, Paul Ponzeka ponzek...@gmail.com wrote: Thanks josh, so in my template file setdnsforwarders.ps1 is this the correct syntax? setdnsforwarders.ps1.erb $outside = %= scope['dnsforwarders'] % $outside | out-file C:\output.log -append On Thursday, October

Re: [Puppet Users] Re: Passing Parameters to Powershell

2014-10-10 Thread Rob Reynolds
On Thu, Oct 9, 2014 at 2:35 PM, Juan Andres Ramirez jandresa...@gmail.com wrote: if you want execute a powershell file: command = powershell.exe -ExecutionPolicy ByPass -File file.ps1 ${param1} I would recommend using -Command and staying away from the error prone -File. -Command has more

[Puppet Users] puppet module for checking CVE's

2014-10-10 Thread Garrett Honeycutt
Hello, Published puppet-module-cve[1] to act as a framework for adding facts for specific CVE's that tell you if you are vulnerable to them. Inspiration came after ShellShock where I saw people had written modules with corresponding facts exclusively for that exploit. Our community needs a

Re: [Puppet Users] Install error

2014-10-10 Thread Felix Frank
On 10/10/2014 07:24 PM, Adriano Ferreira wrote: file {/opt/soft/test.bin: ensure = present, source=puppet:///modules/test.bin; } This URL lacks the module name. Assuming that the module is named test, and the file is in modules/test/files/test.bin, this is its URL:

Re: [Puppet Users] Re: Writing modules to gracefully skip OS's they don't support

2014-10-10 Thread Felix Frank
On 10/10/2014 04:28 PM, jmp242 wrote: I may be doing something really stupid per Felix.Frank, but we decided to make all our modules have: Come, now. I said it was dangerous. As often, this is a result of actually being a bit too clever. I'm trying hard not to be Linus (anymore ;-) -- You

Re: [Puppet Users] How to check if file exists on client without using exec command?

2014-10-10 Thread Felix Frank
On 10/10/2014 09:17 PM, Stella wrote: I am using Puppet 3.6.2. I am trying to write a puppet module, which will replace a file with source template ONLY IF this file already exists. If this file doesn't exist, don't do anything. Have you tried not specifying an ensure value? file {

Re: [Puppet Users] puppet module for checking CVE's

2014-10-10 Thread Felix Frank
Hi Garrett, cool idea. I think it could use a dial to explicitly whitelist the facts that I want to be populated. Deploying an ever growing range of (sometimes expensive) checks to all agents, all of which will forever return false after patching, is not a merry perspective. What do you think?

Re: [Puppet Users] Re: Error: Could not retrieve local facts: undefined method `split' for [1, 2, 3, 4, 5]:Array

2014-10-10 Thread Felix Frank
On 10/10/2014 07:57 PM, Spriya wrote: Hi, require 'facter' ary = [1,2,3,4,5] ary.each do |numbers| Facter.add(base) do setcode do #{numbers} end end end In the fact it is returning only 1 value. In the fact it is returning base = 1 only not returning 2 3 4 First off, this

Re: [Puppet Users] puppetdb export - WTF?!

2014-10-10 Thread Felix Frank
On 10/09/2014 12:50 PM, JonY wrote: Update: 45 hours - ~75% complete Well, that's nice and all, but... Fro your process list the PDB appears to be running with a max heap size (Xmx) of 1024m. Perhaps increasing this could make a difference? ...have you tried this then? What was the effect?

Re: [Puppet Users] Announce: Puppet Server 0.2.0

2014-10-10 Thread Felix Frank
On 10/03/2014 03:50 PM, jcbollinger wrote: I feel compelled to point out that if the faster language happens to be C++, then you will *need* a plug-in interface in some different language (presumably Ruby, but straight C would be more typical). C++ APIs are sensitive to compiler and compile

Re: [Puppet Users] puppet module for checking CVE's

2014-10-10 Thread Jeremy T. Bouse
Granted I haven't completed taking a good look at the code yet, but to address Felix's concerns. What about a method of caching successful (ie: non-vulnerable) CVE fact results for an administratively configured time? This could limit the number of facts that have to run through their

Re: [Puppet Users] puppet module for checking CVE's

2014-10-10 Thread Garrett Honeycutt
On 10/10/14 7:23 PM, Felix Frank wrote: Hi Garrett, cool idea. I think it could use a dial to explicitly whitelist the facts that I want to be populated. Deploying an ever growing range of (sometimes expensive) checks to all agents, all of which will forever return false after patching, is

Re: [Puppet Users] puppet module for checking CVE's

2014-10-10 Thread Garrett Honeycutt
On 10/10/14 8:07 PM, Jeremy T. Bouse wrote: Granted I haven't completed taking a good look at the code yet, but to address Felix's concerns. What about a method of caching successful (ie: non-vulnerable) CVE fact results for an administratively configured time? This could limit the

[Puppet Users] Tiered, Auto Launching new instances with Puppet

2014-10-10 Thread Dennis Gearon
I want to be able to scale up different types of nodes both quickly and moderately quickly, AUTOMATICALLY WITH NO USER INPUT,with Puppet doing the configureation. My idea so far is: A/ There are several nodes of each type sleeping, enough per type to last 15 minutes of normal to abnormally

[Puppet Users] Tiered, Automatic addition deletion of Puppet Clients/Nodes

2014-10-10 Thread Dennis Gearon
I want to be able to scale up different types of nodes both quickly and moderately quickly, AUTOMATICALLY WITH NO USER INPUT, with Puppet doing the configureation. My idea so far is: A/ There are several nodes of each type sleeping, enough per type to last 15 minutes of normal to abnormally

Re: [Puppet Users] puppetdb export - WTF?!

2014-10-10 Thread Wyatt Alt
Hey Jon, Thanks for the update and the ticket: https://tickets.puppetlabs.com/browse/PDB-947 We've been trying to reproduce this today and have had relatively little luck. As you alluded earlier, it seems like a possible contributor might be the number of reports per node. Would you mind

Re: [Puppet Users] Tiered, Automatic addition deletion of Puppet Clients/Nodes

2014-10-10 Thread Jeremy T. Bouse
Dennis, Essentially it sounds like you're describing exactly what Amazon Launch Configurations (LC) and Auto Scaling Groups (ASG) are meant to do with the launching of new instances based on triggered events. You either can use the CloudWatch metrics as triggers or your own processes that