[Puppet Users] Facter not initialized in rspec in puppetlabs-stdlib?

2012-04-11 Thread Wil Cooley
I have been working on adding some predicate functions to puppetlabs-stdlib 
that test things based on 'interfaces' and related facts.

The functions themselves seem to work fine in my manifest-based smoketests, 
but I am running into trouble that may or may not be due to my ignorance 
about rspec or Facter. Something needs to be done to initialize Facter 
because lookupvar('interfaces') just returns :undefined. I have not found 
any examples in the existing rspec tests; getvar_spec.rb seems like it 
should have something but the tests it does are pretty basic.

You can see some of what I've been trying at 
https://github.com/wcooley/puppetlabs-stdlib/blob/master/spec/unit/puppet/parser/functions/has_interface_with_spec.rb

Is there something obvious I'm missing?

Wil

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/XBJE-12hhCoJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppetd locking up?

2012-04-11 Thread Jean Baptiste FAVRE
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Because all my recipes are not fully 2.7 compatible yet :-/
And I won't be able to rewrite them fast enough.

And finally, since the hang issue also occurs with some 2.7 release,
I'm not sure it'll be worth the upgrade

JB

On 10/04/2012 23:41, Jeff McCune wrote:
 On Tue, Apr 10, 2012 at 2:35 PM, Jean Baptiste FAVRE 
 jean.baptiste.fa...@gmail.com wrote:
 -BEGIN PGP SIGNED MESSAGE- Hash: SHA1
 
 Hello, Seems to be the same as described here: 
 https://groups.google.com/forum/?fromgroups#!topic/puppet-users/N1XcMTth7mE


 
Got the same issue with puppet 2.6.14 and various kernels version.
 
 Can't find what's going rong, so I guess I'll have to downgrade
 until everything run fine
 
 Why do you need to downgrade instead of upgrade to 2.7?
 
 -Jeff
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+FInMACgkQM2eZoKJfKd1zAgCdGtxZyGcesWQ3L0vZWiLRNjOI
wLsAmgMYps7c4GaVVABHa6VogttTp2kZ
=pAMk
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppetd locking up?

2012-04-11 Thread Elias Abacioglu

I have the same issue I think. With 2.7.6 and 2.7.11.
https://projects.puppetlabs.com/issues/13000

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppetd locking up?

2012-04-11 Thread Jean Baptiste Favre

Forgot to mention:
I see this misbehaviour on many servers with:
- puppet 2.6.14,
- facter 1.6.5
- Ubuntu 10.04 with 2.6.32-317-ec2 kernel

See it also with other kernels, but less often.

Puppet  facter are home backported (ie, not using apt.puppetlabs.com)

JB

On 4/10/12 11:35 PM, Jean Baptiste FAVRE wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,
Seems to be the same as described here:
https://groups.google.com/forum/?fromgroups#!topic/puppet-users/N1XcMTth7mE

Got the same issue with puppet 2.6.14 and various kernels version.

Can't find what's going rong, so I guess I'll have to downgrade until
everything run fine

JB


On 10/04/2012 23:24, David Alden wrote:

Hi, I've recently started to have a problem where some of my
clients puppetd processes are locking up (the puppetdlock file is
several hours old). My server is running puppet 2.7.12 on Centos
6.2 and my clients are running puppet 2.7.12 on Scientific Linux
6.2.  If I check the puppetdlock file, it contains the pid of the
currently running puppet.   If I restart puppetd, it's fine for a
while, but sooner or later I end up in the same state.  If I run
strace against the puppetd, I get:

# strace -p 10726 Process 10726 attached - interrupt to quit
select(8, [7], NULL, NULL, {1, 560249}) = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0 select(8, [7], NULL,
NULL, {2, 0})  = 0 (Timeout) rt_sigprocmask(SIG_BLOCK, NULL,
[], 8)  = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0 select(8,
[7], NULL, NULL, {2, 0})  = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0 select(8, [7], NULL,
NULL, {2, 0})  = 0 (Timeout) rt_sigprocmask(SIG_BLOCK, NULL,
[], 8)  = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0 ^C
unfinished ...  Process 10726 detached


If I run lsof, I get:

# lsof -p 10726 COMMAND   PID USER   FD   TYPE DEVICE
SIZE/OFF NODE NAME puppetd 10726 root  cwdDIR
8,1 40962 / puppetd 10726 root  rtdDIR
8,1 40962 / puppetd 10726 root  txtREG
8,110576  8151417 /usr/bin/ruby [...] puppetd 10726 root  mem
REG8,126050  8153796
/usr/lib64/gconv/gconv-modules.cache puppetd 10726 root0r   CHR
1,3  0t0 3820 /dev/null puppetd 10726 root1w   CHR
1,3  0t0 3820 /dev/null puppetd 10726 root2w   CHR
1,3  0t0 3820 /dev/null puppetd 10726 root3r  FIFO
0,8  0t0 17283753 pipe puppetd 10726 root4w  FIFO
0,8  0t0 17283753 pipe puppetd 10726 root5u  unix
0x88013680b0c0  0t0 17283804 socket puppetd 10726 root
6u   REG8,1 6045  3145906
/var/log/puppet/http.log puppetd 10726 root7u  IPv4
17283830  0t0  TCP *:8139 (LISTEN)


If I look at what puppet is running:

# ps -elfw | grep 10726 5 S root 10726 1  0  81   1 - 61549
poll_s 15:15 ?00:00:17 /usr/bin/ruby /usr/sbin/puppetd
--debug --verbose 0 Z root 11429 10726  0  81   1 - 0 exit
15:39 ?00:00:00 [sh]defunct


Help?

...dave


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+Ep60ACgkQM2eZoKJfKd11IwCcD1RMeMIg4RNYpPkBGMzEJEcE
1q4An1I9V38LBia1+qBq/+vgwjXENNWe
=q7y/
-END PGP SIGNATURE-



--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Puppet not creating manifest file?

2012-04-11 Thread Kaya Saman
Ok no joy :-(


On client:

[root@pc puppet]# puppetd --server ps.jabber.com --waitforcert 60 --test
warning: peer certificate won't be verified in this SSL session
info: Caching certificate for pc.jabber.com
err: Could not retrieve catalog from remote server: hostname was not
match with the server certificate
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
err: Could not send report: hostname was not match with the server certificate


On server:


[root@ps var]# /opt/puppet/sbin/puppetca --list
  pc.jabber.com  (D2:66:2E:65:3B:DA:D0:C2:CA:12:42:8E:69:12:00:98)
  puppet-test-client (5C:C4:3F:94:02:C3:D0:BD:F1:EB:F2:BB:A2:37:FD:3A)
[root@ps var]# /opt/puppet/sbin/puppetca --sign pc.jabber.com
notice: Signed certificate request for pc.jabber.com
notice: Removing file Puppet::SSL::CertificateRequest pc.jabber.com at
'/etc/puppetlabs/puppet/ssl/ca/requests/pc.jabber.com.pem'



What happens if I use my FreeBSD clean install and transfer the
config over from the PuppetLabs image??

I mean is it the server or client that's not wanting to cooperate?


Regards,


Kaya



On Tue, Apr 10, 2012 at 6:45 PM,  kayasa...@gmail.com wrote:
 Thanks.

 Am currently on bus going home but will get back asap tomorrow morning once
 I get back into the office :-)

 I appreciate everybodies input!
 Sent from my BlackBerry® wireless device
 
 From: Peter Berghold salty.cowd...@gmail.com
 Sender: puppet-users@googlegroups.com
 Date: Tue, 10 Apr 2012 13:40:29 -0400
 To: puppet-users@googlegroups.com
 ReplyTo: puppet-users@googlegroups.com
 Subject: Re: [Puppet Users] Puppet not creating manifest file?

 What Ashish recommends may be a bit extreme, but I've had to at the very
 least clean up /var/lib/puppet on particularly recalcitrant clients.  So it
 is not out of the bounds of being reasonable.


 On Tue, Apr 10, 2012 at 1:33 PM, Ashish Jaiswal ashish1...@gmail.com
 wrote:

 Here is what I would suggest.

 Clean the /var/lib/puppet directory on both server as well as client.
 And then restart puppetmaster on the server.

 # puppetd --server your.servername.com --waitforcert 60 --test

 Then check on server

 # puppetca --list

 You can see the list of the client

 # puppetca --sign client-name.fqdn

 Then run this command on client

 # puppet agent --test

 I know you have did the same for n times and another thing is that check
 both the date and time whether it is  proper or not on both server and
 client while performing the above test.

 if any error let me know.


 On Tuesday 10 April 2012 10:51:00 PM IST, Peter Berghold wrote:

 OK

 This is why I took you down the path I did.   Essentially what you
 want to have happen is the client should generate its own cert and
 during its first interaction with the master get it signed by the master.

 On Tue, Apr 10, 2012 at 12:17 PM, Kaya Saman kayasa...@gmail.com
 mailto:kayasa...@gmail.com wrote:

    Again more weirdness as running:

    puppetca --clean pc.jabber.com http://pc.jabber.com on server

    yields client to respond with:

    [root@pc puppet]# puppet agent --waitforcert=1


 Forgot the --test invocation.  What that command line does is start
 the agent as a daemon and wait for the master to sign its cert.

 Kill off the agent :

 ps -ef | grep agent
 note the pid
 kill -9 pid

 clean out the ssl dirs that exist on the client

 kill off the cert on the master

 puppet agent --test --waitforcert=1

 That should get it for you...

    [root@pc puppet]# puppet agent --test
    err: Could not request certificate: Retrieved certificate does not
    match private key; please remove certificate from server and
    regenerate it with the current key
    Exiting; failed to retrieve certificate and waitforcert is disabled

    ??

    How do I regenerate the certificate with the current key?


    puppet -t creates a new cert but how does that function with key?



    Regards


    On Tue, Apr 10, 2012 at 4:37 PM, Kaya Saman kayasa...@gmail.com
    mailto:kayasa...@gmail.com wrote:
     It's the Puppet OVF learn.localdomain Puppet image I downloaded from
     the puppetlabs website!
    
     Here is URL:
    
     http://docs.puppetlabs.com/learning/
    
    
     http://info.puppetlabs.com/download-learning-puppet-VM.html
    
    
     It's a CentOS based system but stores Puppet in /opt/puppet rather
     then your typical local install.
    
     I've got a FreeBSD clean Puppet server too which is unconfigured
    as of
     yet so just waiting to get this running before I move on to
    something
     more complex.
    
    
     Regards,
    
    
     Kaya
    
    
     On Tue, Apr 10, 2012 at 4:34 PM, Peter Berghold
    salty.cowd...@gmail.com mailto:salty.cowd...@gmail.com wrote:
     Eh?  What platform are you running on and why /etc/puppetlabs?
    
    
    
    
     On Tue, Apr 10, 2012 at 11:31 AM, Kaya Saman
    kayasa...@gmail.com mailto:kayasa...@gmail.com wrote:
    
     Ok 

[Puppet Users] Asynchronous file transfer through puppet ????

2012-04-11 Thread sanjiv singh

Hi All,
 I  have configured *puppet with passenger with LDAP as 
configuration store*.. Using puppet for deploying application different 
machines. Application deployment consist of pushing numerous templates, 
flat files(JARs,ZIPs,WARs etc) and various system/application level 
configuration changes.

 I have written puppet manifest accordingly.Here is sample for 
pushing two ZIPs. 
   #
file { /home/user/application1.zip:
group = 'app',
source = puppet://puppet/${environment}/application1.zip,
}
file { /home/user/application2.zip:
group = 'app',
source = puppet://puppet/${environment}/application2.zip, 
}
#---
what am i questioning here is that puppet daemon execution is single 
threaded.It processes each resource one-by-one( based on dependencies) .In 
this case FILE resource. It transfers file Zips one-by-one irrespective of 
dependency.

Is there any way, we can configure puppet/passenger so that it can 
transfer files asynchronously. If its does not have dependency,puppet 
daemon spawning thread for asynchronous file transfer ?

In my environment, I need to transfer number of files. More files means 
more delay in puppet daemon execution.

I am trying to achieve some performance gain over application 
deployment. 


Regards,
*Sanjiv Singh *
Software Engineer (iLabs)
Impetus Infotech (India) Pvt. Ltd. 
**

** 

   


 



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/nThNbBIMVU8J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] FreeBSD Port

2012-04-11 Thread JA
I have installed puppet using the FreeBSD port.  However, when I try
to use the agent, it attempts to start the puppetd daemon.  It seems
that there is no way to use this installation without running the
daemon.  Can anyone shed any light on this?

Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Puppet not creating manifest file?

2012-04-11 Thread Peter Berghold
Kaya,

Did you clean out:


   - /var/lib/puppet
   - /etc/puppet/ssl


before you re-ran?


The error you are seeing indicates there is a mismatch between hostname is
associated with the server's certificate and what notion the client has for
the server's name.

Do you have DNS configured on the client (and server) and what does your
resolv.conf have in it?  That could effect what the client sees as its own
name as well as the server's name.

If you do not have DNS configured on the client then there are other things
to look at.  What do you see if you run the command

ping puppet -c 1

This should answer a lot..


On Wed, Apr 11, 2012 at 5:03 AM, Kaya Saman kayasa...@gmail.com wrote:

 Ok no joy :-(


 On client:

 [root@pc puppet]# puppetd --server ps.jabber.com --waitforcert 60 --test
 warning: peer certificate won't be verified in this SSL session
 info: Caching certificate for pc.jabber.com
 err: Could not retrieve catalog from remote server: hostname was not
 match with the server certificate
 warning: Not using cache on failed catalog
 err: Could not retrieve catalog; skipping run
 err: Could not send report: hostname was not match with the server
 certificate


 On server:


 [root@ps var]# /opt/puppet/sbin/puppetca --list
  pc.jabber.com  (D2:66:2E:65:3B:DA:D0:C2:CA:12:42:8E:69:12:00:98)
   puppet-test-client (5C:C4:3F:94:02:C3:D0:BD:F1:EB:F2:BB:A2:37:FD:3A)
 [root@ps var]# /opt/puppet/sbin/puppetca --sign pc.jabber.com
 notice: Signed certificate request for pc.jabber.com
 notice: Removing file Puppet::SSL::CertificateRequest pc.jabber.com at
 '/etc/puppetlabs/puppet/ssl/ca/requests/pc.jabber.com.pem'



 What happens if I use my FreeBSD clean install and transfer the
 config over from the PuppetLabs image??

 I mean is it the server or client that's not wanting to cooperate?


 Regards,


 Kaya



 On Tue, Apr 10, 2012 at 6:45 PM,  kayasa...@gmail.com wrote:
  Thanks.
 
  Am currently on bus going home but will get back asap tomorrow morning
 once
  I get back into the office :-)
 
  I appreciate everybodies input!
  Sent from my BlackBerry® wireless device
  
  From: Peter Berghold salty.cowd...@gmail.com
  Sender: puppet-users@googlegroups.com
  Date: Tue, 10 Apr 2012 13:40:29 -0400
  To: puppet-users@googlegroups.com
  ReplyTo: puppet-users@googlegroups.com
  Subject: Re: [Puppet Users] Puppet not creating manifest file?
 
  What Ashish recommends may be a bit extreme, but I've had to at the very
  least clean up /var/lib/puppet on particularly recalcitrant clients.  So
 it
  is not out of the bounds of being reasonable.
 
 
  On Tue, Apr 10, 2012 at 1:33 PM, Ashish Jaiswal ashish1...@gmail.com
  wrote:
 
  Here is what I would suggest.
 
  Clean the /var/lib/puppet directory on both server as well as client.
  And then restart puppetmaster on the server.
 
  # puppetd --server your.servername.com --waitforcert 60 --test
 
  Then check on server
 
  # puppetca --list
 
  You can see the list of the client
 
  # puppetca --sign client-name.fqdn
 
  Then run this command on client
 
  # puppet agent --test
 
  I know you have did the same for n times and another thing is that check
  both the date and time whether it is  proper or not on both server and
  client while performing the above test.
 
  if any error let me know.
 
 
  On Tuesday 10 April 2012 10:51:00 PM IST, Peter Berghold wrote:
 
  OK
 
  This is why I took you down the path I did.   Essentially what you
  want to have happen is the client should generate its own cert and
  during its first interaction with the master get it signed by the
 master.
 
  On Tue, Apr 10, 2012 at 12:17 PM, Kaya Saman kayasa...@gmail.com
  mailto:kayasa...@gmail.com wrote:
 
 Again more weirdness as running:
 
 puppetca --clean pc.jabber.com http://pc.jabber.com on server
 
 yields client to respond with:
 
 [root@pc puppet]# puppet agent --waitforcert=1
 
 
  Forgot the --test invocation.  What that command line does is start
  the agent as a daemon and wait for the master to sign its cert.
 
  Kill off the agent :
 
  ps -ef | grep agent
  note the pid
  kill -9 pid
 
  clean out the ssl dirs that exist on the client
 
  kill off the cert on the master
 
  puppet agent --test --waitforcert=1
 
  That should get it for you...
 
 [root@pc puppet]# puppet agent --test
 err: Could not request certificate: Retrieved certificate does not
 match private key; please remove certificate from server and
 regenerate it with the current key
 Exiting; failed to retrieve certificate and waitforcert is disabled
 
 ??
 
 How do I regenerate the certificate with the current key?
 
 
 puppet -t creates a new cert but how does that function with key?
 
 
 
 Regards
 
 
 On Tue, Apr 10, 2012 at 4:37 PM, Kaya Saman kayasa...@gmail.com
 mailto:kayasa...@gmail.com wrote:
  It's the Puppet OVF learn.localdomain Puppet image I downloaded
 from
  the puppetlabs website!
   

[Puppet Users] Re: Is Hiera the right tool for this ?

2012-04-11 Thread jcbollinger


On Apr 10, 9:58 am, Jeff jixe...@hotmail.com wrote:
 Many thanks to you John and Nan.  Using the hiera_hash function provides
 the desired behavior and it effectively replaced the need for resource
 capitalization for my use case.

 One last thing Im puzzled with if I may:  A more complex use case where a
 parameter has to be set based on 2 criterias together on the same hiera
 level,  lets say 'os' and 'role' (like a sysctl for an app server under
 rhel4 vs rhel5 ),  how would you solve this ?

 ---
 :hierarchy:
     - %{fqdn}
     - %{environnement}
     - %{datacenter}
     - %{os}
     - %{role}
     - common


I think the %{foo} syntax is just doing a text interpolation, so you
should be able to define a level such as
- %{os}_%{role}

I would try to resist doing so, however, because a simpler hierarchy
will be easier to maintain, and also because of the combinatorial
implications.  You might find that you can instead combine separate
pieces of data from your %{os} and %{role} levels inside your
manifests (or templates) to construct the target value.

Do not neglect the possibilities inherent in hiera's support for
complex data types.  For example, one of the items in your %{os} data
could be a *table* (as a hash) of possible target values for some
property.  Then your %{role} data could specify which key into that
table to use to select the appropriate value for the os/role
combination.


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Database and user not created (Puppetlabs mysql module)

2012-04-11 Thread Moteo Air
Hi Luca,

sadly I left nice puppet way for a while for Mysql management and
did everything manuallly :(

Best regards
M.

2012/3/28 Luca Spiller l...@stackednotion.com:
 Moteo, did you get this issue resolved?

 I've used the Puppetlabs MySql module in the past, but I'm now getting these
 issues setting up a new machine with Ubuntu 11.10. I've used the same Puppet
 scripts on other Ubuntu 11.10 machines previously with no issues.

 On Thursday, 15 March 2012 10:51:04 UTC, Moteo wrote:

 I will try this module.

 Thank You Adam.

 2012/3/14 Adam Heinz a...@metricwise.net:
  I don't know anything about that particular module, but I have been
  using github.com/camptocamp/puppet-mysql for over a year without much
  trouble.
 
  --
  You received this message because you are subscribed to the Google
  Groups Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/puppet-users?hl=en.
 

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/puppet-users/-/ZwavJYd6jwMJ.

 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Asynchronous file transfer through puppet ????

2012-04-11 Thread jcbollinger

On Apr 11, 4:05 am, sanjiv singh sanjiv.is...@gmail.com wrote:
 Hi All,
          I  have configured *puppet with passenger with LDAP as
 configuration store*.. Using puppet for deploying application different
 machines. Application deployment consist of pushing numerous templates,
 flat files(JARs,ZIPs,WARs etc) and various system/application level
 configuration changes.

          I have written puppet manifest accordingly.Here is sample for
 pushing two ZIPs.
    #
     file { /home/user/application1.zip:
     group = 'app',
     source = puppet://puppet/${environment}/application1.zip,
     }
     file { /home/user/application2.zip:
     group = 'app',
     source = puppet://puppet/${environment}/application2.zip,
     }
     #---
     what am i questioning here is that puppet daemon execution is single
 threaded.It processes each resource one-by-one( based on dependencies) .In
 this case FILE resource. It transfers file Zips one-by-one irrespective of
 dependency.

     Is there any way, we can configure puppet/passenger so that it can
 transfer files asynchronously. If its does not have dependency,puppet
 daemon spawning thread for asynchronous file transfer ?

     In my environment, I need to transfer number of files. More files means
 more delay in puppet daemon execution.

     I am trying to achieve some performance gain over application
 deployment.


For application deployment, it is usually much better to build
packages suitable for the target's native packaging system (RPMs, for
example), put them in a local repository, and use Package resources to
install them.  This is likely to perform much better than will using
File resources to transfer many files.

In any event, unless you're talking about large numbers of small
files, you are probably saturating your bandwidth already.  Parallel
file transfer will not help you in that case, and it might even
introduce enough additional I/O overhead to slow you down overall.  In
any case, it would likely reduce the maximum number of clients each
master could support.

If you don't want to build packages, then a better bet for speeding up
your runs is to tweak the 'checksum' property and maybe the 'backup'
property of your File resources.  For the checksum, 'md5lite' should
be somewhat faster than the default ('md5'), and 'mtime' should be
substantially faster.  Setting the 'backup' parameter to 'false'
should also speed things a bit.  Note, however, that changing these
settings from their defaults gains speed by reducing integrity
protection.


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] FreeBSD Port

2012-04-11 Thread Christopher Wood
(I'm just starting with FreeBSD, albeit with some months of puppet experience.)

The puppet agent implies a daemon, but try something like this for a single run 
in the foreground:

puppet agent --no-daemonize --onetime

On Wed, Apr 11, 2012 at 07:31:14AM -0400, JA wrote:
 I have installed puppet using the FreeBSD port.  However, when I try
 to use the agent, it attempts to start the puppetd daemon.  It seems
 that there is no way to use this installation without running the
 daemon.  Can anyone shed any light on this?
 
 Thank you!
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.
 
 

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppetd locking up?

2012-04-11 Thread David Alden
Hi,
 Thanks for all of the replies so far.

On Apr 10, 2012, at 5:37 PM, Jean Baptiste FAVRE wrote:
 Seems to be the same as described here:
 https://groups.google.com/forum/?fromgroups#!topic/puppet-users/N1XcMTth7mE

Yes it does.


On Apr 11, 2012, at 3:16 AM, Elias Abacioglu wrote:

 I have the same issue I think. With 2.7.6 and 2.7.11.
 https://projects.puppetlabs.com/issues/13000

Yup - that also describes the same issue.

At least I'm not alone in this.  :-)

...dave

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppetd locking up?

2012-04-11 Thread David Alden
Hi,


 On Apr 10, 2012, at 5:43 PM, Jeff McCune wrote:
 Hey Dave, is this running the stock Ruby that comes with EL6 ?

Yup:

ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]


This seems to be the same as:

https://projects.puppetlabs.com/issues/13000

...dave

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] FreeBSD Port

2012-04-11 Thread JA
Thanks so much!

However, I am a bit stumped and would so appreciate any clarity you can provide.

If I execute 'puppet agent --test' on a RHEL box, it does not start
the daemon.  But, if I do the same thing using the FreeBSD port, it
does attempt to start the daemon.

Obviously, I am missing something here...

Thanks!
Jackie

On Wed, Apr 11, 2012 at 10:02 AM, Christopher Wood
christopher_w...@pobox.com wrote:
 (I'm just starting with FreeBSD, albeit with some months of puppet 
 experience.)

 The puppet agent implies a daemon, but try something like this for a single 
 run in the foreground:

 puppet agent --no-daemonize --onetime

 On Wed, Apr 11, 2012 at 07:31:14AM -0400, JA wrote:
 I have installed puppet using the FreeBSD port.  However, when I try
 to use the agent, it attempts to start the puppetd daemon.  It seems
 that there is no way to use this installation without running the
 daemon.  Can anyone shed any light on this?

 Thank you!

 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.



 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] FreeBSD Port

2012-04-11 Thread Darryl Wisneski
Why not this? 

'puppet agent -t' or 'puppet agent --test'

From puppet help..  (ughh, no manpage)

* --test:
  Enable the most common options used for testing. These are 'onetime',
  'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure',
  'detailed-exit-codes', 'no-splay', and 'show_diff'.

-dkw


On Wed, Apr 11, 2012 at 10:02:10AM -0400, Christopher Wood wrote:
 (I'm just starting with FreeBSD, albeit with some months of puppet 
 experience.)
 
 The puppet agent implies a daemon, but try something like this for a single 
 run in the foreground:
 
 puppet agent --no-daemonize --onetime
 
 On Wed, Apr 11, 2012 at 07:31:14AM -0400, JA wrote:
  I have installed puppet using the FreeBSD port.  However, when I try
  to use the agent, it attempts to start the puppetd daemon.  It seems
  that there is no way to use this installation without running the
  daemon.  Can anyone shed any light on this?
  
  Thank you!
  
  -- 
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/puppet-users?hl=en.
  
  
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] FreeBSD Port

2012-04-11 Thread JA
The thing is, when I execute

puppet agent --test

It tries to start the daemon automatically.  I do not get this same
behavior on RHEL and I am trying to understand this  I am totally
new to puppet land so, maybe I am just missing something here

Thanks!
Jackie

On Wed, Apr 11, 2012 at 10:33 AM, Darryl Wisneski
dar...@prometheusresearch.com wrote:
 Why not this?

 'puppet agent -t' or 'puppet agent --test'

 From puppet help..  (ughh, no manpage)

 * --test:
  Enable the most common options used for testing. These are 'onetime',
  'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure',
  'detailed-exit-codes', 'no-splay', and 'show_diff'.

 -dkw


 On Wed, Apr 11, 2012 at 10:02:10AM -0400, Christopher Wood wrote:
 (I'm just starting with FreeBSD, albeit with some months of puppet 
 experience.)

 The puppet agent implies a daemon, but try something like this for a single 
 run in the foreground:

 puppet agent --no-daemonize --onetime

 On Wed, Apr 11, 2012 at 07:31:14AM -0400, JA wrote:
  I have installed puppet using the FreeBSD port.  However, when I try
  to use the agent, it attempts to start the puppetd daemon.  It seems
  that there is no way to use this installation without running the
  daemon.  Can anyone shed any light on this?
 
  Thank you!
 
  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/puppet-users?hl=en.
 
 

 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.


 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] FreeBSD Port

2012-04-11 Thread Christopher Wood
I couldn't say, perhaps different versions? Or run with more verbosity and see 
what both versions are doing.

Puppet 2.6.2 on Debian Stable (6.0.4):

Enable the most common options used for testing. These are +onetime+, 
+verbose+, +ignorecache, +no-daemonize+, and +no-usecacheonfailure+.

Puppet 2.7.6 on FreeBSD (9.0-RELEASE):

Enable the most common options used for testing. These are 'onetime', 
'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure', 
'detailed-exit-codes', 'no-splay', and 'show_diff'.

I'm not sure it matters as long as you can get a onetime run. Dig into the ruby 
code if it's really bothering you, of course.

As to Darryl's comment in another branch, I haven't needed more than 
no-daemonize, verbose, and debug to solve all my problems so far.

On Wed, Apr 11, 2012 at 10:27:19AM -0400, JA wrote:
 Thanks so much!
 
 However, I am a bit stumped and would so appreciate any clarity you can 
 provide.
 
 If I execute 'puppet agent --test' on a RHEL box, it does not start
 the daemon.  But, if I do the same thing using the FreeBSD port, it
 does attempt to start the daemon.
 
 Obviously, I am missing something here...
 
 Thanks!
 Jackie
 
 On Wed, Apr 11, 2012 at 10:02 AM, Christopher Wood
 christopher_w...@pobox.com wrote:
  (I'm just starting with FreeBSD, albeit with some months of puppet 
  experience.)
 
  The puppet agent implies a daemon, but try something like this for a single 
  run in the foreground:
 
  puppet agent --no-daemonize --onetime
 
  On Wed, Apr 11, 2012 at 07:31:14AM -0400, JA wrote:
  I have installed puppet using the FreeBSD port.  However, when I try
  to use the agent, it attempts to start the puppetd daemon.  It seems
  that there is no way to use this installation without running the
  daemon.  Can anyone shed any light on this?
 
  Thank you!
 
  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/puppet-users?hl=en.
 
 
 
  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/puppet-users?hl=en.
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.
 
 

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] FreeBSD Port

2012-04-11 Thread Darryl Wisneski
Jackie:

Please post your 1.) puppet.conf, OS Relase, and version of puppet.

2.) uname -a 
3.) pkg_info |grep puppet

Can you check the ps output to make sure there wasn't already a
running puppet.  Do you have any jails on the machine that may be
running puppet as well and causing PID confusion?

Thanks,
-dkw

On Wed, Apr 11, 2012 at 10:50:10AM -0400, Christopher Wood wrote:
 I couldn't say, perhaps different versions? Or run with more verbosity and 
 see what both versions are doing.
 
 Puppet 2.6.2 on Debian Stable (6.0.4):
 
 Enable the most common options used for testing. These are +onetime+, 
 +verbose+, +ignorecache, +no-daemonize+, and +no-usecacheonfailure+.
 
 Puppet 2.7.6 on FreeBSD (9.0-RELEASE):
 
 Enable the most common options used for testing. These are 'onetime', 
 'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure', 
 'detailed-exit-codes', 'no-splay', and 'show_diff'.
 
 I'm not sure it matters as long as you can get a onetime run. Dig into the 
 ruby code if it's really bothering you, of course.
 
 As to Darryl's comment in another branch, I haven't needed more than 
 no-daemonize, verbose, and debug to solve all my problems so far.
 
 On Wed, Apr 11, 2012 at 10:27:19AM -0400, JA wrote:
  Thanks so much!
  
  However, I am a bit stumped and would so appreciate any clarity you can 
  provide.
  
  If I execute 'puppet agent --test' on a RHEL box, it does not start
  the daemon.  But, if I do the same thing using the FreeBSD port, it
  does attempt to start the daemon.
  
  Obviously, I am missing something here...
  
  Thanks!
  Jackie
  
  On Wed, Apr 11, 2012 at 10:02 AM, Christopher Wood
  christopher_w...@pobox.com wrote:
   (I'm just starting with FreeBSD, albeit with some months of puppet 
   experience.)
  
   The puppet agent implies a daemon, but try something like this for a 
   single run in the foreground:
  
   puppet agent --no-daemonize --onetime
  
   On Wed, Apr 11, 2012 at 07:31:14AM -0400, JA wrote:
   I have installed puppet using the FreeBSD port. ?However, when I try
   to use the agent, it attempts to start the puppetd daemon. ?It seems
   that there is no way to use this installation without running the
   daemon. ?Can anyone shed any light on this?
  
   Thank you!
  
   --
   You received this message because you are subscribed to the Google 
   Groups Puppet Users group.
   To post to this group, send email to puppet-users@googlegroups.com.
   To unsubscribe from this group, send email to 
   puppet-users+unsubscr...@googlegroups.com.
   For more options, visit this group at 
   http://groups.google.com/group/puppet-users?hl=en.
  
  
  
   --
   You received this message because you are subscribed to the Google Groups 
   Puppet Users group.
   To post to this group, send email to puppet-users@googlegroups.com.
   To unsubscribe from this group, send email to 
   puppet-users+unsubscr...@googlegroups.com.
   For more options, visit this group at 
   http://groups.google.com/group/puppet-users?hl=en.
  
  
  -- 
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/puppet-users?hl=en.
  
  
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] FreeBSD Port

2012-04-11 Thread JA
Thank you.. much appreciate the info!

On Wed, Apr 11, 2012 at 10:50 AM, Christopher Wood
christopher_w...@pobox.com wrote:
 I couldn't say, perhaps different versions? Or run with more verbosity and 
 see what both versions are doing.

 Puppet 2.6.2 on Debian Stable (6.0.4):

 Enable the most common options used for testing. These are +onetime+, 
 +verbose+, +ignorecache, +no-daemonize+, and +no-usecacheonfailure+.

 Puppet 2.7.6 on FreeBSD (9.0-RELEASE):

 Enable the most common options used for testing. These are 'onetime', 
 'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure', 
 'detailed-exit-codes', 'no-splay', and 'show_diff'.

 I'm not sure it matters as long as you can get a onetime run. Dig into the 
 ruby code if it's really bothering you, of course.

 As to Darryl's comment in another branch, I haven't needed more than 
 no-daemonize, verbose, and debug to solve all my problems so far.

 On Wed, Apr 11, 2012 at 10:27:19AM -0400, JA wrote:
 Thanks so much!

 However, I am a bit stumped and would so appreciate any clarity you can 
 provide.

 If I execute 'puppet agent --test' on a RHEL box, it does not start
 the daemon.  But, if I do the same thing using the FreeBSD port, it
 does attempt to start the daemon.

 Obviously, I am missing something here...

 Thanks!
 Jackie

 On Wed, Apr 11, 2012 at 10:02 AM, Christopher Wood
 christopher_w...@pobox.com wrote:
  (I'm just starting with FreeBSD, albeit with some months of puppet 
  experience.)
 
  The puppet agent implies a daemon, but try something like this for a 
  single run in the foreground:
 
  puppet agent --no-daemonize --onetime
 
  On Wed, Apr 11, 2012 at 07:31:14AM -0400, JA wrote:
  I have installed puppet using the FreeBSD port.  However, when I try
  to use the agent, it attempts to start the puppetd daemon.  It seems
  that there is no way to use this installation without running the
  daemon.  Can anyone shed any light on this?
 
  Thank you!
 
  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/puppet-users?hl=en.
 
 
 
  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/puppet-users?hl=en.
 

 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.



 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Puppet Certificate's

2012-04-11 Thread Sean McGrath
Firstly my apologies for posting this if it has been answered
elsewhere and I missed it while looking.

I'm starting to look at using Puppet to manage our fleet of Mac's
running OS X in our lab environment and I'm quite impressed with it
from my testing so far.

I have tested the functionality of the autosign.conf file with the
hostnames of the trusted clients in it.

However, if I re-image one of the Mac's as we occasionally do that
destroys the client certificate that it uses for the puppetca request.
Thus the puppet master see's a request with a different certificate
from a node with a hostname that has had its trust relationship
established with a different certificate.

This is probably a noob question but I haven't been able to figure it
out. How do I get around this in an automated manner. I don't want to
have to revoke certificates each time I re-image a Mac so they can be
re-trusted by the puppet master. Is there something like a root
certificate I could build into the image to establish the trust
relationship easily and securely each time a Mac is re-imaged?

many thanks

Sean

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Facter not initialized in rspec in puppetlabs-stdlib?

2012-04-11 Thread Jeff McCune
On Tue, Apr 10, 2012 at 11:00 PM, Wil Cooley wilcoo...@gmail.com wrote:
 I have been working on adding some predicate functions to puppetlabs-stdlib
 that test things based on 'interfaces' and related facts.

Sweet!

 The functions themselves seem to work fine in my manifest-based smoketests,
 but I am running into trouble that may or may not be due to my ignorance
 about rspec or Facter. Something needs to be done to initialize Facter
 because lookupvar('interfaces') just returns :undefined. I have not found
 any examples in the existing rspec tests; getvar_spec.rb seems like it
 should have something but the tests it does are pretty basic.

In general, you should assume the spec_helper for stdlib will
initialize facter for you.  In fact, you don't need to do require
'facter' in your example specification.

 You can see some of what I've been trying at
 https://github.com/wcooley/puppetlabs-stdlib/blob/master/spec/unit/puppet/parser/functions/has_interface_with_spec.rb

Cool, I went ahead and pulled down your branch.  If I might make a
suggestion, I notice you're developing on the master branch and you
have a number of commits that have not actually been merged into the
master branch of the puppetlabs repository.

This situation of having two different branches, both named master, is
confusing and makes it a bit difficult to work with.

When using Git, creating new branches is almost effortless.  It's just
two commands.

When you start hacking please create a topic branch:

# Create a branch indicating this is a new feature based on master
having something to do with an interface function
git branch feature/master/has_interface_with_function origin/master
# Checkout the branch
git checkout feature/master/has_interface_with_spec
# Hack away

It's also fairly easy to rename your current topic branch which is
named master

# Rename your local master branch to a topic branch
git branch rename master  feature/master/has_interface_with_function

# Push the new name to your github repository
git push wcooley
feature/master/has_interface_with_function:feature/master/has_interface_with_function

# Set your local topic branch to track the published copy of it.
git branch --set-upstream feature/master/has_interface_with_function
wcooley/feature/master/has_interface_with_function

# Re-synchronize the Puppet Labs master branch (I assume origin is
git://github.com/puppetlabs/puppetlabs-stdlib.git)
git fetch origin

# Create your local master tracking Puppet Labs master  (These should
always be in sync.  Don't commit on this branch...)
git branch master --track origin/master

# Replace your own master branch on Github with the Puppet Labs master
branch (because it's not actually master right now)
git push wcooley +origin/master:master

# Finally, work in your topic branch
git co feature/master/has_interface_with_function

 Is there something obvious I'm missing?

The setup looks to be quite strange.  You shouldn't ever need to
define a get_scope method.  I recommend looking at the
validate_re_spec.rb for a good example.

I'm also re-working your topic branch in my own if you'd like to take
a look at the changes.

-Jeff

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Unable to access hash elements directly from templates

2012-04-11 Thread Josh
I am using puppet version 6.2 (the one that comes with squeeze) in case it 
makes a difference.

I am new to puppet and am having a problem getting access to the elements 
of a hash in my erb templates and no matter what I google for I cannot seem 
to find out what I am doing wrong. 

I have stripped everything back to example code to rule out other things, 
in reality I have split my files up a but to avoid the monolithic init.pp 
and nodes.pp. Anyway...

my nodes.pp has this in it:

node 'pc01.domain.com' {

  # Test code
  $myhash = { 
key = { 
  subkey1 = 'foo',
  subkey2 = 'bar'
}
  }

  include mymodule
}

Then in the modules init.pp I have:

class mymodule {
  # Test code
  notice($myhash[key][subkey1])
  notice($myhash[key][subkey2])
  file { /tmp/test:
ensure = present,
content = template(mymodule/test.erb),
  }
}

If I run puppet against this the two notice lines work fine so I have 
access to the data within the module, the problem is getting it into the 
template. I tried a few different syntaxes to no effect:

So first I tried a template like so:
TEST: %= $myhash[key][subkey1] %

This gave me the error:
*err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Failed to parse template mymodule/test.erb: Could not find value for 'key' 
at /etc/puppet/modules/mymodule/manifests/init.pp:7 on node pc01.domain.com*

If I quote the string in the template (i.e. %= $myhash[key][subkey1] %) 
then it just spits out that string into the file rather than interpreting 
the data.

I have similar errors if I try to use scope.lookupvar to explicitly specify 
where things are too.

So, what am I doing wrong or is it just not possible to pick a single hash 
element and put it into a template.

Thanks
Josh
p.s. my Ruby sucks so if I have to go down that route it'll need to be a 
noddy explanation

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/nSPGiquUVBIJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Unable to access hash elements directly from templates

2012-04-11 Thread Gary Larizza
Hey Josh,

Don't use the $ for variables in Templates - Puppet variables and arrays
are accessed as local variables/arrays in templates.  So try this:  TEST:
%= myhash[key][subkey1] %


On Wed, Apr 11, 2012 at 9:04 AM, Josh j...@chickenmonkey.co.uk wrote:

 I am using puppet version 6.2 (the one that comes with squeeze) in case it
 makes a difference.

 I am new to puppet and am having a problem getting access to the elements
 of a hash in my erb templates and no matter what I google for I cannot seem
 to find out what I am doing wrong.

 I have stripped everything back to example code to rule out other things,
 in reality I have split my files up a but to avoid the monolithic init.pp
 and nodes.pp. Anyway...

 my nodes.pp has this in it:

 node 'pc01.domain.com' {

   # Test code
   $myhash = {
 key = {
   subkey1 = 'foo',
   subkey2 = 'bar'
 }
   }

   include mymodule
 }

 Then in the modules init.pp I have:

 class mymodule {
   # Test code
   notice($myhash[key][subkey1])
   notice($myhash[key][subkey2])
   file { /tmp/test:
 ensure = present,
 content = template(mymodule/test.erb),
   }
 }

 If I run puppet against this the two notice lines work fine so I have
 access to the data within the module, the problem is getting it into the
 template. I tried a few different syntaxes to no effect:

 So first I tried a template like so:
 TEST: %= $myhash[key][subkey1] %

 This gave me the error:
 *err: Could not retrieve catalog from remote server: Error 400 on SERVER:
 Failed to parse template mymodule/test.erb: Could not find value for 'key'
 at /etc/puppet/modules/mymodule/manifests/init.pp:7 on node
 pc01.domain.com*

 If I quote the string in the template (i.e. %= $myhash[key][subkey1] %)
 then it just spits out that string into the file rather than interpreting
 the data.

 I have similar errors if I try to use scope.lookupvar to explicitly
 specify where things are too.

 So, what am I doing wrong or is it just not possible to pick a single hash
 element and put it into a template.

 Thanks
 Josh
 p.s. my Ruby sucks so if I have to go down that route it'll need to be a
 noddy explanation

  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/puppet-users/-/nSPGiquUVBIJ.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.




-- 

Gary Larizza
Professional Services Engineer
Puppet Labs

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Facter not initialized in rspec in puppetlabs-stdlib?

2012-04-11 Thread Jeff McCune
Wil,

I went ahead and re-worked the example specification.

Please take a look at the commit message and the way I'm setting an
expectation that mocks the behavior of lookupvar for both Mac OS X and
Linux.

https://github.com/jeffmccune/puppetlabs-stdlib/tree/feature/master/has_interface_with

$ rspec --format d spec/unit/puppet/parser/functions/has_interface_with_spec.rb

function_has_interface_with
  On Mac OS X Systems
should have loopback (lo0)
should not have loopback (lo)
  On Linux Systems
should have loopback (lo)
should not have loopback (lo0)

Finished in 0.04262 seconds
4 examples, 0 failures

Please feel free to reply here if you have any questions.  We might
also want to consider moving this thread to puppet-dev since it's
developing a new function.

Hope this helps,
-Jeff

On Wed, Apr 11, 2012 at 9:03 AM, Jeff McCune j...@puppetlabs.com wrote:
 On Tue, Apr 10, 2012 at 11:00 PM, Wil Cooley wilcoo...@gmail.com wrote:
 I have been working on adding some predicate functions to puppetlabs-stdlib
 that test things based on 'interfaces' and related facts.

 Sweet!

 The functions themselves seem to work fine in my manifest-based smoketests,
 but I am running into trouble that may or may not be due to my ignorance
 about rspec or Facter. Something needs to be done to initialize Facter
 because lookupvar('interfaces') just returns :undefined. I have not found
 any examples in the existing rspec tests; getvar_spec.rb seems like it
 should have something but the tests it does are pretty basic.

 In general, you should assume the spec_helper for stdlib will
 initialize facter for you.  In fact, you don't need to do require
 'facter' in your example specification.

 You can see some of what I've been trying at
 https://github.com/wcooley/puppetlabs-stdlib/blob/master/spec/unit/puppet/parser/functions/has_interface_with_spec.rb

 Cool, I went ahead and pulled down your branch.  If I might make a
 suggestion, I notice you're developing on the master branch and you
 have a number of commits that have not actually been merged into the
 master branch of the puppetlabs repository.

 This situation of having two different branches, both named master, is
 confusing and makes it a bit difficult to work with.

 When using Git, creating new branches is almost effortless.  It's just
 two commands.

 When you start hacking please create a topic branch:

 # Create a branch indicating this is a new feature based on master
 having something to do with an interface function
 git branch feature/master/has_interface_with_function origin/master
 # Checkout the branch
 git checkout feature/master/has_interface_with_spec
 # Hack away

 It's also fairly easy to rename your current topic branch which is
 named master

 # Rename your local master branch to a topic branch
 git branch rename master  feature/master/has_interface_with_function

 # Push the new name to your github repository
 git push wcooley
 feature/master/has_interface_with_function:feature/master/has_interface_with_function

 # Set your local topic branch to track the published copy of it.
 git branch --set-upstream feature/master/has_interface_with_function
 wcooley/feature/master/has_interface_with_function

 # Re-synchronize the Puppet Labs master branch (I assume origin is
 git://github.com/puppetlabs/puppetlabs-stdlib.git)
 git fetch origin

 # Create your local master tracking Puppet Labs master  (These should
 always be in sync.  Don't commit on this branch...)
 git branch master --track origin/master

 # Replace your own master branch on Github with the Puppet Labs master
 branch (because it's not actually master right now)
 git push wcooley +origin/master:master

 # Finally, work in your topic branch
 git co feature/master/has_interface_with_function

 Is there something obvious I'm missing?

 The setup looks to be quite strange.  You shouldn't ever need to
 define a get_scope method.  I recommend looking at the
 validate_re_spec.rb for a good example.

 I'm also re-working your topic branch in my own if you'd like to take
 a look at the changes.

 -Jeff

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Puppet Certificate's

2012-04-11 Thread Gary Larizza
Hey Sean,

First - congrats on wrangling your Macs with Puppet! Next, I understand and
have shared your pain regarding timely imaging of workstations and Puppet
cert-wrangling.  Generally, I've seen folks do one of a couple of things:


   1. Autosign
   2. Utilize a CGI script to sign/revoke certs on the master (which can
   largely be replaced through the use of the `puppet cert` face)
   3. Use the same private key everywhere and change the individual
   node_name

Numbers 1 and 2 are largely process around signing individual certs for
every node.  You COULD even backup the $ssldir on your clients, image the
machine, install puppet, restore the $ssldir, and then run Puppet again and
Puppet will work fine for your clients.

Number 3 is a bit different.  With #3, you would have the SAME private cert
for EVERY node in your infrastructure.  Because of this, the certname must
be THE SAME for every node.  When you do this, however, Puppet treats every
node as if it were the SAME node - so you need a way to de-couple the name
of the node as Puppet knows it with the name of the node as the Certificate
knows it.  The solution is the 'node_name_fact' and 'node_name_value'
configuration item in puppet.conf --
http://docs.puppetlabs.com/references/stable/configuration.html#nodenamefact
You would essentially ship the private cert around to EVERY node, set
the
node_name_{fact,value} in puppet.conf, and then Puppet would treat each
machine as a separate node (even though the certificate is the same
everywhere).  Obviously there are security implications for this, but some
people prefer it to Autosigning.

Hopefully, this should help you on your way.


On Wed, Apr 11, 2012 at 8:31 AM, Sean McGrath seanc.mcgr...@gmail.comwrote:

 Firstly my apologies for posting this if it has been answered
 elsewhere and I missed it while looking.

 I'm starting to look at using Puppet to manage our fleet of Mac's
 running OS X in our lab environment and I'm quite impressed with it
 from my testing so far.

 I have tested the functionality of the autosign.conf file with the
 hostnames of the trusted clients in it.

 However, if I re-image one of the Mac's as we occasionally do that
 destroys the client certificate that it uses for the puppetca request.
 Thus the puppet master see's a request with a different certificate
 from a node with a hostname that has had its trust relationship
 established with a different certificate.

 This is probably a noob question but I haven't been able to figure it
 out. How do I get around this in an automated manner. I don't want to
 have to revoke certificates each time I re-image a Mac so they can be
 re-trusted by the puppet master. Is there something like a root
 certificate I could build into the image to establish the trust
 relationship easily and securely each time a Mac is re-imaged?

 many thanks

 Sean

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.




-- 

Gary Larizza
Professional Services Engineer
Puppet Labs

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Creating classes for individual nodes

2012-04-11 Thread Josh
This is more of a style question than implementation. I have a bunch of 
nodes running the same software but in many cases they need config files 
that are customized for that specific node. I was thinking I could push all 
the main files from the app through a central class and have separate 
classes for each individual node that has the config files. Is this the 
best way to do this or does it go against the purpose of using puppet?

Also, for implementation, is it best practice to create a separate module 
and class for each node where the class includes only that module? Thanks.

Josh

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/nfC30zTpr1oJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Facter not initialized in rspec in puppetlabs-stdlib?

2012-04-11 Thread Jeff McCune
On Wed, Apr 11, 2012 at 9:28 AM, Jeff McCune j...@puppetlabs.com wrote:
 Wil,

 I went ahead and re-worked the example specification.

 Please take a look at the commit message and the way I'm setting an
 expectation that mocks the behavior of lookupvar for both Mac OS X and
 Linux.

 https://github.com/jeffmccune/puppetlabs-stdlib/tree/feature/master/has_interface_with

Forgot to mention, the most recent commit in that branch is where I
re-worked the spec you asked about.

I've found it's better to link to branches instead of commits because
I often re-write history and commits are absolute references that
might go away inside of a branch whereas a branch is a relative
reference that can be updated frequently.

The actual commit I was referring to is:
https://github.com/jeffmccune/puppetlabs-stdlib/commit/dac3c508659bfc7d034509d3860afe5291aed722

Hope this helps,
-Jeff

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Creating classes for individual nodes

2012-04-11 Thread Dan White
My only objection is that mixes up the configuration data with the Puppet code, 
making things less modular/portable.

I have set up a collection of parameterized classes such that all the 
server-unique info is in /etc/puppet/manifests/nodes/ in various 
whatever-node.pp files.

I hope to transition to hiera to further separate the configuration data and 
Puppet code.

http://puppetlabs.com/blog/the-problem-with-separating-data-from-puppet-code/

“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin  Hobbes)

- Josh joshua.l.greenb...@gmail.com wrote:
 This is more of a style question than implementation. I have a bunch of 
 nodes running the same software but in many cases they need config files 
 that are customized for that specific node. I was thinking I could push all 
 the main files from the app through a central class and have separate 
 classes for each individual node that has the config files. Is this the 
 best way to do this or does it go against the purpose of using puppet?
 
 Also, for implementation, is it best practice to create a separate module 
 and class for each node where the class includes only that module? Thanks.
 
 Josh
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/puppet-users/-/nfC30zTpr1oJ.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.
 

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] FreeBSD Port

2012-04-11 Thread JA
Hi Daryl;

As requested.. and thanks for the help!!

1.)puppetdev10# vi /etc/puppet/puppet.conf

[main]
# The Puppet log directory.
# The default value is '$vardir/log'.
logdir = /var/log/puppet

# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet

# Where SSL certificates are kept.
# The default value is '$confdir/ssl'.
ssldir = $vardir/ssl

[agent]
# The file in which puppetd stores a list of the classes
# associated with the retrieved configuratiion.  Can be loaded in
# the separate ``puppet`` executable using the ``--loadclasses``
# option.
# The default value is '$confdir/classes.txt'.
classfile = $vardir/classes.txt

# Where puppetd caches the local configuration.  An
# extension indicating the cache format is added automatically.
# The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig
server=puppetdev
pluginsync = true


2.)puppetdev1# pkg_info | grep puppet
puppet-2.7.12   A configuration management framework written in Ruby

3.)FreeBSD 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC
2011 r...@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
amd64




On Wed, Apr 11, 2012 at 11:02 AM, Darryl Wisneski
dar...@prometheusresearch.com wrote:
 Jackie:

 Please post your 1.) puppet.conf, OS Relase, and version of puppet.

 2.) uname -a
 3.) pkg_info |grep puppet

 Can you check the ps output to make sure there wasn't already a
 running puppet.  Do you have any jails on the machine that may be
 running puppet as well and causing PID confusion?

 Thanks,
 -dkw

 On Wed, Apr 11, 2012 at 10:50:10AM -0400, Christopher Wood wrote:
 I couldn't say, perhaps different versions? Or run with more verbosity and 
 see what both versions are doing.

 Puppet 2.6.2 on Debian Stable (6.0.4):

 Enable the most common options used for testing. These are +onetime+, 
 +verbose+, +ignorecache, +no-daemonize+, and +no-usecacheonfailure+.

 Puppet 2.7.6 on FreeBSD (9.0-RELEASE):

 Enable the most common options used for testing. These are 'onetime', 
 'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure', 
 'detailed-exit-codes', 'no-splay', and 'show_diff'.

 I'm not sure it matters as long as you can get a onetime run. Dig into the 
 ruby code if it's really bothering you, of course.

 As to Darryl's comment in another branch, I haven't needed more than 
 no-daemonize, verbose, and debug to solve all my problems so far.

 On Wed, Apr 11, 2012 at 10:27:19AM -0400, JA wrote:
  Thanks so much!
 
  However, I am a bit stumped and would so appreciate any clarity you can 
  provide.
 
  If I execute 'puppet agent --test' on a RHEL box, it does not start
  the daemon.  But, if I do the same thing using the FreeBSD port, it
  does attempt to start the daemon.
 
  Obviously, I am missing something here...
 
  Thanks!
  Jackie
 
  On Wed, Apr 11, 2012 at 10:02 AM, Christopher Wood
  christopher_w...@pobox.com wrote:
   (I'm just starting with FreeBSD, albeit with some months of puppet 
   experience.)
  
   The puppet agent implies a daemon, but try something like this for a 
   single run in the foreground:
  
   puppet agent --no-daemonize --onetime
  
   On Wed, Apr 11, 2012 at 07:31:14AM -0400, JA wrote:
   I have installed puppet using the FreeBSD port. ?However, when I try
   to use the agent, it attempts to start the puppetd daemon. ?It seems
   that there is no way to use this installation without running the
   daemon. ?Can anyone shed any light on this?
  
   Thank you!
  
   --
   You received this message because you are subscribed to the Google 
   Groups Puppet Users group.
   To post to this group, send email to puppet-users@googlegroups.com.
   To unsubscribe from this group, send email to 
   puppet-users+unsubscr...@googlegroups.com.
   For more options, visit this group at 
   http://groups.google.com/group/puppet-users?hl=en.
  
  
  
   --
   You received this message because you are subscribed to the Google 
   Groups Puppet Users group.
   To post to this group, send email to puppet-users@googlegroups.com.
   To unsubscribe from this group, send email to 
   puppet-users+unsubscr...@googlegroups.com.
   For more options, visit this group at 
   http://groups.google.com/group/puppet-users?hl=en.
  
 
  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/puppet-users?hl=en.
 
 

 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more 

Re: [Puppet Users] FreeBSD Port

2012-04-11 Thread JA
I did verify that there are no other puppet processes running as well.
Thanks!

On Wed, Apr 11, 2012 at 11:02 AM, Darryl Wisneski
dar...@prometheusresearch.com wrote:
 Jackie:

 Please post your 1.) puppet.conf, OS Relase, and version of puppet.

 2.) uname -a
 3.) pkg_info |grep puppet

 Can you check the ps output to make sure there wasn't already a
 running puppet.  Do you have any jails on the machine that may be
 running puppet as well and causing PID confusion?

 Thanks,
 -dkw

 On Wed, Apr 11, 2012 at 10:50:10AM -0400, Christopher Wood wrote:
 I couldn't say, perhaps different versions? Or run with more verbosity and 
 see what both versions are doing.

 Puppet 2.6.2 on Debian Stable (6.0.4):

 Enable the most common options used for testing. These are +onetime+, 
 +verbose+, +ignorecache, +no-daemonize+, and +no-usecacheonfailure+.

 Puppet 2.7.6 on FreeBSD (9.0-RELEASE):

 Enable the most common options used for testing. These are 'onetime', 
 'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure', 
 'detailed-exit-codes', 'no-splay', and 'show_diff'.

 I'm not sure it matters as long as you can get a onetime run. Dig into the 
 ruby code if it's really bothering you, of course.

 As to Darryl's comment in another branch, I haven't needed more than 
 no-daemonize, verbose, and debug to solve all my problems so far.

 On Wed, Apr 11, 2012 at 10:27:19AM -0400, JA wrote:
  Thanks so much!
 
  However, I am a bit stumped and would so appreciate any clarity you can 
  provide.
 
  If I execute 'puppet agent --test' on a RHEL box, it does not start
  the daemon.  But, if I do the same thing using the FreeBSD port, it
  does attempt to start the daemon.
 
  Obviously, I am missing something here...
 
  Thanks!
  Jackie
 
  On Wed, Apr 11, 2012 at 10:02 AM, Christopher Wood
  christopher_w...@pobox.com wrote:
   (I'm just starting with FreeBSD, albeit with some months of puppet 
   experience.)
  
   The puppet agent implies a daemon, but try something like this for a 
   single run in the foreground:
  
   puppet agent --no-daemonize --onetime
  
   On Wed, Apr 11, 2012 at 07:31:14AM -0400, JA wrote:
   I have installed puppet using the FreeBSD port. ?However, when I try
   to use the agent, it attempts to start the puppetd daemon. ?It seems
   that there is no way to use this installation without running the
   daemon. ?Can anyone shed any light on this?
  
   Thank you!
  
   --
   You received this message because you are subscribed to the Google 
   Groups Puppet Users group.
   To post to this group, send email to puppet-users@googlegroups.com.
   To unsubscribe from this group, send email to 
   puppet-users+unsubscr...@googlegroups.com.
   For more options, visit this group at 
   http://groups.google.com/group/puppet-users?hl=en.
  
  
  
   --
   You received this message because you are subscribed to the Google 
   Groups Puppet Users group.
   To post to this group, send email to puppet-users@googlegroups.com.
   To unsubscribe from this group, send email to 
   puppet-users+unsubscr...@googlegroups.com.
   For more options, visit this group at 
   http://groups.google.com/group/puppet-users?hl=en.
  
 
  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at 
  http://groups.google.com/group/puppet-users?hl=en.
 
 

 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.


 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: FreeBSD Port

2012-04-11 Thread Jax01
Hey guys..

Thanks for the help!

I found my problem.  I was using pup[pet.conf in /etc/puppet instead
of /usr/local/etc/puppet. (FreeBSD)

Thanks and sorry for the interruption!
Jackie


On Apr 11, 3:11 pm, JA atkins.jac...@gmail.com wrote:
 I did verify that there are no other puppet processes running as well.
 Thanks!

 On Wed, Apr 11, 2012 at 11:02 AM, Darryl Wisneski







 dar...@prometheusresearch.com wrote:
  Jackie:

  Please post your 1.) puppet.conf, OS Relase, and version of puppet.

  2.) uname -a
  3.) pkg_info |grep puppet

  Can you check the ps output to make sure there wasn't already a
  running puppet.  Do you have any jails on the machine that may be
  running puppet as well and causing PID confusion?

  Thanks,
  -dkw

  On Wed, Apr 11, 2012 at 10:50:10AM -0400, Christopher Wood wrote:
  I couldn't say, perhaps different versions? Or run with more verbosity and 
  see what both versions are doing.

  Puppet 2.6.2 on Debian Stable (6.0.4):

  Enable the most common options used for testing. These are +onetime+, 
  +verbose+, +ignorecache, +no-daemonize+, and +no-usecacheonfailure+.

  Puppet 2.7.6 on FreeBSD (9.0-RELEASE):

  Enable the most common options used for testing. These are 'onetime', 
  'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure', 
  'detailed-exit-codes', 'no-splay', and 'show_diff'.

  I'm not sure it matters as long as you can get a onetime run. Dig into the 
  ruby code if it's really bothering you, of course.

  As to Darryl's comment in another branch, I haven't needed more than 
  no-daemonize, verbose, and debug to solve all my problems so far.

  On Wed, Apr 11, 2012 at 10:27:19AM -0400, JA wrote:
   Thanks so much!

   However, I am a bit stumped and would so appreciate any clarity you can 
   provide.

   If I execute 'puppet agent --test' on a RHEL box, it does not start
   the daemon.  But, if I do the same thing using the FreeBSD port, it
   does attempt to start the daemon.

   Obviously, I am missing something here...

   Thanks!
   Jackie

   On Wed, Apr 11, 2012 at 10:02 AM, Christopher Wood
   christopher_w...@pobox.com wrote:
(I'm just starting with FreeBSD, albeit with some months of puppet 
experience.)

The puppet agent implies a daemon, but try something like this for a 
single run in the foreground:

puppet agent --no-daemonize --onetime

On Wed, Apr 11, 2012 at 07:31:14AM -0400, JA wrote:
I have installed puppet using the FreeBSD port. ?However, when I try
to use the agent, it attempts to start the puppetd daemon. ?It seems
that there is no way to use this installation without running the
daemon. ?Can anyone shed any light on this?

Thank you!

--
You received this message because you are subscribed to the Google 
Groups Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group 
athttp://groups.google.com/group/puppet-users?hl=en.

--
You received this message because you are subscribed to the Google 
Groups Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group 
athttp://groups.google.com/group/puppet-users?hl=en.

   --
   You received this message because you are subscribed to the Google 
   Groups Puppet Users group.
   To post to this group, send email to puppet-users@googlegroups.com.
   To unsubscribe from this group, send email to 
   puppet-users+unsubscr...@googlegroups.com.
   For more options, visit this group 
   athttp://groups.google.com/group/puppet-users?hl=en.

  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/puppet-users?hl=en.

  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/puppet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Announce: Puppet 2.6.16 Available

2012-04-11 Thread Matthaus Litteken
Puppet 2.6.16 is a maintenance release in the 2.6.x branch. It
addresses and reverts a behavior change related to puppet's pidfile
that was introduced in Puppet 2.6.15.

This release is available for download at:
http://puppetlabs.com/downloads/puppet/puppet-2.6.16.tar.gz

RPM's are available at http://yum.puppetlabs.com/el or /fedora

Puppet is also available via Rubygems at http://rubygems.org

See the Verifying Puppet Download section at:
http://projects.puppetlabs.com/projects/puppet/wiki/Downloading_Puppet

Please report feedback via the Puppet Labs Redmine site, using an
affected puppet version of 2.6.16
http://projects.puppetlabs.com/projects/puppet/

2.6.16 Changelog

65446c9 Revert (#5246) Puppetd does not remove it's pidfile when it exits

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Creating classes for individual nodes

2012-04-11 Thread jcbollinger


On Apr 11, 12:04 pm, Josh joshua.l.greenb...@gmail.com wrote:
 This is more of a style question than implementation. I have a bunch of
 nodes running the same software but in many cases they need config files
 that are customized for that specific node. I was thinking I could push all
 the main files from the app through a central class and have separate
 classes for each individual node that has the config files. Is this the
 best way to do this or does it go against the purpose of using puppet?


There is no inherent problem with that approach, but for a little
extra effort you can get something that will be easier to maintain.
I'm not a big fan of parameterized classes myself, but I heartily
endorse an external data store, accessed via Hiera.  Instead of using
per-node classes, record per-node data where needed.  You can use that
data to fill templates, choose among alternatives in your manifests,
set resource properties, etc..


 Also, for implementation, is it best practice to create a separate module
 and class for each node where the class includes only that module? Thanks.


I would say not.  It might or might not make sense to put the per-node
classes in the module with the main classes for the application in
question, but I certainly see no reason to separate them from each
other.  But the question is moot if you choose a cleaner strategy.


John

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppetd locking up?

2012-04-11 Thread Jason Antman

Sorry I missed this thread until now.

Are you running with --listen? If so, try:
echo  | nc localhost 8139
and see if that helps.

https://projects.puppetlabs.com/issues/12185
is tracking an issue where puppetd, running with --listen, gets stuck in 
a socket read loop. Any data whatsoever sent to port 8139 will cause 
puppetd to continue where it left off (sometimes days ago).


I've mainly seen this on Cent6.2 personally. I've setup one of my test 
clients with a version of ruby patched for caller_for_all_threads and 
with the xray rubygem, and will try to get a thread dump next time it 
happens.


-Jason

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Condition based on environment

2012-04-11 Thread Will S. G.
Hi, 

I'm using one of the git projects for my Apache configuration. I'm now 
playing with Puppet environments, and I need to define a few parameters 
based on the environment. For example, I have params.pp: 

  $user = $operatingsystem ? {
/RedHat|CentOS/ = 'apache',
/Debian|Ubuntu/ = 'www-data',
  }

I'd like to be able to define the $user based on each environment. For 
example, apache is for production, and nobody is for dev. Is it possible to 
use a if/else statement to do this? If so, any examples I can use to 
understand how?

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/tkZcfooPC0wJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Facter not initialized in rspec in puppetlabs-stdlib?

2012-04-11 Thread Wil Cooley


On Wednesday, April 11, 2012 9:03:22 AM UTC-7, Jeff McCune wrote:

 On Tue, Apr 10, 2012 at 11:00 PM, Wil Cooley wilcoo...@gmail.com wrote:

 In general, you should assume the spec_helper for stdlib will
 initialize facter for you.  In fact, you don't need to do require
 'facter' in your example specification.

  You can see some of what I've been trying at
  
 https://github.com/wcooley/puppetlabs-stdlib/blob/master/spec/unit/puppet/parser/functions/has_interface_with_spec.rb

 Cool, I went ahead and pulled down your branch.  If I might make a
 suggestion, I notice you're developing on the master branch and you
 have a number of commits that have not actually been merged into the
 master branch of the puppetlabs repository.


Yeah, usually I do make branches; I think I mistakenly committed to master 
and then did not want to take the time to figure out how to move it on to a 
branch; your instructions below were very helpful. It would've taken me 
some hours between re-reading Pro Git and searching stackoverflow to figure 
it out on my own.
 

 The setup looks to be quite strange.  You shouldn't ever need to define a 
 get_scope method.  I recommend looking at the validate_re_spec.rb for a 
 good example.

It is strange; it's the result of an hour or two of thrashing about, 
throwing bits at the wall and trying to see if anything stuck. Toss in some 
frustrations with gem and getting a working rspec environment and it's a 
really bad dish.
 

 I'm also re-working your topic branch in my own if you'd like to take
 a look at the changes.

Thanks;  I think I was expecting to be able to get facts from the live 
system, which is obviously inferior to mocking the facts that should be 
expected. I've merged in your branch and looked at your reworked version; I 
think it makes sense and I see how to proceed with adding the rest of my 
tests.

Unfortunately, I am unable to run any of the rspec tests--not just in 
has_interface_with_spec.rb, but on any of the specs. They fail with:

 Failure/Error: Unable to find matching line from backtrace
 NoMethodError:
   undefined method `initialize_everything_for_tests' for 
#Puppet::Util::Settings:0x2b7d43d59940

I've got 2.7.13, RPMs built yesterday, both puppet and puppet-master 
installed:

$ rpm -qi puppet
Name: puppet   Relocations: (not relocatable)
Version : 2.7.13Vendor: (none)
Release : 1.el5 Build Date: Tue 10 Apr 2012 
01:52:57 PM PDT
Install Date: Wed 11 Apr 2012 09:46:53 PM PDT  Build Host: 
rpm-builder.puppetlabs.lan
...

ISTR seeing something about this method in the commit logs recently...

Also, go ahead and reply to puppet-dev if you wish; I'm trying to use the 
Google Groups interface and it does not appear to let me direct my response 
to a different group.

Wil

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/Y1_YL3HbfVgJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Condition based on environment

2012-04-11 Thread Tim Sharpe
$user = $::operatingsystem ? { 
  /RedHat|CentOS/ = $::environment ? {
'production' = 'apache',
'dev' = 'nobody',
  },
  /Debian|Ubuntu/ = 'www-data',
}


On Wednesday, 11 April 2012 at 5:25 PM, Will S. G. wrote:

 Hi, 
 
 I'm using one of the git projects for my Apache configuration. I'm now 
 playing with Puppet environments, and I need to define a few parameters based 
 on the environment. For example, I have params.pp: 
 
   $user = $operatingsystem ? {
 /RedHat|CentOS/ = 'apache',
 /Debian|Ubuntu/ = 'www-data',
   }
 
 I'd like to be able to define the $user based on each environment. For 
 example, apache is for production, and nobody is for dev. Is it possible to 
 use a if/else statement to do this? If so, any examples I can use to 
 understand how?
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/puppet-users/-/tkZcfooPC0wJ.
 To post to this group, send email to puppet-users@googlegroups.com 
 (mailto:puppet-users@googlegroups.com).
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com 
 (mailto:puppet-users+unsubscr...@googlegroups.com).
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.