Re: [Puppet Users] How do I run a shell script from puppet?

2014-06-02 Thread David Schmitt

On 2014-06-02 00:09, Tibor Malomsoki wrote:

apt-get update is work-

|exec { apt-update:
 command = /usr/bin/apt-get update
}

Exec[apt-update] - Package | ||


But now I want to run a complicated script (/etc/puppet/script/works.sh)

what do I write the site.pp that I run the script in the client


First, put the script into a module's files subdirectory, so it is 
accessible via the puppet file server. Alternatively create a custom 
mount point in fileserver.conf (see 
http://docs.puppetlabs.com/guides/file_serving.html for details).


Then use this:


file { /var/lib/puppet/script.sh:
  source = puppet:///modules/test/script.sh, # assuming you put it in the 
'test' module
  mode = 0755,
} -
exec { /var/lib/puppet/script.sh: }



Have fun, David

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/538C1716.8030200%40dasz.at.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How do I run a shell script from puppet?

2014-06-02 Thread Tibor Malomsoki
I creat the subdirectory etc.
But I get this massage - client:

can't open /proc/interrupts at /usr/bin/lsdev line 15.
info: Caching catalog for server.domain.com
info: Applying configuration version '1401794715'
err: /Stage[main]//File[/var/lib/puppet/script.sh]: Could not evaluate: 
Could not retrieve information from environment production source(s) 
puppet:///modules/test/script.sh at /etc/puppet/manifests/site.pp:4
notice: /Stage[main]//Exec[/var/lib/puppet/script.sh]: Dependency 
File[/var/lib/puppet/script.sh] has failures: true
warning: /Stage[main]//Exec[/var/lib/puppet/script.sh]: Skipping because of 
failed dependencies
notice: Finished catalog run in 0.08 seconds

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/16257af8-daff-4d23-a912-b54c9fc2c1ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How do I run a shell script from puppet?

2014-06-02 Thread David Schmitt

On 2014-06-02 09:38, Tibor Malomsoki wrote:

err: /Stage[main]//File[/var/lib/puppet/script.sh]: Could not evaluate:
Could not retrieve information from environment production source(s)
puppet:///modules/test/script.sh at /etc/puppet/manifests/site.pp:4


This says that the script.sh could not be found or accessed on the server.


Regards, David

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/538C2BD7.2090806%40dasz.at.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Error 400 on SERVER : could not find class xxx for yyy on node yyy

2014-06-02 Thread Christian Charpentier
Thanks a lot Jose, i appreciate your help :)

Le vendredi 30 mai 2014 15:53:42 UTC+2, Jose Luis Ledesma a écrit :

 Class vstar::apache  should be in

 /etc/puppet/modules/vstar/manifests/apache.pp

 To allow autoloader find it.

 Regards,
 El 30/05/2014 15:48, Christian Charpentier cha...@gmail.com 
 javascript: escribió:

 Hi,
 I'm statrting using puppet with role/profile pattern and i'm facing a 
 problem.
 I use puppet 3.4.3 with a master running on red hat 2.6 and a client on a 
 local VM centOS 6.5.
 When i try to test my code with the command above i got an error : Error 
 400 on SERVER could not find class vstar::apache for puppetclient on node 
 puppet client.

 puppet agent --server=d0puppet.victor-buck.com --debug --verbose --noop 
 --test 


 Here is my puppet code :

 # /etc/puppet/manifests/site.pp
 import classes/*
  
 case $operatingsystem {
 'Solaris':  { include role::solaris }
 'RedHat', 'CentOS': { include role::redhat  }
 /^(Debian|Ubuntu)$/:{ include role::debian  }
 default:{ include role::generic }
 }

 case $hostname {
 /^puppetclient/:   { include vstar::roles::www }
 }

 #/etc/puppet/modules/vstar/manifests/roles/www.pp
 class vstar::roles::www { 
   include vstar::profiles::webserver
   include vstar::profiles::mailserver
 }

 #/etc/puppet/modules/vstar/manifests/profiles/webserver.pp
 class vstar::profiles::webserver { 
   include vstar::apache
   include common::postfix
 }

 #/etc/puppet/modules/vstar/manifests/apache/manifests/init.pp
 class vstar::apache { 
   include apache::install, apache::service
 }

 I can't figure out the issue here. Any idea on the solution to fix this?
 Any comment or idea is welcome.

 Thanks.

 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to puppet-users...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/75a4d45f-9259-40c9-887e-c717b0d67c94%40googlegroups.com
  
 https://groups.google.com/d/msgid/puppet-users/75a4d45f-9259-40c9-887e-c717b0d67c94%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/29dbf5fe-e3a3-4eae-91a6-338b2bc6b820%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How do I run a shell script from puppet?

2014-06-02 Thread Tibor Malomsoki
OS Ubuntu

The (test) script itself run.
The script content: 
#!/bin/sh
mkdir /home/works01

I found this site.pp conf-
It is work the puppet agent ---test but the get-data.sh will not run.

 define get-data() {

 

file { /usr/bin/data:

   owner = root,

   group = wheel,

   mode = 755,

   purge   = true,

   recurse = true,

   source = puppet://puppet/data/bin/;

}

 

file { /usr/bin/data/get-data.sh:

   owner = root,

   group = wheel,

   mode = 755,

   source = puppet://puppet/data/bin/get-data.sh;

}

 

exec { /usr/bin/data/get-data.sh restart:

   subscribe = File[/usr/bin/data/get-data.sh],

   refreshonly = true;

}

}




-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b3dad75b-e8f9-469f-b3c1-84a619994a89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How do I run a shell script from puppet?

2014-06-02 Thread David Schmitt

Hi Tibor,

working through the learning VM from puppetlabs at


https://puppetlabs.com/download-learning-vm


will provide you with working knowledge how to debug this and other 
issues in your puppet deployment.



Regards, David

On 2014-06-02 10:14, Tibor Malomsoki wrote:

OS Ubuntu

The (test) script itself run.
The script content:
#!/bin/sh
mkdir /home/works01

I found this site.pp conf-
It is work the puppet agent ---test but the get-data.sh will not run.

  define get-data() {



 file { /usr/bin/data:

owner = root,

group = wheel,

mode = 755,

purge= true,

recurse = true,

source = puppet://puppet/data/bin/;

 }



 file { /usr/bin/data/get-data.sh:

owner = root,

group = wheel,

mode = 755,

source = puppet://puppet/data/bin/get-data.sh;

 }



 exec { /usr/bin/data/get-data.sh restart:

subscribe = File[/usr/bin/data/get-data.sh],

refreshonly = true;

 }

}




--
You received this message because you are subscribed to the Google
Groups Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send
an email to puppet-users+unsubscr...@googlegroups.com
mailto:puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/b3dad75b-e8f9-469f-b3c1-84a619994a89%40googlegroups.com
https://groups.google.com/d/msgid/puppet-users/b3dad75b-e8f9-469f-b3c1-84a619994a89%40googlegroups.com?utm_medium=emailutm_source=footer.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/538C36EB.1000900%40dasz.at.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Presentation

2014-06-02 Thread Alfredo De Luca
Hi all.
Just a quick one.
I am preparing a little demo about puppet in the company where I am working
and it all looks fine. What I don't have that much time for is a few slides
to say what is puppet, what puppet can do for sys admin guys and so on and
so I was wondering if there is something already out there I can use.
Nothing fancy..just a few slides as an introduction to puppet.

Cheers


-- 
*Alfredo*

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAAWpFTF0psSVdYSwGS9g%2BOYDDDX-r5zD5yz93Kdprmd1CqbrDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Windows exe fork

2014-06-02 Thread Bill N
Jim,

Thank you for your advise. I have access to the C# source code so I can 
rebuild this as a service in VS2012. I should have realized this from the 
start but I confess I was trying to cut corners by using what I had readily 
available. 

best regards,

-Bill

On Sunday, June 1, 2014 9:49:32 PM UTC-4, Jim Ficarra wrote:

   I’m not familiar with how the Reimann monitoring client runs – but if 
 you run it at the command line and it runs within the shell and requires 
 the command shell to run perpetually, you could try “start.exe 
 reimannclient.exe” or whatever the name of the exe is.  There are a # of 
 command line switches that you can look at in the help by typing start /? 
 at the command line.  This would be a kludgey way to do it though to be 
 honest.  You won’t have a very good way to control it.
  
 Alternatively, it’s usually better to run these types of things within the 
 service control manager as a service if they are supported which will give 
 you more control over starting, stopping, and ensuring it starts up when 
 the servers reboot, etc.  Hopefully your tool is able to run natively as a 
 service.  if not, you can try to set up a service wrapper to run it as a 
 service (Unfortunately you can’t just convert any exe natively into a 
 Windows service).  SrvAny (the wrapper) and InstSrv (sets up the SrvAny 
 wrapper in the registry/service control manager) were tools available in 
 the Windows 2003 Server Resource Kit.  I’ve recently read that those 2003 
 tools still work in 2008, but keep in mind that they are not supported and 
 your mileage may vary.
  
 If your client is available as something that can run as a service that 
 would be much better. 
  
 You could use puppet to ensure the components are installed properly and 
 that the service is set to run all the time.  
   
  *From:* Bill N javascript: 
 *Sent:* Friday, May 30, 2014 12:27 PM
 *To:* puppet...@googlegroups.com javascript: 
 *Subject:* [Puppet Users] Windows exe fork
  
  Hi,
  
 Just wrote my first puppet module for Windows  provisioning. All is 
 working well except I am having a problem running a windows exe file in 
 that Puppet appears to wait for the exe to complete. At least this is the 
 case when I run Puppet agent --test from the Windows Server command line. 
  
 What I want to do here is install a set of files for a Riemann monitoring 
 client on several Windows Server 2008 R1 VMs. These files include an exe, 
 which I want to start and run in perpetuity. I don't want Puppet to wait 
 for this process to complete. It appears I could run the exe in a separate 
 shell using cmd.exe, but when I try that on the command line I do not see 
 the named process running in the Resource Monitor. I only see cmd.exe 
 running. This is not very informative.
  
 My question is, what is the best way to run this executable via Puppet? 
 Should I convert the exe to a Windows service, install that and run it as a 
 service? Should I use shell cmd and live with the unhelpful Resource 
 Monitor listing? Or should I use Power Shell to fork the process like I 
 would in linux?
  
 Any help would be most appreciated.  
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to puppet-users...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/c5d75b7c-531d-40d2-a027-f118910206af%40googlegroups.com
  
 https://groups.google.com/d/msgid/puppet-users/c5d75b7c-531d-40d2-a027-f118910206af%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9ff888c4-0e3e-4feb-9a8d-9879009d4374%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] future parser changes undef to string inside create_resources (tested on puppet 3.5.1 and puppet 3.6.1)

2014-06-02 Thread Henrik Lindberg

On 2014-31-05 2:15, Robert wrote:

I've stumbled upon this very annoying bug with the future parser where
it's replacing undef with empty strings when passed inside a hash to
create_resources().

test.pp
=
define test($var = undef) {
   notice inline_template(%= @name % is % if @var %true% else
%false% end % and of type %= @var.class %)
}

$config = {
   from_create_resources = {
 var = undef
   }
}

create_resources('test', $config)
=

$ puppet apply ./test.pp
Notice: Scope(Test[from_create_resources]): from_create_resources is
false and of type NilClass

$ puppet apply --parser future ./test.pp
Notice: Scope(Test[from_create_resources]): from_create_resources is
true and of type String

Breaks most of my templates since I use % if @var % everywhere...



That is a bummer. The problem here is that the 3x API *expects* undefs 
to be transformed to empty string (if that is not done, other functions 
break). However, the 3x runtime does a poor job and only translates 
*some* undefs to empty strings.


We faced a dilemma: which bug should future parser be compliant with?
We choose the strict; translate all undefs to empty string.

In the 4x function API there is no such transformation. The intent is
to gradually move functions to the new API on a most urgent to fix basis.

Until this has been done, one way of solving this is to implement 
bridging function using the new API (if it is named the same as the 3x 
function, it will be chosen instead of the 3x function when using parser 
== future). It can then simply relay the call to the 3x implementation 
(without any transformation).


Tip: If attempting to do this, there may be need to transform other 
values such as types - this because the 3x functions does not understand 
the new type system, and something like File['/tmp'] results in a 
PResourceType in the future parser/evaluator, and needs to be 
transformed to a Puppet::Resource.


We are currently discussing, when and how we deal with functions
that needs to be transitioned to the 4x API. As an interim, maybe we 
should make the future parser bug compatible wrt. transformation of 
undef to empty string when these values are nested in arrays and hashes.


Sorry for the inconvenience.
Regards
- henrik

--

Visit my Blog Puppet on the Edge
http://puppet-on-the-edge.blogspot.se/

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/lmhvhh%2480m%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet update to 3.6.1 causes Error 400 on SERVER: no 'environments' in ...

2014-06-02 Thread Henrik Lindberg

On 2014-27-05 15:23, Anton Lindstrom wrote:

There's a ticket open for that issue at
https://tickets.puppetlabs.com/browse/PUP-2659



Fix will be released in 3.6.2. Until then the recommendation is
to use Passenger (Note that Webrick is not recommended for production
even when this bug is fixed).

The problem is a concurrency issue, if you have more than one request 
coming in at the same time the behavior is undefined until the fix

is available.

- henrik



On Mon, May 26, 2014 at 7:21 PM, j...@rocketcitystudios.com
mailto:j...@rocketcitystudios.com wrote:

After upgrading to Puppet 3.6.1 I get this error:

Warning: Error 400 on SERVER: no 'environments' in
{:root_environment=#Puppet::Node::Environment:0x7f7453299a90
@config_version=nil, @manifest=/, @modulepath=[], @watching=true,
@name=:*root*,
:current_environment=#Puppet::Node::Environment:0x7f7453299a90
@config_version=nil, @manifest=/, @modulepath=[], @watching=true,
@name=:*root*} at top of [[0, nil, nil]]

Any ideas?

--
You received this message because you are subscribed to the Google
Groups Puppet Users group.
To unsubscribe from this group and stop receiving emails from it,
send an email to puppet-users+unsubscr...@googlegroups.com
mailto:puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/puppet-users/da9dc89b-0f5c-4807-b113-32d0bbd233fd%40googlegroups.com

https://groups.google.com/d/msgid/puppet-users/da9dc89b-0f5c-4807-b113-32d0bbd233fd%40googlegroups..com?utm_medium=emailutm_source=footer.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google
Groups Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send
an email to puppet-users+unsubscr...@googlegroups.com
mailto:puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/CAG_x02Y8B4kDhTsRqyaEMGa2U76ZzJ7MpMKqOVi2%3DTmeEOneig%40mail.gmail.com
https://groups.google.com/d/msgid/puppet-users/CAG_x02Y8B4kDhTsRqyaEMGa2U76ZzJ7MpMKqOVi2%3DTmeEOneig%40mail.gmail.com?utm_medium=emailutm_source=footer.
For more options, visit https://groups.google.com/d/optout.



--

Visit my Blog Puppet on the Edge
http://puppet-on-the-edge.blogspot.se/

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/lmhvpf%24cto%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Conditional Creates Attribute

2014-06-02 Thread Henrik Lindberg

On 2014-29-05 19:59, jcbollinger wrote:



On Thursday, May 29, 2014 9:23:54 AM UTC-5, Mark McFate wrote:

I'm probably going about this all wrong, but I have an instance
where I've employed a Puppet module and need to _sometimes_ add a
creates attribute to one of the exec's defined there.  My code
(below) is probably all wrong, but I think you'll see what I am
trying to do...

   if $creates != nil {



I think you can spell that as

if $creates { [...]

(See the docs on truthiness
http://docs.puppetlabs.com/puppet/3/reference/lang_datatypes.html#automatic-conversion-to-boolean.)

Alternatively, you could take advantage of the fact that interpolating
an unset variable gets you the empty string:

if $creates == '' { [...]

 exec { drush-${title} :
   command = drush ${command} ${root_option} ${uri_option}
${force_option} ${additional_options},
   path= [ '/bin', '/usr/bin' ],
   creates = $creates,
 }
   } else {
 exec { drush-${title} :
   command = drush ${command} ${root_option} ${uri_option}
${force_option} ${additional_options},
   path= [ '/bin', '/usr/bin' ],
 }
   }

This doesn't work and neither does specifying an empty or nil
attribute, like creates = '' or creates = nil.



You want

   creates = undef

for that approach (no quotes).  That's an affirmative declaration of not
specifying any value, even an empty one, for the given parameter.


To be pedantic, it means use the default value.

You do not need the conditional construct around the resource, simply
use

   creates = $creates

Since, if $creates is undefined, so will creates parameter be.
(at least in theory, but may depend on the impl of the exec resource type).

- henrik


--

Visit my Blog Puppet on the Edge
http://puppet-on-the-edge.blogspot.se/

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/lmi0bc%24jjo%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Presentation

2014-06-02 Thread Johan De Wit

have you looked @ slideshare.com ?



On 02/06/14 11:19, Alfredo De Luca wrote:

Hi all.
Just a quick one.
I am preparing a little demo about puppet in the company where I am 
working and it all looks fine. What I don't have that much time for is 
a few slides to say what is puppet, what puppet can do for sys admin 
guys and so on and so I was wondering if there is something already 
out there I can use. Nothing fancy..just a few slides as an 
introduction to puppet.


Cheers


--
/Alfredo/

--
You received this message because you are subscribed to the Google 
Groups Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to puppet-users+unsubscr...@googlegroups.com 
mailto:puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAAWpFTF0psSVdYSwGS9g%2BOYDDDX-r5zD5yz93Kdprmd1CqbrDg%40mail.gmail.com 
https://groups.google.com/d/msgid/puppet-users/CAAWpFTF0psSVdYSwGS9g%2BOYDDDX-r5zD5yz93Kdprmd1CqbrDg%40mail.gmail.com?utm_medium=emailutm_source=footer.

For more options, visit https://groups.google.com/d/optout.



--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer  (805008667232363)
Puppet Certified Professional 2013/2014 (PCP006)
_
 
Open-Future Phone +32 (0)2/255 70 70

Zavelstraat 72  Fax   +32 (0)2/255 70 71
3071 KORTENBERG Mobile+32 (0)474/42 40 73
BELGIUM http://www.open-future.be
_
 



Next Events:
Puppet Advanced Training | 
https://www.open-future.be/puppet-advanced-training-10-till-12th-june
Puppet Introduction Course | 
https://www.open-future.be/puppet-introduction-course-13th-june
Linux Training | https://www.open-future.be/linux-training-16-till-20th-june
Subscribe to our newsletter | http://eepurl.com/BUG8H

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/538C884B.5070502%40open-future.be.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] params.pp/inheritance/defaults/hiera/hiera functions?

2014-06-02 Thread jcbollinger


On Friday, May 30, 2014 8:48:18 AM UTC-5, Brian Mathis wrote:

 It sounds like you need to read through these:
 http://garylarizza.com/blog/2014/02/17/puppet-workflow-part-1/
 http://garylarizza.com/blog/2014/02/17/puppet-workflow-part-2/

 I don't see why you'd want to remove parameters from classes.  They are 
 pretty critical to having a flexible infrastructure.



No, as a matter of fact not.  What brings infrastructure flexibility in 
this area is relying on well-documented external data.  Automated data 
binding makes it easy to conflate class parameterization with data 
externalization, but they are not at all the same thing, as anyone who 
used(-es) parameterized classes in Puppet 2 can attest.  Obtaining data via 
explicit hiera*() calls for documented keys serves exactly the same data 
externalization aims as does automated class parameter binding.

Class parameterization does bring some limited advantages to modules, in 
that modules featuring parameterized classes lend themselves to an 
additional mode of use (class parameters declared in manifests via 
resource-like class declarations), but that yields module flexibility 
toward its users, not flexibility of the managed infrastructure.  I tend to 
discount that advantage, however, as it is usually poor practice to use 
resource-like class declarations even when your classes are parameterized 
(see, for example, PL's best-practices recommendation in the language 
reference 
http://docs.puppetlabs.com/puppet/3/reference/lang_classes.html#include-like-vs-resource-like
).


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/55260812-2a0e-486d-9df8-d6de98ec2262%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] params.pp/inheritance/defaults/hiera/hiera functions?

2014-06-02 Thread jcbollinger


On Saturday, May 31, 2014 4:46:58 PM UTC-5, Robin Bowes wrote:


 I think the most important thing is to not hardcode hiera() functions in 
 modules. That gives the flexibility for the users of the modules to 
 either rely on automatic parameter lookup (APL) or explicitly pass in 
 the parameters. 



I am not particularly swayed by the advantages of enabling users to do 
something that they probably shouldn't do.  I'm not saying (these days) 
that you should avoid parameterizing your classes, but I hardly consider 
parameterization to be of great import.  Certainly not the most important 
thing.


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/bdaa9da2-1bf1-4a12-a39d-a613f7ba6b0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: how to fork a Windows exe

2014-06-02 Thread Kevin D
Sounds like your best option would be to run it as a service.

On Friday, May 30, 2014 10:11:43 AM UTC-6, Bill N wrote:

 Hi,

 Just wrote my first puppet module for Windows  provisioning. All is 
 working well except I am having a problem running a windows exe file in 
 that Puppet appears to wait for the exe to complete. At least this is the 
 case when I run Puppet agent --test from the Windows Server command line.

 What I want to do here is install a set of files for a Riemann monitoring 
 client on several Windows Server 2008 R1 VMs. These files include an exe, 
 which I want to start and run in perpetuity. I don't want Puppet to wait 
 for this process to complete. It appears I could run the exe in a separate 
 shell using cmd.exe, but when I try that on the command line I do not see 
 the named process running in the Resource Monitor. I only see cmd.exe 
 running. This is not very informative.

 My question is, what is the best way to run this executable via Puppet? 
 Should I convert the exe to a Windows service, install that and run it as a 
 service? Should I use shell cmd and live with the unhelpful Resource 
 Monitor listing? Or should I use Power Shell to fork the process like I 
 would in linux?

 Any help would be most appreciated.  


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/573e4cf5-c146-4fd5-a456-3ec9fbc9c8d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 3.4.3 - Ruby in ERB

2014-06-02 Thread jcbollinger


On Friday, May 30, 2014 5:10:57 PM UTC-5, Mike Delaney wrote:

 bucket and @bucket are two different variables.

 The main change in ERB templates between 2.7 and 3.x was deprecating the 
 use of non-class variables to pass information from the calling scope into 
 the template. Perhaps you got a little over-zealous prepending '@' to
 variable names while fixing deprecation warnings?



I was about to say that no, bucket and @bucket are aliases of each other, 
but indeed, that's only true for names bound to Puppet DSL variables.  It 
is conceivable that even for those the aliasing breaks when you assign a 
value (which you absolutely should not do to names bound to DSL variables).

So, just as Mike says, to use local variables in Ruby scriptlets within a 
template you should reference them via undecorated names.


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1eb908b3-045c-4c80-b571-c29b521a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what is actually undefined method 'include?' for nil:NilClass on node error?

2014-06-02 Thread jcbollinger


On Saturday, May 31, 2014 2:53:52 PM UTC-5, Sans wrote:

 Good catch Ellison; I haven't noticed that but nope, nothing unusual 
 from facter on the affected node. 
 Now running puppet agent -tv with certificate cleared from both master 
 and agent yields these:


 notice: Starting Puppet master version 2.7.23
 
 
 info: access[/certificate_request]: allowing * access
 info: access[/]: adding authentication any
 info: Inserting default '/status' (auth true) ACL because none were found 
 in '/etc/puppet/auth.conf'
 info: Could not find certificate for 'serv106.syst.local'
 info: Could not find certificate_request for 'serv106.syst.local'
 notice: serv106.syst.local has a waiting certificate request
 notice: Signed certificate request for serv106.syst.local
 notice: Removing file Puppet::SSL::CertificateRequest serv106.syst.local 
 at '/var/lib/puppet/ssl/ca/requests/serv106.syst.local.pem'
 info: Expiring the node cache of
 /usr/lib/ruby/site_ruby/1.8/puppet/node.rb:110:in `names'
 /usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:212:in 
 `evaluate_ast_node'
 /usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:101:in `compile'
 
 


 It does sign the certificate just right but again the same wired info: 
 Expiring the node cache of after that. 



Is there an ENC involved?
Is there a node declaration matching the affected node?


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d5f576c5-e24d-4f35-a861-23b270c9e5ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-06-02 Thread jcbollinger


On Thursday, May 29, 2014 2:39:15 PM UTC-5, Brian Wilkins wrote:

 Solved it using this tip.. it's odd but it works: 
 http://serverfault.com/a/538877/26514



That's odd only inasmuch as the original problem in that serverfault 
question was different from yours.  The OP was trying to achieve a similar 
structure to the one you are working on, though, so it is natural that what 
worked for him also works for you.

For what it's worth, I think your original problem was here:

[...]

  profiles::logstash::config { $name:
   content = $content,
   order   = $order,
  }

[...]

The variables $content and $order had not been assigned any values in that 
scope (class profiles::logstash::shipper), which is exactly what the error 
message said.

I think that create_resources() was a red herring.  It should have been 
possible to use create_resources() more or less as you originally attempted 
to do, though you should have specified the fully-qualified name of the 
resource type (profiles::logstash::config), which you did not do.  
Indeed, your final data structure appears still amenable to use with 
create_resources().

 

 shipper.pp

 class profiles::logstash::shipper() {

   $shipper_array = hiera_array('profiles::logstash::config_array')

   define hash_extract() {
 $shipper_hash = hiera_hash('profiles::logstash::config_settings')
 $shipper_config = $shipper_hash[$name]

 profiles::logstash::config {'shipper':
content = $shipper_config['content'],
order   = $shipper_config['order'],
 }
 notice($shipper_config['content'])
 notice($shipper_config['order'])
   }

   hash_extract{$shipper_array:}

   class { 'logstash':
 ensure  = 'present',
 version = '1.4.1-1_bd507eb',
 status  = 'enabled',
   }
   include logstash



Note that the 'include logstash' is completely redundant (but not directly 
harmful) in that context because Class['profiles::logstash'] is already 
declared (immediately prior).  It would be much better to declare the class 
via its fully-qualified name, though, whichever form you use.

 

 }



I urge you, however, to avoid nesting classes or defined types.  The 
semantics are not necessarily what you expect (THAT was the serverfault 
questioner's issue), it makes the class or definition harder to find, and 
it contributes to confusion about the actual names of these things.


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b463cce0-2848-46e1-9e9d-34d6a85fe819%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Custom Fact Missing Exec Permission in Module

2014-06-02 Thread Michael Siroskey
 

I defined a custom fact by placing it in the facts.d folder in the module I 
created.  When I do an agent run the file is copied to the client but fails 
with “was parsed but returned an empty data set”.  This appears to be due 
to the file having the incorrect permission (644).  If I manually change 
the permission on the fact on the client to 744, the fact is executed 
properly.  The fact file on the server has the correct permission (744).  
Is there a place to set permissions on facts in facts.d?

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/133bcaf9-9843-4e03-9094-86ac8e4bf16b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Configure saz/sudo module with hiera.

2014-06-02 Thread mike
Hi,
I'm migrate my Puppet setting to Hiera, now I try configure saz/sudo module 
i've create my users under /etc/sudoers.d/10_user without problem with 
Hiera:

sudo::configs:
'user':
'content'   : %myGroup ALL=(ALL) NOPASSWD: ALL
'priority'  : 10

But i've two nodes that use the specific /etc/sudoers template my question 
are: 

1. ¿How to specifying a sudoers file?
2. ¿How to add new group myGroup?

I read the info in the site but i don't understand the how solved my 
question.

Thanks. 

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d7a326a2-b780-4b5e-a673-4a7ebd3f273e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Windows exe fork

2014-06-02 Thread Rob Reynolds
If you don't want puppet to control the start and stop and want it to
continue running after puppet is done, a service would be best. There are
other methods of calling it to run as a service from the command line and
having it continue running but if you have access to the source code, then
I would definitely recommend a service.

When you start an executable, it will still be running in the task manager
even if called from cmd.exe, although it might be hard to find. I suggest
looking at SysInternal's Process Explorer as a replacement for task manager.


On Mon, Jun 2, 2014 at 8:31 AM, Bill N bluevox@gmail.com wrote:

 Jim,

 Thank you for your advise. I have access to the C# source code so I can
 rebuild this as a service in VS2012. I should have realized this from the
 start but I confess I was trying to cut corners by using what I had readily
 available.

 best regards,

 -Bill


 On Sunday, June 1, 2014 9:49:32 PM UTC-4, Jim Ficarra wrote:

   I'm not familiar with how the Reimann monitoring client runs - but if
 you run it at the command line and it runs within the shell and requires
 the command shell to run perpetually, you could try start.exe
 reimannclient.exe or whatever the name of the exe is.  There are a # of
 command line switches that you can look at in the help by typing start /?
 at the command line.  This would be a kludgey way to do it though to be
 honest.  You won't have a very good way to control it.

 Alternatively, it's usually better to run these types of things within
 the service control manager as a service if they are supported which will
 give you more control over starting, stopping, and ensuring it starts up
 when the servers reboot, etc.  Hopefully your tool is able to run natively
 as a service.  if not, you can try to set up a service wrapper to run it as
 a service (Unfortunately you can't just convert any exe natively into a
 Windows service).  SrvAny (the wrapper) and InstSrv (sets up the SrvAny
 wrapper in the registry/service control manager) were tools available in
 the Windows 2003 Server Resource Kit.  I've recently read that those 2003
 tools still work in 2008, but keep in mind that they are not supported and
 your mileage may vary.

 If your client is available as something that can run as a service that
 would be much better.

 You could use puppet to ensure the components are installed properly and
 that the service is set to run all the time.

  *From:* Bill N
 *Sent:* Friday, May 30, 2014 12:27 PM
 *To:* puppet...@googlegroups.com
 *Subject:* [Puppet Users] Windows exe fork

  Hi,

 Just wrote my first puppet module for Windows  provisioning. All is
 working well except I am having a problem running a windows exe file in
 that Puppet appears to wait for the exe to complete. At least this is the
 case when I run Puppet agent --test from the Windows Server command line.

 What I want to do here is install a set of files for a Riemann monitoring
 client on several Windows Server 2008 R1 VMs. These files include an exe,
 which I want to start and run in perpetuity. I don't want Puppet to wait
 for this process to complete. It appears I could run the exe in a separate
 shell using cmd.exe, but when I try that on the command line I do not see
 the named process running in the Resource Monitor. I only see cmd.exe
 running. This is not very informative.

 My question is, what is the best way to run this executable via Puppet?
 Should I convert the exe to a Windows service, install that and run it as a
 service? Should I use shell cmd and live with the unhelpful Resource
 Monitor listing? Or should I use Power Shell to fork the process like I
 would in linux?

 Any help would be most appreciated.
 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users...@googlegroups.com.

 To view this discussion on the web visit https://groups.google.com/d/
 msgid/puppet-users/c5d75b7c-531d-40d2-a027-f118910206af%
 40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/c5d75b7c-531d-40d2-a027-f118910206af%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.

  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/9ff888c4-0e3e-4feb-9a8d-9879009d4374%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/9ff888c4-0e3e-4feb-9a8d-9879009d4374%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.




-- 
Rob Reynolds
Developer, Puppet Labs

*Join us at **PuppetConf 2014 http://puppetconf.com**, September 20-24 in
San Francisco*

Re: [Puppet Users] Windows Package With Title Containing Square Brackets

2014-06-02 Thread Rob Reynolds
This looks like a bug that was not resolved with our work on PUP-1211[1].

Would you mind filing a ticket[2] with this behavior so we can prioritize
it? Thank you.

[1] https://tickets.puppetlabs.com/browse/PUP-1211
[2] https://tickets.puppetlabs.com/browse/PUP


On Thu, May 29, 2014 at 10:08 AM, Dan Gibbons dangibbons@gmail.com
wrote:

 Hi Rob,

 Thanks for getting back to me.

 Agent version 3.4.3, here's the output:

 C:\Program Files (x86)\Puppet Labs\Puppet\binpuppet resource package
 --debug --
 trace --verbose
 Debug: Puppet::Type::Package::ProviderAix: file /usr/bin/lslpp does not
 exist
 Debug: Puppet::Type::Package::ProviderDpkg: file /usr/bin/dpkg does not
 exist
 Debug: Puppet::Type::Package::ProviderApt: file /usr/bin/apt-get does not
 exist
 Debug: Puppet::Type::Package::ProviderAptitude: file /usr/bin/aptitude
 does not
 exist
 Debug: Puppet::Type::Package::ProviderRpm: file rpm does not exist
 Debug: Puppet::Type::Package::ProviderAptrpm: file apt-get does not exist
 Debug: Puppet::Type::Package::ProviderSun: file /usr/bin/pkginfo does not
 exist
 Debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not
 exist
 Debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_info does not exist
 Debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_info
 does not
 exist
 Debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does
 not ex
 ist
 Debug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does
 not exi
 st
 Debug: Puppet::Type::Package::ProviderOpkg: file opkg does not exist
 Debug: Puppet::Type::Package::ProviderPacman: file /usr/bin/pacman does
 not exis
 t
 Debug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not exist
 Debug: Puppet::Type::Package::ProviderPkgin: file pkgin does not exist
 Debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does
 not exi
 st
 Debug: Puppet::Type::Package::ProviderPorts: file
 /usr/local/sbin/portupgrade do
 es not exist
 Debug: Puppet::Type::Package::ProviderPortupgrade: file
 /usr/local/sbin/portupgr
 ade does not exist
 Debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not exist
 Debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not
 exist
 Debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox
 does n
 ot exist
 Debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist
 Debug: Puppet::Type::Package::ProviderYum: file yum does not exist
 Debug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does
 not exis
 t
 Debug: Puppet::Type::Package::ProviderAix: file /usr/bin/lslpp does not
 exist
 Debug: Puppet::Type::Package::ProviderDpkg: file /usr/bin/dpkg does not
 exist
 Debug: Puppet::Type::Package::ProviderApt: file /usr/bin/apt-get does not
 exist
 Debug: Puppet::Type::Package::ProviderAptitude: file /usr/bin/aptitude
 does not
 exist
 Debug: Puppet::Type::Package::ProviderRpm: file rpm does not exist
 Debug: Puppet::Type::Package::ProviderAptrpm: file apt-get does not exist
 Debug: Puppet::Type::Package::ProviderSun: file /usr/bin/pkginfo does not
 exist
 Debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not
 exist
 Debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_info does not exist
 Debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_info
 does not
 exist
 Debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does
 not ex
 ist
 Debug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does
 not exi
 st
 Debug: Puppet::Type::Package::ProviderOpkg: file opkg does not exist
 Debug: Puppet::Type::Package::ProviderPacman: file /usr/bin/pacman does
 not exis
 t
 Debug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not exist
 Debug: Puppet::Type::Package::ProviderPkgin: file pkgin does not exist
 Debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does
 not exi
 st
 Debug: Puppet::Type::Package::ProviderPorts: file
 /usr/local/sbin/portupgrade do
 es not exist
 Debug: Puppet::Type::Package::ProviderPortupgrade: file
 /usr/local/sbin/portupgr
 ade does not exist
 Debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not exist
 Debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not
 exist
 Debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox
 does n
 ot exist
 Debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist
 Debug: Puppet::Type::Package::ProviderYum: file yum does not exist
 Debug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does
 not exis
 t
 Debug: Package Microsoft SQL Server 2012 T-SQL Language Service  found in
 both w
 indows and windows; skipping the windows version
 Error: Could not run: Invalid tag microsoft sql server 2005 compact
 edition 
 C:/Program Files (x86)/Puppet
 Labs/Puppet/puppet/lib/puppet/util/tagging.rb:12:i
 n `block in tag'
 C:/Program Files (x86)/Puppet
 

Re: [Puppet Users] Puppet 3.4.3 - Ruby in ERB

2014-06-02 Thread Eugene Brodsky
That was totally it! I removed the @ from @bucket, and now all is well.

Thanks a million.

--
*Eugene Brodsky *teehan+lax
Systems Administrator
p. 416.340.8666 x2650
109 Atlantic Avenue, Suite 202
Toronto, ON M6K 1X4
www.teehanlax.com


On Mon, Jun 2, 2014 at 10:41 AM, jcbollinger john.bollin...@stjude.org
wrote:



 On Friday, May 30, 2014 5:10:57 PM UTC-5, Mike Delaney wrote:

 bucket and @bucket are two different variables.

 The main change in ERB templates between 2.7 and 3.x was deprecating the
 use of non-class variables to pass information from the calling scope into
 the template. Perhaps you got a little over-zealous prepending '@' to
 variable names while fixing deprecation warnings?



 I was about to say that no, bucket and @bucket are aliases of each other,
 but indeed, that's only true for names bound to Puppet DSL variables.  It
 is conceivable that even for those the aliasing breaks when you assign a
 value (which you absolutely should not do to names bound to DSL variables).

 So, just as Mike says, to use local variables in Ruby scriptlets within a
 template you should reference them via undecorated names.


 John

  --
 You received this message because you are subscribed to a topic in the
 Google Groups Puppet Users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/puppet-users/3a9x84NV1Uw/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/1eb908b3-045c-4c80-b571-c29b521a%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/1eb908b3-045c-4c80-b571-c29b521a%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAH7hU7BkESMKGqhdyZDWHyvUTugFN89bZaUE__wFDH%2B8gn-SNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet dashborad ENC script output blank

2014-06-02 Thread Satish Patel
No, I didn't define any class in Dashbaord... I thought ENC script will 
feed those classes in Dashbaord web interface

On Wednesday, March 12, 2014 6:06:06 AM UTC-4, Stefan Heijmans wrote:

 Hi,
  
 Have you defined any classes *in* Puppet Dashbaord and assigned them 
 node1.example.com?
  
 Stefan


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/6714982b-d944-4683-97a3-642e5faa902d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-06-02 Thread Brian Wilkins
FWIW, this is my working solution and I think it is much better:

/etc/puppet/modules/profiles/manifests/logstash/config.pp:

class profiles::logstash::config {
  $brokers = $profiles::logstash::brokers
  $cluster = $profiles::logstash::cluster

  if (!empty($brokers)) and (empty($cluster)) {
notice(This is a shipper.)
logstash::configfile { 'output_broker':
  content = template('profiles/logstash/output_broker.erb'),
  order   = 100
}
  } elsif (!empty($cluster)) and (!empty($brokers)) {
  notice(This is a central indexer.)
  logstash::configfile { 'input_broker':
content = template('profiles/logstash/input_broker.erb'),
order   = 10
  }
  logstash::configfile { 'output_es':
content = template('profiles/logstash/output_es.erb'),
order   = 100
  }
  }
}

/etc/puppet/modules/profiles/manifests/logstash/install.pp

class profiles::logstash::install() {
  $ensure = $profiles::logstash::enable ? {true = present, default = 
absent}
  $status = $profiles::logstash::start ? {true = enabled, default = 
disabled}

  class { '::logstash':
ensure  = $ensure,
status  = $status,
version = $profiles::logstash::version
  }
}

/etc/puppet/modules/profiles/manifests/logstash.pp:

# == Class: profiles::logstash
#
# A basic module to manage logstash
#
# === Parameters
# [*version*]
#   The package version to install
#
# [*brokers*]
#   An array of brokers to use on this node
#
# [*enable*]
#   Should the service be enabled during boot time?
#
# [*start*]
#   Should the service be started by Puppet?
#
# Note: Values here are defaults and can be overriden by Hiera
#   see - /etc/puppet/data/node/host.yaml

class profiles::logstash(
   $version = 1.4.1-1_bd507eb,
   $brokers = [172.16.14.30, 172.16.14.60],
   $cluster = undef,
   $enable  = true,
   $start   = true
) {
   class{'profiles::logstash::install': } -
   class{'profiles::logstash::config': } -
   Class[profiles::logstash]
}

And my YAML:

classes:
  - roles::logshipper

profiles::logstash::version: '1.4.1-1_bd507eb'
profiles::logstash::enable: true
profiles::logstash::start: false
profiles::logstash::brokers:
  - hostname1
  - hostname2

And my ERB files

/etc/puppet/modules/profiles/templates/logstash/

% for @host in @brokers %

input {
  redis {
host  = %= @host %
type  = redis-input
data_type = list
key   = logstash
  }
}

% end %

/etc/puppet/modules/profiles/templates/logstash/output_broker.erb:

%
# iterate over brokers array passed in via Hiera and concatenate
# redis hosts for logstash configuration
host_string = [
@brokers.each_with_index { |host,idx|
   host_string  \#{host}\;
   host_string  , if idx  @brokers.length-1
}
host_string  ]
%

output {
  redis {
host = %= host_string %
data_type = list
key = logstash
  }
}

/etc/puppet/modules/profiles/templates/logstash/output_es.erb:

output {
  elasticsearch {
cluster   = %= cluster %
index = logstash-%{+.MM.dd.HH}
  }
}



On Monday, June 2, 2014 11:11:32 AM UTC-4, jcbollinger wrote:



 On Thursday, May 29, 2014 2:39:15 PM UTC-5, Brian Wilkins wrote:

 Solved it using this tip.. it's odd but it works: 
 http://serverfault.com/a/538877/26514



 That's odd only inasmuch as the original problem in that serverfault 
 question was different from yours.  The OP was trying to achieve a similar 
 structure to the one you are working on, though, so it is natural that what 
 worked for him also works for you.

 For what it's worth, I think your original problem was here:

 [...]

   profiles::logstash::config { $name:
content = $content,
order   = $order,
   }

 [...]

 The variables $content and $order had not been assigned any values in that 
 scope (class profiles::logstash::shipper), which is exactly what the error 
 message said.

 I think that create_resources() was a red herring.  It should have been 
 possible to use create_resources() more or less as you originally attempted 
 to do, though you should have specified the fully-qualified name of the 
 resource type (profiles::logstash::config), which you did not do.  
 Indeed, your final data structure appears still amenable to use with 
 create_resources().

  

 shipper.pp

 class profiles::logstash::shipper() {

   $shipper_array = hiera_array('profiles::logstash::config_array')

   define hash_extract() {
 $shipper_hash = hiera_hash('profiles::logstash::config_settings')
 $shipper_config = $shipper_hash[$name]

 profiles::logstash::config {'shipper':
content = $shipper_config['content'],
order   = $shipper_config['order'],
 }
 notice($shipper_config['content'])
 notice($shipper_config['order'])
   }

   hash_extract{$shipper_array:}

   class { 'logstash':
 ensure  = 'present',
 version = '1.4.1-1_bd507eb',
 status  = 'enabled',
   }
   include logstash



 Note that the 'include logstash' is completely redundant (but not directly 
 harmful) in 

[Puppet Users] ongoing puppet dashboard frustration

2014-06-02 Thread Fine, Thomas
Hi,

My problem is that the CSS formatting in puppet dashboard does not show up
under apache, but works fine under webrick.  This SOUNDS exactly like some
old bugs (9676, 9767), but I've applied all the recommended fixes to no
avail, and at an rate the symptoms are only the same on the surface.

My apache/passenger setup correctly generates all.css with the correct
permissions.  It generates the identical file that the webrick server
generates, and with the same file permissions and ownership.  When I
explicitly download this file, apache correctly serves the right all.css
file.

BUT it still doesn't work!  I get an unformatted web page.  My only guess
at this point is that some sort of race condition occurs between the
creation and serving of the file, and the webserver is correctly serving an
empty file, which is then filled in with data several microseconds later.
 And when I say empty, I mean a 66093 byte file with nothing but nulls in
it, because the web logs always indicate that the correct file size is
being served.  But at the same time Safari's web inspector shows that
all.css is totally empty.  (Note that firefox and chrome show the same
problem so it's not browser-specific).

I've googled around for ruby/rails/rake/passenger race conditions with
apache and haven't found anything.

The insane part here is that (as far as I can tell) this dynamically
generated file never ever ever actually needs to change unless I
reconfigure or re-install puppet-dashboard.  So alternatively if you can
tell me how to just serve this as a plain file not generated by passenger,
that'd make me totally happy right now.

Thanks,

   tom

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CANVEBdgHjgSsTrW_VukmKMa6KBtXGzuqX4Xon_g-h-PJ9JE1ag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Custom Fact Missing Exec Permission in Module

2014-06-02 Thread Josh Cooper
On Mon, Jun 2, 2014 at 8:23 AM, Michael Siroskey msiros...@gmail.com
wrote:

 I defined a custom fact by placing it in the facts.d folder in the module
 I created.  When I do an agent run the file is copied to the client but
 fails with “was parsed but returned an empty data set”.  This appears to be
 due to the file having the incorrect permission (644).  If I manually
 change the permission on the fact on the client to 744, the fact is
 executed properly.  The fact file on the server has the correct permission
 (744).  Is there a place to set permissions on facts in facts.d?


This is being tracked at https://tickets.puppetlabs.com/browse/PUP-2705

Josh

-- 
Josh Cooper
Developer, Puppet Labs

*Join us at PuppetConf 2014 http://www.puppetconf.com/, September
20-24 in San Francisco*
*Register by June 5th to take advantage of the Early Adopter discount
http://links.puppetlabs.com/puppetconf-early-adopter **—**save $349!*

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CA%2Bu97umT%3Dt6kaT4QTkei2X0nb-14WmekcUw9E1i-AO5vxnbTXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Windows Package With Title Containing Square Brackets

2014-06-02 Thread Josh Cooper
On Mon, Jun 2, 2014 at 10:47 AM, Rob Reynolds r...@puppetlabs.com wrote:

 This looks like a bug that was not resolved with our work on PUP-1211[1].

 Would you mind filing a ticket[2] with this behavior so we can prioritize
 it? Thank you.

 [1] https://tickets.puppetlabs.com/browse/PUP-1211
 [2] https://tickets.puppetlabs.com/browse/PUP


 On Thu, May 29, 2014 at 10:08 AM, Dan Gibbons dangibbons@gmail.com
 wrote:

 Hi Rob,

 Thanks for getting back to me.

 Agent version 3.4.3, here's the output:

 C:\Program Files (x86)\Puppet Labs\Puppet\binpuppet resource package
 --debug --
 trace --verbose
 Debug: Puppet::Type::Package::ProviderAix: file /usr/bin/lslpp does not
 exist
 Debug: Puppet::Type::Package::ProviderDpkg: file /usr/bin/dpkg does not
 exist
 Debug: Puppet::Type::Package::ProviderApt: file /usr/bin/apt-get does not
 exist
 Debug: Puppet::Type::Package::ProviderAptitude: file /usr/bin/aptitude
 does not
 exist
 Debug: Puppet::Type::Package::ProviderRpm: file rpm does not exist
 Debug: Puppet::Type::Package::ProviderAptrpm: file apt-get does not exist
 Debug: Puppet::Type::Package::ProviderSun: file /usr/bin/pkginfo does not
 exist
 Debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not
 exist
 Debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_info does not
 exist
 Debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_info
 does not
 exist
 Debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does
 not ex
 ist
 Debug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does
 not exi
 st
 Debug: Puppet::Type::Package::ProviderOpkg: file opkg does not exist
 Debug: Puppet::Type::Package::ProviderPacman: file /usr/bin/pacman does
 not exis
 t
 Debug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not
 exist
 Debug: Puppet::Type::Package::ProviderPkgin: file pkgin does not exist
 Debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does
 not exi
 st
 Debug: Puppet::Type::Package::ProviderPorts: file
 /usr/local/sbin/portupgrade do
 es not exist
 Debug: Puppet::Type::Package::ProviderPortupgrade: file
 /usr/local/sbin/portupgr
 ade does not exist
 Debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not
 exist
 Debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not
 exist
 Debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox
 does n
 ot exist
 Debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist
 Debug: Puppet::Type::Package::ProviderYum: file yum does not exist
 Debug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does
 not exis
 t
 Debug: Puppet::Type::Package::ProviderAix: file /usr/bin/lslpp does not
 exist
 Debug: Puppet::Type::Package::ProviderDpkg: file /usr/bin/dpkg does not
 exist
 Debug: Puppet::Type::Package::ProviderApt: file /usr/bin/apt-get does not
 exist
 Debug: Puppet::Type::Package::ProviderAptitude: file /usr/bin/aptitude
 does not
 exist
 Debug: Puppet::Type::Package::ProviderRpm: file rpm does not exist
 Debug: Puppet::Type::Package::ProviderAptrpm: file apt-get does not exist
 Debug: Puppet::Type::Package::ProviderSun: file /usr/bin/pkginfo does not
 exist
 Debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not
 exist
 Debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_info does not
 exist
 Debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_info
 does not
 exist
 Debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does
 not ex
 ist
 Debug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does
 not exi
 st
 Debug: Puppet::Type::Package::ProviderOpkg: file opkg does not exist
 Debug: Puppet::Type::Package::ProviderPacman: file /usr/bin/pacman does
 not exis
 t
 Debug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not
 exist
 Debug: Puppet::Type::Package::ProviderPkgin: file pkgin does not exist
 Debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does
 not exi
 st
 Debug: Puppet::Type::Package::ProviderPorts: file
 /usr/local/sbin/portupgrade do
 es not exist
 Debug: Puppet::Type::Package::ProviderPortupgrade: file
 /usr/local/sbin/portupgr
 ade does not exist
 Debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not
 exist
 Debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not
 exist
 Debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox
 does n
 ot exist
 Debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist
 Debug: Puppet::Type::Package::ProviderYum: file yum does not exist
 Debug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does
 not exis
 t
 Debug: Package Microsoft SQL Server 2012 T-SQL Language Service  found in
 both w
 indows and windows; skipping the windows version
 Error: Could not run: Invalid tag microsoft sql server 2005 compact
 edition 
 C:/Program Files (x86)/Puppet
 Labs/Puppet/puppet/lib/puppet/util/tagging.rb:12:i

[Puppet Users] Controlling the order of stop/starts on refresh between dependent services.

2014-06-02 Thread Paul Gale
Hi,

Using Puppet v2.7.25.

I have two services that have a refresh dependency between them, namely: 
Service['foo'] ~ Service['bar']

This equates to: stop/start 'foo' then stop/start 'bar', whenever 'foo' is 
refreshed.

Ideally I'd like the underlying series of operations to be: stop 'bar', 
stop/start 'foo', start 'bar'. 

How can I do this without resorting to using execs?

If bar were to be running whilst foo was unavailable (even if for a moment) 
bad things would happen. To make matters worse (or more interesting) each 
service is managed by a separate module.   

Thanks,
Paul

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/43e05e4d-e2c7-45e2-a381-670a7bbce0cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] change jboss port

2014-06-02 Thread Rich Burroughs
Can you let people know which module exaxtly that you're using? Is it one
you wrote or one you got from the Forge? I looked on the Forge and saw
multiple JBOSS modules and they are probably all going to work differently.

Hopefully it's parameterized and you can just override the default port
when you apply it to a node. But it all depends on what code you're using.
There may be a readme with the code that explains how to use it.

We have a JBOSS module where I work and we actually manage some of the XML
configs as files, since the guys who wrote the code knew we'd want the
containers to be the same in all environments.


Rich

On Thursday, May 29, 2014, Ankita kumari ankia...@gmail.com wrote:


 Yes I am using puppet module to configure jboss

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com
 javascript:_e(%7B%7D,'cvml','puppet-users%2bunsubscr...@googlegroups.com');
 .
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/f5495daf-7750-46fa-8881-683a44c1c903%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/f5495daf-7750-46fa-8881-683a44c1c903%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAPGcbtA5fg9OuAdKfD%3DpktLbYm1AXQ6A5fTm%2Bpy-vquX0h1NpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.