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

2014-10-23 Thread Rob Reynolds
On Wed, Oct 15, 2014 at 10:39 AM, Paul Ponzeka ponzek...@gmail.com wrote: Hopefully this is my last question. How do i get the variable that passes through to powershell to be a proper array? The reason is that i need to run a foreach loop on it, but it sees the variable as one long item

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

2014-10-15 Thread Paul Ponzeka
Hopefully this is my last question. How do i get the variable that passes through to powershell to be a proper array? The reason is that i need to run a foreach loop on it, but it sees the variable as one long item instead of multiples if its configured as such: $forwarders =

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

2014-10-13 Thread Paul Ponzeka
Thanks for this rob. I still cannot get the variable to pass into the script. Now i have the *setdnsforwarders.ps1.erb* template, and here is the complete copy of what is in the template: $outside = %= scope['dnsforwarders'] % $outside | out-file C:\output.log -append I've also tried the

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

2014-10-13 Thread Josh Cooper
Hi Paul, On Mon, Oct 13, 2014 at 7:15 AM, Paul Ponzeka ponzek...@gmail.com wrote: Thanks for this rob. I still cannot get the variable to pass into the script. Now i have the *setdnsforwarders.ps1.erb* template, Note puppet doesn't care what the file extension is, so long as the

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

2014-10-13 Thread Paul Ponzeka
Josh, your a god among men. Thank you so much. It was the literal string for the variable that resolved it. On Monday, October 13, 2014 1:05:39 PM UTC-4, Josh Cooper wrote: Hi Paul, On Mon, Oct 13, 2014 at 7:15 AM, Paul Ponzeka ponz...@gmail.com javascript: wrote: Thanks for this

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] Re: Passing Parameters to Powershell

2014-10-09 Thread Juan Andres Ramirez
if you want execute a powershell file: command = powershell.exe -ExecutionPolicy ByPass -File file.ps1 ${param1} On Thursday, October 9, 2014 4:22:14 PM UTC-3, Paul Ponzeka wrote: I am using Puppet installed with the powershell module. I am struggling with how to pass a puppet variable

[Puppet Users] Re: Passing Parameters to Powershell

2014-10-09 Thread Paul Ponzeka
Thanks Juan. Couple of questions on your reply. 1. In my case would it be the following: command = powershell.exe -ExecutionPolicy ByPass -File file.ps1 ${dnsforwarders} # or does this need to be adjusted? 2. How do i do the same with the fact that I am using templates, and

[Puppet Users] Re: Passing Parameters to Powershell

2014-10-09 Thread Juan Andres Ramirez
Example: I have my script on powershell in the next path in Puppet: define some::module() { $script = server1\\shared\\script.ps1 exec { Executing a script: command = powershell.exe -ExecutionPolicy ByPass -File ${script} ${param1}, unless =

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

2014-10-09 Thread Josh Cooper
On Thu, Oct 9, 2014 at 12:59 PM, Juan Andres Ramirez jandresa...@gmail.com wrote: Example: I have my script on powershell in the next path in Puppet: define some::module() { $script = server1\\shared\\script.ps1 exec { Executing a script: command = powershell.exe

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

2014-10-09 Thread Paul Ponzeka
Thanks josh, so in my template file setdnsforwarders.ps1 is this the correct syntax? $outside = %= scope['dnsforwarders'] % $outside | out-file C:\output.log -append On Thursday, October 9, 2014 4:52:04 PM UTC-4, Josh Cooper wrote: On Thu, Oct 9, 2014 at 12:59 PM, Juan Andres Ramirez

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

2014-10-09 Thread Paul Ponzeka
I tried that and it just came up blank. Am I suppose to pass it as a powershell parameter? On Thursday, October 9, 2014 5:18:05 PM UTC-4, Paul Ponzeka wrote: Thanks josh, so in my template file setdnsforwarders.ps1 is this the correct syntax? $outside = %= scope['dnsforwarders'] %

[Puppet Users] Re: passing parameters

2013-01-09 Thread jcbollinger
On Tuesday, January 8, 2013 4:15:02 AM UTC-6, Michael Hüttermann wrote: Hello, I don't get that example working. Looks like the variable is not set although facter lists it. In my manifest, I can access all Facter variables, but not the one I've defined the way described in your post and

[Puppet Users] Re: passing parameters

2013-01-08 Thread Michael Hüttermann
Hello, I don't get that example working. Looks like the variable is not set although facter lists it. In my manifest, I can access all Facter variables, but not the one I've defined the way described in your post and in the FAQ. It's empty. I'm on Puppet 2.7. What can be the reason? Thanks.

[Puppet Users] Re: passing parameters

2012-12-20 Thread jcbollinger
On Wednesday, December 19, 2012 3:45:39 PM UTC-6, Michael Hüttermann wrote: I use a parameterized class and declare it as a resource. How can I pass the parameters from outside any declaration or manifest, during runtime? To the best of my knowledge, it is not possible to do such a

[Puppet Users] Re: Passing parameters to Class from Dashboard

2012-10-26 Thread Javier Alvarez Samayoa
I just found the answer in another thread. In case somebody is looking to pass parameters from the dashboard to your classes you should reference those variables like this: $::foo instead of $foo which are local variables Hope it helps On Friday, October 26, 2012 10:28:11 AM UTC-6, Javier

RE: [Puppet Users] Re: Passing parameters for a class in Dashboard

2012-08-08 Thread Kenneth Lo
with the :: prefix. --KL From: Rakesh K [mailto:rkath...@gmail.com] Sent: Wednesday, August 08, 2012 1:52 AM To: puppet-users@googlegroups.com Cc: Kenneth Lo Subject: Re: [Puppet Users] Re: Passing parameters for a class in Dashboard Ok.. I understand ... I can simply include the class and assign

Re: [Puppet Users] Re: Passing parameters for a class in Dashboard

2012-08-07 Thread Rakesh K
: Subject: [Puppet Users] Re: Passing parameters for a class in Dashboard Or in other words , how do I make sure that following config is applied to my node through dashboard class base1 { package { [rsync, xinetd]: ensure = present } service { xinetd: ensure = running

[Puppet Users] Re: Passing parameters for a class in Dashboard

2012-08-06 Thread Rakesh K
Or in other words , how do I make sure that following config is applied to my node through dashboard class base1 { package { [rsync, xinetd]: ensure = present } service { xinetd: ensure = running } include rsyncd $password = generate(/usr/bin/pwgen, 8, 1) user { dba: ensure =

Re: [Puppet Users] Re: Passing parameters for a class in Dashboard

2012-08-06 Thread Kenneth Lo
-users@googlegroups.com Subject: [Puppet Users] Re: Passing parameters for a class in Dashboard Or in other words , how do I make sure that following config is applied to my node through dashboard class base1 { package { [rsync, xinetd]: ensure = present } service { xinetd: ensure

[Puppet Users] Re: passing parameters to templates

2011-10-18 Thread Steve Snodgrass
To be a little more explicit about what Nan said, if you use a parameterized class, any parameters you passed into the class will also be available in the template. The same things goes for a define. On Oct 17, 5:58 pm, Matt Zagrabelny mzagr...@d.umn.edu wrote: Hi, Is it possible to pass

Re: [Puppet Users] Re: passing parameters to templates

2011-10-18 Thread Matt Zagrabelny
On Tue, Oct 18, 2011 at 12:11 PM, Steve Snodgrass phe...@gmail.com wrote: To be a little more explicit about what Nan said, if you use a parameterized class, any parameters you passed into the class will also be available in the template.  The same things goes for a define. I've got a class:

Re: [Puppet Users] Re: passing parameters to templates

2011-10-18 Thread Nan Liu
On Tue, Oct 18, 2011 at 10:24 AM, Matt Zagrabelny mzagr...@d.umn.edu wrote: On Tue, Oct 18, 2011 at 12:11 PM, Steve Snodgrass phe...@gmail.com wrote: To be a little more explicit about what Nan said, if you use a parameterized class, any parameters you passed into the class will also be