[Puppet Users] Re: rspec-puppet: how to pass undef as parameter value?

2014-04-18 Thread Remi Ferrand
I was also wondering how to do this, If anyone has the answer, I'll be glad 
to know it !

Thanks

Rémi

On Saturday, July 20, 2013 12:20:20 AM UTC+2, Andreas Haerter wrote:

 Hi all, 

 is there a way to pass the Puppets undef [1] value as parameter? I got a 
 module with a package_provider parameter, allowing the user two things: 
 1. specify a specific package provider to use; 2. pass undef to let 
 Puppet decide which provider to use instead of the module. 

 Something like: 

  class example( 
$package_provider = $example::params::package_provider, 
  ) inherits example::params { 
  
[...] 
  
package { 'foobar' 
  ensure   = 'present', 
  provider = $package_provider, 
} 
  } 


 Now I want to test if passing undef works: 

  context 'with parameter(s): package_provider = undef' do 
let(:params) {{ 
  :package_provider = [WAY-TO-PASS-UNDEF-HERE], 
}} 
  
it 'contains a package with parameter(s): provider = unset' do 
  should contain_package('blueprint').with({ 
'provider' = [WAY-TO-CHECK-FOR-UNDEF-HERE, 
  }) 
end 
  end 



 But my test doesn't work. What I tried so far is: 

 1) undef (results in RSpec/Ruby parsing error) 
  context 'with parameter(s): foo = undef' do 
let(:params) {{ 
  :foo = undef, 
}} 
  
[...] 
  end 

 2) :undef (results in Puppet error: Syntax error at':'; expected '}' ) 
  context 'with parameter(s): foo = undef' do 
let(:params) {{ 
  :foo = :undef, 
}} 
  
[...] 
  end 

 3) nil (does not result in an Puppet or Ruby error, but the 
 .with_foo(nil) or .without_foo matchers do not seem to work as the 
 string nil was passed tho puppet 
  context 'with parameter(s): foo = undef' do 
let(:params) {{ 
  :foo = nil, 
}} 
  
[...] 
  end 

 Any hints? Thanks in advance :-) 


 [1] 
 
 http://docs.puppetlabs.com/puppet/latest/reference/lang_datatypes.html#undef 


 -- 
 Andreas http://blog.andreas-haerter.com 



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


Re: [Puppet Users] Re: rspec-puppet: how to pass undef as parameter value?

2014-04-18 Thread Johan De Wit

it {
  should contain_package('foo').with ( {
'provider' = nil,
  })
}
On 18/04/14 12:37, Remi Ferrand wrote:
I was also wondering how to do this, If anyone has the answer, I'll be 
glad to know it !


Thanks

Rémi

On Saturday, July 20, 2013 12:20:20 AM UTC+2, Andreas Haerter wrote:

Hi all,

is there a way to pass the Puppets undef [1] value as parameter? I
got a
module with a package_provider parameter, allowing the user two
things:
1. specify a specific package provider to use; 2. pass undef to let
Puppet decide which provider to use instead of the module.

Something like:

 class example(
   $package_provider = $example::params::package_provider,
 ) inherits example::params {

   [...]

   package { 'foobar'
 ensure   = 'present',
 provider = $package_provider,
   }
 }


Now I want to test if passing undef works:

 context 'with parameter(s): package_provider = undef' do
   let(:params) {{
 :package_provider = [WAY-TO-PASS-UNDEF-HERE],
   }}

   it 'contains a package with parameter(s): provider = unset' do
 should contain_package('blueprint').with({
   'provider' = [WAY-TO-CHECK-FOR-UNDEF-HERE,
 })
   end
 end



But my test doesn't work. What I tried so far is:

1) undef (results in RSpec/Ruby parsing error)
 context 'with parameter(s): foo = undef' do
   let(:params) {{
 :foo = undef,
   }}

   [...]
 end

2) :undef (results in Puppet error: Syntax error at':'; expected
'}' )
 context 'with parameter(s): foo = undef' do
   let(:params) {{
 :foo = :undef,
   }}

   [...]
 end

3) nil (does not result in an Puppet or Ruby error, but the
.with_foo(nil) or .without_foo matchers do not seem to work as the
string nil was passed tho puppet
 context 'with parameter(s): foo = undef' do
   let(:params) {{
 :foo = nil,
   }}

   [...]
 end

Any hints? Thanks in advance :-)


[1]

http://docs.puppetlabs.com/puppet/latest/reference/lang_datatypes.html#undef

http://docs.puppetlabs.com/puppet/latest/reference/lang_datatypes.html#undef


-- 
Andreas http://blog.andreas-haerter.com

http://blog.andreas-haerter.com

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

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



--
Johan De Wit

Open Source Consultant

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

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



Next Events:
Linux Training | https://www.open-future.be/linux-training-5-till-9th-may
Puppet Introduction Course | 
https://www.open-future.be/puppet-introduction-course-12th-may
Puppet Fundamentals Training | 
https://www.open-future.be/puppet-fundamentals-training-13-till-15th-may
Zabbix Certified Specialist | 
https://www.open-future.be/zabbix-certified-specialist-training-19-till-21th-may
Zabbix Certified Professional | 
https://www.open-future.be/zabbix-certified-professional-training-22-till-23rd-may
Subscribe to our newsletter | http://eepurl.com/BUG8H

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


[Puppet Users] Puppet FreeBSD could not autoload provider

2014-04-18 Thread aminos
 

Hi everyone ,

I’m trying to install package via puppet with this basic node on a Freebsd 
9.1

My manifest nano.pp : 

Node default {

Package { nano:

   Name= “nano”,

   Ensure = installed,

   }

}

And when I do a puppet apply of this code I get the error:

Could not autoload puppet/provider/package/freebsd : undefined method 
‘intern’ for puppet ::util ::package :Module

Could not autoload puppet/provider/package/ports:  could not autoload 
puppet/provider/package/freebsd: undefined method ‘intern’ for 
puppet::util::package:module

Could not autoload puppet/type/package:  could not autoload 
puppet/provider/package/freebsd: : could not autoload 
puppet/provider/package/freebsd : undefined method ‘intern’ for 
puppet::util::package:module

Manual installation works and if I use an puppet exec type (command = 
“/usr/sbin/pkg_add –r nano”) it works too but it’s not optimized.

On the freebsd I have Puppet-3.0.1_1.

I tried 

 provider = freebsd  and provider =  pkg 

ensure = present

but I have the same error message

Furthermore my puppet.conf is empty because i'm only using a puppet apply 
in my local machine.

Did someone ever managed to install packages via puppet on a FreeBSD 
machine?

Thank you.


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


[Puppet Users] Upgrade to Puppet Entreprise 3.2.x and problems

2014-04-18 Thread fffrdfrd
Hi,

We have upgraded our Puppet Entreprise from 3.1.0 to 3.2.1 and then to 
3.2.2 (Our server is a RHEL 5.7).
The upgrade process went smoothly without any errors from 3.1.0 to 3.2.1 
and from 3.2.1 to 3.2.2.
We upgrade to 3.2.2 version because we were trying to solve thoses 
problems, but they are still present in 3.2.2:

   1. We can't login to dashboard anymore when using AD users, but it's ok 
   when using local users 
   2. Modules puppetlabs-pe_postgresql (1.0.3) and puppetlabs-pe_puppetdb 
   (1.0.2) are broken

For the first problem, we tried to reconfigure the console-auth and the 
rubycas-server without any success, everything seems to work, no error 
messages but an Invalid credentials at each login

For the second problem, a puppet agent -t give those errors:

Duplicate declaration: Class[Pe_puppetdb::Server] is already declared in 
file /opt/puppet/share/puppet/modules/pe_puppetdb/manifests/init.pp:172; 
cannot redeclare at 
/opt/puppet/share/puppet/modules/pe_puppetdb/manifests/pe.pp:108

We can work arround this one just to have this error :

Duplicate declaration: Class[Pe_puppetdb::Server] is already declared in 
file /opt/puppet/share/puppet/modules/pe_puppetdb/manifests/init.pp:172; 
cannot redeclare at 
/opt/puppet/share/puppet/modules/pe_puppetdb/manifests/pe.pp:108

We can work arround this one just to have this error :

Duplicate declaration: Class[Pe_postgresql::Server] is already declared in 
file 
/opt/puppet/share/puppet/modules/pe_puppetdb/manifests/database/postgresql.pp:70;
 
cannot redeclare at 
/opt/puppet/share/puppet/modules/pe_postgresql/manifests/pe.pp:37

And so on...

Appart from thoses problems, everything else work fine with 3.2.1 and 3.2.2.


Have you guys encounter the same problems?

Thanks


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


Re: [Puppet Users] Re: rspec-puppet: how to pass undef as parameter value?

2014-04-18 Thread Remi Ferrand
... I'm sorry but I don't understand your answer ...

I've created a very simple use case here at
https://github.com/riton/puppetrspec

My question was regarding file
https://github.com/riton/puppetrspec/blob/master/spec/classes/puppetrspec_spec.rb
.
With what value should I replace # WHAT SHOULD WE USE HERE TO PASS PUPPET
undef VALUE ?# with to make this unit test functional ?

Thanks in advance and sorry to ask you to answer again.

Cheers

Rémi


On Fri, Apr 18, 2014 at 1:39 PM, Johan De Wit jo...@open-future.be wrote:

  it {
   should contain_package('foo').with ( {
 'provider' = nil,
   })

 }
 On 18/04/14 12:37, Remi Ferrand wrote:

 I was also wondering how to do this, If anyone has the answer, I'll be
 glad to know it !

  Thanks

  Rémi

 On Saturday, July 20, 2013 12:20:20 AM UTC+2, Andreas Haerter wrote:

 Hi all,

 is there a way to pass the Puppets undef [1] value as parameter? I got a
 module with a package_provider parameter, allowing the user two things:
 1. specify a specific package provider to use; 2. pass undef to let
 Puppet decide which provider to use instead of the module.

 Something like:

  class example(
$package_provider = $example::params::package_provider,
  ) inherits example::params {
 
[...]
 
package { 'foobar'
  ensure   = 'present',
  provider = $package_provider,
}
  }


 Now I want to test if passing undef works:

  context 'with parameter(s): package_provider = undef' do
let(:params) {{
  :package_provider = [WAY-TO-PASS-UNDEF-HERE],
}}
 
it 'contains a package with parameter(s): provider = unset' do
  should contain_package('blueprint').with({
'provider' = [WAY-TO-CHECK-FOR-UNDEF-HERE,
  })
end
  end



 But my test doesn't work. What I tried so far is:

 1) undef (results in RSpec/Ruby parsing error)
  context 'with parameter(s): foo = undef' do
let(:params) {{
  :foo = undef,
}}
 
[...]
  end

 2) :undef (results in Puppet error: Syntax error at':'; expected '}' )
  context 'with parameter(s): foo = undef' do
let(:params) {{
  :foo = :undef,
}}
 
[...]
  end

 3) nil (does not result in an Puppet or Ruby error, but the
 .with_foo(nil) or .without_foo matchers do not seem to work as the
 string nil was passed tho puppet
  context 'with parameter(s): foo = undef' do
let(:params) {{
  :foo = nil,
}}
 
[...]
  end

 Any hints? Thanks in advance :-)


 [1]
 http://docs.puppetlabs.com/puppet/latest/reference/lang_
 datatypes.html#undef

 --
 Andreas http://blog.andreas-haerter.com

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

 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/2e2b712e-cf4a-46be-941b-3303efa5d551%40googlegroups.comhttps://groups.google.com/d/msgid/puppet-users/2e2b712e-cf4a-46be-941b-3303efa5d551%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.



 --
 Johan De Wit

 Open Source Consultant

 Red Hat Certified Engineer  (805008667232363)
 Puppet Certified Professional 2013/2014 (PCP006)
 _

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



 Upcoming Events:

 Linux Training | https://www.open-future.be/linux-training-5-till-9th-may

 Puppet Introduction Course |
 https://www.open-future.be/puppet-introduction-course-12th-may

 Puppet Fundamentals Training |
 https://www.open-future.be/puppet-fundamentals-training-13-till-15th-may

 Zabbix Certified Specialist |
 https://www.open-future.be/zabbix-certified-specialist-training-19-till-21th-may

 Zabbix Certified Professional |
 https://www.open-future.be/zabbix-certified-professional-training-22-till-23rd-may

 Subscribe to our newsletter: http://eepurl.com/BUG8H

  --
 You received this message because you are subscribed to a topic in the
 Google Groups Puppet Users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/puppet-users/6nL2eROH8is/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/53510EE8.5080401%40open-future.behttps://groups.google.com/d/msgid/puppet-users/53510EE8.5080401%40open-future.be?utm_medium=emailutm_source=footer
 .

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


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To 

[Puppet Users] Re: Type 0 is not supported error running puppet resource package with 3.4.3 agent on Server 2003

2014-04-18 Thread jcbollinger


On Thursday, April 17, 2014 6:32:41 PM UTC-5, Ron Bentley wrote:

 After right at a hundred successful agent installs on a very heterogeneous 
 mix of Server 2003 and Server 2008, I've encountered one machine that 
 doesn't want to cooperate.  The problem agent is the open source Puppet 
 3.4.3 MSI running on Server 2003.

 I run puppet resource package and I get Error: Could not run: Type 0 is 
 not supported.  I add --debug --trace --verbose and the first entry 
 after the error is C:/Program Files/Puppet 
 Labs/Puppet/sys/ruby/lib/ruby/1.9.1/win32/registry.rb:605:in 'read'.  
 Invoking puppet resource service works just fine.

 This is the same MSI I've used on the hundred other machines.  I ran the 
 md5 sum just to make sure it wasn't corrupted in transfer.  I uninstalled 
 and reinstalled.  Same behavior.  (The agent is configured to communicate 
 with a master, and that's where I first encountered the problem.  I thought 
 maybe reproducing the problem this way would take master interactions and 
 catalog issues out of the equation.)

 The machine itself is remote and I'm limited on what I can do to it.  
 Anything else I ought to try?



As a wild guess, perhaps you have a bit of registry corruption, such as 
maybe an invalid value type for some key.  If you have a registry cleaner 
or tester that you like and trust, then perhaps it would be worthwhile to 
run that against the problem machine.


John

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


[Puppet Users] Re: How to use facter variable in node definition?

2014-04-18 Thread Pawel Kilian
thank you, I will try that

On Thursday, April 17, 2014 2:41:41 PM UTC-4, Pawel Kilian wrote:

 Hi,
 I want to use facter scope variable to use in my manifest files for puppet

 for now i have something like this:

 node 'web-server' {
 ..
 ..
 }


 I want to be able to use if/case  definition to define nodes


 root@ip-10-187-40-216:~# facter -p system_role
 app-server
 root@ip-10-187-40-216:~#

 so in my manifest node definition i would like to use something like:

 node if $::system_role == app-server {
 ..
 ...
 include default;
 }


 or something similar to it.
 I want to use facter variables because i want to use with ec2tags for each 
 server and build each server based on ec2 tag

 How I can approach this?

 thanks


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/71383e85-10cd-4a51-8d13-0667d17fe918%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to use facter variable in node definition?

2014-04-18 Thread jcbollinger


On Thursday, April 17, 2014 1:55:20 PM UTC-5, Jose Luis Ledesma wrote:

 Remove the node word and you have it

 if $::system_role == app-server {

 ..

 ...

 include default;

 }


Do note, however, that is a top-level declaration, not a node definition.  
That's perfectly fine for most purposes, but there are a few corner cases 
where it could be an issue.

More generally, node definitions classify nodes based on their *identity*, 
in the form of their $clientcert.  Nothing else provided by the client 
factors in to associating client nodes with node definitions.  That's not 
really very limiting however, for even if you want or need node definitions 
(so that Jose's suggestion isn't applicable), you can put your conditional 
logic inside a general node declaration or into a class, or, even better, 
you can use hiera to assign data and classes to your nodes based on the 
values of their facts.


John

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


Re: [Puppet Users] Re: Different modes for directory, contents?

2014-04-18 Thread jcbollinger


On Thursday, April 17, 2014 9:33:11 AM UTC-5, Bret Wortman wrote:

 Doesn't this also make the directory itself 644 instead of 755? Maybe I 
 need to play around with it a bit more.



No, it doesn't.  I repeat: Puppet will add add search permission to 
directories wherever there is read permission.  My previous response 
contained a link to the relevant documentation.


John

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


Re: [Puppet Users] Re: Different modes for directory, contents?

2014-04-18 Thread Bret Wortman
Yep, I saw it this time. I was scanning too quickly the last few times I
read that page. Sorry, John. I saw and followed the link, but missed the
relevant bit of doco.

Thanks again!



*Bret Wortman*
http://about.me/wortmanbret



On Fri, Apr 18, 2014 at 9:39 AM, jcbollinger john.bollin...@stjude.orgwrote:



 On Thursday, April 17, 2014 9:33:11 AM UTC-5, Bret Wortman wrote:

 Doesn't this also make the directory itself 644 instead of 755? Maybe I
 need to play around with it a bit more.



 No, it doesn't.  I repeat: Puppet will add add search permission to
 directories wherever there is read permission.  My previous response
 contained a link to the relevant documentation.


 John

  --
 You received this message because you are subscribed to a topic in the
 Google Groups Puppet Users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/puppet-users/YvyV72vReyc/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/8229c707-e0da-4908-9668-88dd388d39d0%40googlegroups.comhttps://groups.google.com/d/msgid/puppet-users/8229c707-e0da-4908-9668-88dd388d39d0%40googlegroups.com?utm_medium=emailutm_source=footer
 .

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


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


Re: [Puppet Users] Re: rspec-puppet: how to pass undef as parameter value?

2014-04-18 Thread Johan De Wit


oops, sorry about that.

An undef value in a manifest/class is mapped to 'nil' in the catalog.

But I would not allow to have an undef value for the ensure class 
parameter.   But that's another discussion.


I will have a look at the code later on.











On 18/04/14 15:16, Remi Ferrand wrote:

... I'm sorry but I don't understand your answer ...

I've created a very simple use case here at 
https://github.com/riton/puppetrspec


My question was regarding file 
https://github.com/riton/puppetrspec/blob/master/spec/classes/puppetrspec_spec.rb.
With what value should I replace # WHAT SHOULD WE USE HERE TO PASS 
PUPPET undef VALUE ?# with to make this unit test functional ?


Thanks in advance and sorry to ask you to answer again.

Cheers

Rémi


On Fri, Apr 18, 2014 at 1:39 PM, Johan De Wit jo...@open-future.be 
mailto:jo...@open-future.be wrote:


it {
  should contain_package('foo').with ( {
'provider' = nil,
  })

}
On 18/04/14 12:37, Remi Ferrand wrote:

I was also wondering how to do this, If anyone has the answer,
I'll be glad to know it !

Thanks

Rémi

On Saturday, July 20, 2013 12:20:20 AM UTC+2, Andreas Haerter wrote:

Hi all,

is there a way to pass the Puppets undef [1] value as
parameter? I got a
module with a package_provider parameter, allowing the user
two things:
1. specify a specific package provider to use; 2. pass
undef to let
Puppet decide which provider to use instead of the module.

Something like:

 class example(
   $package_provider = $example::params::package_provider,
 ) inherits example::params {

   [...]

   package { 'foobar'
 ensure   = 'present',
 provider = $package_provider,
   }
 }


Now I want to test if passing undef works:

 context 'with parameter(s): package_provider = undef' do
   let(:params) {{
 :package_provider = [WAY-TO-PASS-UNDEF-HERE],
   }}

   it 'contains a package with parameter(s): provider =
unset' do
 should contain_package('blueprint').with({
   'provider' = [WAY-TO-CHECK-FOR-UNDEF-HERE,
 })
   end
 end



But my test doesn't work. What I tried so far is:

1) undef (results in RSpec/Ruby parsing error)
 context 'with parameter(s): foo = undef' do
   let(:params) {{
 :foo = undef,
   }}

   [...]
 end

2) :undef (results in Puppet error: Syntax error at':';
expected '}' )
 context 'with parameter(s): foo = undef' do
   let(:params) {{
 :foo = :undef,
   }}

   [...]
 end

3) nil (does not result in an Puppet or Ruby error, but the
.with_foo(nil) or .without_foo matchers do not seem to work
as the
string nil was passed tho puppet
 context 'with parameter(s): foo = undef' do
   let(:params) {{
 :foo = nil,
   }}

   [...]
 end

Any hints? Thanks in advance :-)


[1]

http://docs.puppetlabs.com/puppet/latest/reference/lang_datatypes.html#undef


-- 
Andreas http://blog.andreas-haerter.com


-- 
You received this message because you are subscribed to the

Google Groups Puppet Users group.
To unsubscribe from this group and stop receiving emails from it,
send an email to puppet-users+unsubscr...@googlegroups.com
mailto:puppet-users+unsubscr...@googlegroups.com.

To view this discussion on the web visit

https://groups.google.com/d/msgid/puppet-users/2e2b712e-cf4a-46be-941b-3303efa5d551%40googlegroups.com

https://groups.google.com/d/msgid/puppet-users/2e2b712e-cf4a-46be-941b-3303efa5d551%40googlegroups.com?utm_medium=emailutm_source=footer.
For more options, visit https://groups.google.com/d/optout.



-- 
Johan De Wit


Open Source Consultant

Red Hat Certified Engineer  (805008667232363)
Puppet Certified Professional 2013/2014 (PCP006)
_
  
Open-Future Phone+32 (0)2/255 70 70  tel:%2B32%20%280%292%2F255%2070%2070

Zavelstraat 72  Fax+32 (0)2/255 70 71  
tel:%2B32%20%280%292%2F255%2070%2071
3071 KORTENBERG Mobile+32 (0)474/42 40 73  
tel:%2B32%20%280%29474%2F42%2040%2073
BELGIUMhttp://www.open-future.be
_
  



Upcoming Events:

Linux Training |
https://www.open-future.be/linux-training-5-till-9th-may

Puppet Introduction Course |
https://www.open-future.be/puppet-introduction-course-12th-may

Puppet Fundamentals Training |

[Puppet Users] Re: Type 0 is not supported error running puppet resource package with 3.4.3 agent on Server 2003

2014-04-18 Thread Ron Bentley


 As a wild guess, perhaps you have a bit of registry corruption, such as 
 maybe an invalid value type for some key.  If you have a registry cleaner 
 or tester that you like and trust, then perhaps it would be worthwhile to 
 run that against the problem machine.


Of course.  Now that you say it, that makes perfect sense.  

I'll have to coordinate my trouble-shooting with the owner of the machine; 
so, I may not be able to report on the outcome any time soon.  But thank 
you very much.  That gives me a direction to pursue.

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


[Puppet Users] Resource Defaults not working in 3.5.1 ?

2014-04-18 Thread Atom Powers
Since updating to 3.5.1 resource defaults don't seem to work any more.  I
didn't see anything in the release notes that look
relevant.

With code very similar to what you see below, the defined resource
module::type gets the module default value for location, not the one I
set as the default for that resource. This worked in 3.4.

---
define profile::wrapper (
$location = /directory,
$value = 1,
) {
Module::Type  {
  location = $location
}

module::type { 'name':
  setting = $value
}

}
---

-- 
Perfection is just a word I use occasionally with mustard.
--Atom Powers--

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


[Puppet Users] install MSI package as standard user

2014-04-18 Thread essomba83
Hi folks,

I would like to know if it's possible to install an MSI package as standard 
user and not Administrator ? 

Thanks,

Laurent

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


[Puppet Users] Re: Resource Defaults not working in 3.5.1 ?

2014-04-18 Thread Andy Parker
On Friday, April 18, 2014 8:42:28 AM UTC-7, Atom Powers wrote:

 Since updating to 3.5.1 resource defaults don't seem to work any more.  I 
 didn't see anything in the release notes that look
 relevant.


It looks like it is a bug in the new evaluator that is part of the 
experimental future parser in 3.5.
 

 With code very similar to what you see below, the defined resource
 module::type gets the module default value for location, not the one I
 set as the default for that resource. This worked in 3.4.


I've tried it out and it seems like resource defaults for defined types 
aren't working correctly in the new evaluator. I've filed this as PUP-2302 
(https://tickets.puppetlabs.com/browse/PUP-2302).
Thanks for letting us know!

A work around, for now, would be to turn on the current evaluator. You can 
do this by setting evaluator to current.
 

 ---
 define profile::wrapper (
 $location = /directory,
 $value = 1,
 ) {
 Module::Type  {
   location = $location
 }

 module::type { 'name':
   setting = $value
 }

 }
 ---

 -- 
 Perfection is just a word I use occasionally with mustard.
 --Atom Powers-- 


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


Re: [Puppet Users] Re: Resource Defaults not working in 3.5.1 ?

2014-04-18 Thread Atom Powers
Thank you Andy.
Turning off the future parser also fixed the problem.


On Fri, Apr 18, 2014 at 10:00 AM, Andy Parker a...@puppetlabs.com wrote:

 On Friday, April 18, 2014 8:42:28 AM UTC-7, Atom Powers wrote:

 Since updating to 3.5.1 resource defaults don't seem to work any more.  I
 didn't see anything in the release notes that look
 relevant.


 It looks like it is a bug in the new evaluator that is part of the
 experimental future parser in 3.5.


 With code very similar to what you see below, the defined resource
 module::type gets the module default value for location, not the one I
 set as the default for that resource. This worked in 3.4.


 I've tried it out and it seems like resource defaults for defined types
 aren't working correctly in the new evaluator. I've filed this as PUP-2302 (
 https://tickets.puppetlabs.com/browse/PUP-2302).
 Thanks for letting us know!

 A work around, for now, would be to turn on the current evaluator. You can
 do this by setting evaluator to current.


 ---
 define profile::wrapper (
 $location = /directory,
 $value = 1,
 ) {
 Module::Type  {
   location = $location
 }

 module::type { 'name':
   setting = $value
 }

 }
 ---

 --
 Perfection is just a word I use occasionally with mustard.
 --Atom Powers--

  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/445dd1a5-0c89-4dfc-b040-8c19701d12df%40googlegroups.comhttps://groups.google.com/d/msgid/puppet-users/445dd1a5-0c89-4dfc-b040-8c19701d12df%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.




-- 
Perfection is just a word I use occasionally with mustard.
--Atom Powers--

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


[Puppet Users] puppetlabs/ntp failing to find operatingsystem fact...

2014-04-18 Thread Dennis Kirkpatrick
I have run into a problem in using the puppetlabs/ntp module that I was not 
expecting. In calling on puppetlabs-ntp::init in my rspec tests, I am 
getting a failure of ntp::params to find the correct fact for 
operationingsystem, which happens to be RedHat. I've even issued a test to 
see if I could manually set the operatingsystem fact, but alas.

Here is my client_ntp_spec.rb--

require 'spec_helper'

describe ntp do
  let(:facts) { { :operatingsystem = RedHat } }
  it { should contain_notify(operatingsystem).with_message(RedHat) }
end

describe 'client_ntp', :type = :class do
  describe 'client_ntp' do
it { should create_class('client_ntp') }
it { should contain_class('client_ntp::params') }
  end
end

Here are my test results--

$ rake spec
HEAD is now at 564ec4f Merge branch '3.0.x'
HEAD is now at 6a5dee2 Merge pull request #239 from 
kylog/maint/remove-facter-versions-test
/usr/bin/ruby -S rspec spec/classes/client_ntp_spec.rb --color
FFF

Failures:

  1) ntp
 Failure/Error: it { should 
contain_notify(operatingsystem).with_message(RedHat) }
 Puppet::Error:
   The ntp module is not supported on an  based system. at 
/home/user/code/client-appaccelerator/modules/client_ntp/spec/fixtures/modules/ntp/manifests/params.pp:183
 
on node denqca3utdev01.client.org
 # ./spec/classes/client_spec.rb:6

  2) client_ntp client_ntp
 Failure/Error: it { should create_class('client_ntp') }
 Puppet::Error:
   The ntp module is not supported on an  based system. at 
/home/user/code/client-appaccelerator/modules/client_ntp/spec/fixtures/modules/ntp/manifests/params.pp:183
 
on node denqca3utdev01.client.org
 # ./spec/classes/client_ntp_spec.rb:12

  3) client_ntp client_ntp
 Failure/Error: it { should contain_class('client_ntp::params') }
 Puppet::Error:
   The ntp module is not supported on an  based system. at 
/home/user/code/client-appaccelerator/modules/client_ntp/spec/fixtures/modules/ntp/manifests/params.pp:183
 
on node denqca3utdev01.client.org
 # ./spec/classes/client_ntp_spec.rb:13

Finished in 0.46827 seconds
3 examples, 3 failures

Failed examples:

rspec ./spec/classes/client_ntp_spec.rb:6 # ntp
/usr/bin/ruby -S rspec spec/classes/client_ntp_spec.rb --color failed

Based on the error message, I traced the output straight to the 
puppetlabs/ntp::params class, line 183 here--

default: {
  fail(The ${module_name} module is not supported on an ${::osfamily} 
based system.)
}

It seems that the puppetlabs/ntp module is getting a null value for the 
operatingsystem fact.

I can manually test for the fact at the command line--

$ facter operatingsystem
RedHat

This is RedHat 6.4--

$ lsb_release -a
LSB Version:
:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description:Red Hat Enterprise Linux Server release 6.4 (Santiago)
Release:6.4
Codename:   Santiago

I'm feeling stumped. Any clues?

Thanks.



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


[Puppet Users] Re: fail on first error. don't continue doing stuff

2014-04-18 Thread Alexander Gray II
Thanks guys for looking into this.
I never got to the root cause of this, but the failure was with Augeas 
trying to set some value in an xml file.
I tried all levels of debug and verbosity and manually trying to see why 
Augeas would fail, even manually running Augeas on the file would pass.
I wanted puppet to stop immediately on error so that I could manually go 
through Augeas and sniff around, but since puppet does a million-and-one 
things after the error, and it's unreproducible after puppet runs.
To make a long story short, it looks like there is no way to halt puppet on 
error, and I could not figure out what was causing Augeas to fail, so i 
just worked around Augeas by not even using it.

Thanks,
Alex

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


[Puppet Users] yum install puppet vs gem install puppet on CentOS with Ruby 2.0. Gem works, not yum.

2014-04-18 Thread Alexander Gray II
Hey guys,

We have ruby 2.0.0 installed on a CentOS box.

I installed puppet via yum install puppet:

[root@ip-10-165-39-216 ec2-user]# yum list installed | grep puppet
puppet.noarch 3.5.1-1.el6  
@puppetlabs-products
But I get this error if I try to run puppet:

[ec2-user@ip-10-165-39-216 ~]$ puppet --version
/usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in 
`require': cannot load such file -- puppet/util/command_line (LoadError)
from 
/usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in 
`require'
from /usr/bin/puppet:3:in `main'

So for giggles, I did a gem install puppet:

And puppet works:

[root@ip-10-165-39-216 ec2-user]# puppet --version
3.5.1

Why does gem install puppet work, but not yum install puppet?


Thanks!

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


Re: [Puppet Users] yum install puppet vs gem install puppet on CentOS with Ruby 2.0. Gem works, not yum.

2014-04-18 Thread Kenton Brede
Puppet from the repo uses ruby 1.8.  Your ec2 instance is using ruby 2.0.

If you want to change which ruby version you're using on your ec2 servers,
you can run:

alternatives --config ruby

If ruby 1.8 isn't installed on your system, you'll need to install it
before you run the alternatives command. I probably didn't have to
mention that though. :)

Kent


On Fri, Apr 18, 2014 at 2:13 PM, Alexander Gray II gray...@gmail.comwrote:

 Hey guys,

 We have ruby 2.0.0 installed on a CentOS box.

 I installed puppet via yum install puppet:

 [root@ip-10-165-39-216 ec2-user]# yum list installed | grep puppet
 puppet.noarch 3.5.1-1.el6
 @puppetlabs-products
 But I get this error if I try to run puppet:

 [ec2-user@ip-10-165-39-216 ~]$ puppet --version
 /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in
 `require': cannot load such file -- puppet/util/command_line (LoadError)
 from
 /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in
 `require'
 from /usr/bin/puppet:3:in `main'

 So for giggles, I did a gem install puppet:

 And puppet works:

 [root@ip-10-165-39-216 ec2-user]# puppet --version
 3.5.1

 Why does gem install puppet work, but not yum install puppet?


 Thanks!

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/25d94a4e-4f6c-4a0d-9ea2-d868c6f1466f%40googlegroups.comhttps://groups.google.com/d/msgid/puppet-users/25d94a4e-4f6c-4a0d-9ea2-d868c6f1466f%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.




-- 
Kent Brede

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


Re: [Puppet Users] Puppet FreeBSD could not autoload provider

2014-04-18 Thread R. Tyler Croy


On 04/18/2014 01:40, aminos wrote:


I’m trying to install package via puppet with this basic node on a 
Freebsd 9.1


My manifest nano.pp :

Node default {

Package { nano:

Name= “nano”,

Ensure = installed,

}

}

And when I do a puppet apply of this code I get the error:

Could not autoload puppet/provider/package/freebsd : undefined method 
‘intern’ for puppet ::util ::package :Module


Could not autoload puppet/provider/package/ports:  could not autoload 
puppet/provider/package/freebsd: undefined method ‘intern’ for 
puppet::util::package:module


Could not autoload puppet/type/package:  could not autoload 
puppet/provider/package/freebsd: : could not autoload 
puppet/provider/package/freebsd : undefined method ‘intern’ for 
puppet::util::package:module


Manual installation works and if I use an puppet exec type (command = 
“/usr/sbin/pkg_add –r nano”) it works too but it’s not optimized.




Did you install Puppet from FreeBSD ports or did you build and install 
it yourself?


I manage packages with Puppet quite often, but using 10.0-RELEASE and 
-CURRENT with the puppet-pkgng provider (available from Forge)



I've cc'd the puppet-bsd group just in case anybody there has seen it

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


Re: [Puppet Users] puppetlabs/ntp failing to find operatingsystem fact...

2014-04-18 Thread R. Tyler Croy


On 04/18/2014 10:24, Dennis Kirkpatrick wrote:
I have run into a problem in using the puppetlabs/ntp module that I 
was not expecting. In calling on puppetlabs-ntp::init in my rspec 
tests, I am getting a failure of ntp::params to find the correct fact 
for operationingsystem, which happens to be RedHat. I've even issued a 
test to see if I could manually set the operatingsystem fact, but alas.


Here is my client_ntp_spec.rb--

require 'spec_helper'

describe ntp do
let(:facts) { { :operatingsystem = RedHat } }
  it { should contain_notify(operatingsystem).with_message(RedHat) }
end

describe 'client_ntp', :type = :class do
  describe 'client_ntp' do
it { should create_class('client_ntp') }
it { should contain_class('client_ntp::params') }
  end
end




Does the RSpec tag :type = :class do anything special to override 
facts? The `ntp` module depends on `stdlib` and the fact that it is 
not loaded might be what is causing you trouble, I use this: 
https://github.com/jenkinsci/puppet-jenkins/blob/master/spec/spec_helper.rb#L26 
to ensure that the per-spec compiled catalog has the `stdlib` class 
compiled in.


This also requires that stdlib is in spec/fixtures.




Here are my test results--

$ rake spec
HEAD is now at 564ec4f Merge branch '3.0.x'
HEAD is now at 6a5dee2 Merge pull request #239 from 
kylog/maint/remove-facter-versions-test

/usr/bin/ruby -S rspec spec/classes/client_ntp_spec.rb --color
FFF

Failures:

  1) ntp
 Failure/Error: it { should 
contain_notify(operatingsystem).with_message(RedHat) }

 Puppet::Error:
   The ntp module is not supported on an  based system. at 
/home/user/code/client-appaccelerator/modules/client_ntp/spec/fixtures/modules/ntp/manifests/params.pp:183 
on node denqca3utdev01.client.org

 # ./spec/classes/client_spec.rb:6

  2) client_ntp client_ntp
 Failure/Error: it { should create_class('client_ntp') }
 Puppet::Error:
   The ntp module is not supported on an  based system. at 
/home/user/code/client-appaccelerator/modules/client_ntp/spec/fixtures/modules/ntp/manifests/params.pp:183 
on node denqca3utdev01.client.org

 # ./spec/classes/client_ntp_spec.rb:12

  3) client_ntp client_ntp
 Failure/Error: it { should contain_class('client_ntp::params') }
 Puppet::Error:
   The ntp module is not supported on an  based system. at 
/home/user/code/client-appaccelerator/modules/client_ntp/spec/fixtures/modules/ntp/manifests/params.pp:183 
on node denqca3utdev01.client.org

 # ./spec/classes/client_ntp_spec.rb:13

Finished in 0.46827 seconds
3 examples, 3 failures

Failed examples:

rspec ./spec/classes/client_ntp_spec.rb:6 # ntp
/usr/bin/ruby -S rspec spec/classes/client_ntp_spec.rb --color failed

Based on the error message, I traced the output straight to the 
puppetlabs/ntp::params class, line 183 here--


default: {
  fail(The ${module_name} module is not supported on an 
${::osfamily} based system.)

}

It seems that the puppetlabs/ntp module is getting a null value for 
the operatingsystem fact.


I can manually test for the fact at the command line--

$ facter operatingsystem
RedHat

This is RedHat 6.4--

$ lsb_release -a
LSB Version: 
:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch

Distributor ID: RedHatEnterpriseServer
Description:Red Hat Enterprise Linux Server release 6.4 (Santiago)
Release:6.4
Codename:   Santiago

I'm feeling stumped. Any clues?

Thanks.



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

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


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


[Puppet Users] detect python|ruby|foo-package installed

2014-04-18 Thread Alexander Gray II
Is there a way in puppet to detect what version of python or ruby, or for 
that matter, any package which is installed?

For instance:
if python_version  x:
do something
else
do something else

It looks liek versioncmp is what I want, but I don't know how to get the 
version.
Maybe do some sort of exec that gets this version?

Sorry if this a newb question,
Thanks

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