[Puppet Users] Best practice for creating resources out of Hiera?

2014-04-27 Thread John Morton
I made a module called resource_factory:

https://forge.puppetlabs.com/jaydub/resource_factory

It has two parts. One is the resource_factory class, the other is the 
defined_resource_factory resource type. They both do the same kind of thing 
— wrap around create_resources with a hiera look up on some key. The 
difference is that the class creates defined_resource_factory instances by 
default, and those instances are where you put the resource types and hiera 
keys for the stuff you really want to create. Everything's configured in 
hiera without a lot of site specific classes.

Question is: have I just reinvented the wheel on some existing best 
practice, and if so, how are the grown ups creating resources out of Hiera?

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/db8705f9-960c-4dc0-bfaf-37e0950afda1%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-27 Thread Remi Ferrand
Hi everyone,

thanks all for your answers but i'm starting to think that there is way to
pass puppet undef value from a rspec test...
If anybody has the solution to fix this test suite (
https://github.com/riton/puppetrspec) please tell me; otherwise I'll have
to rewrite my manifests and replace the puppet undef value with a simple
undef string where it is possible...

It doesn't have the same meaning but it can help me moving on with my test
suite.

Thaks.

Rémi


On Tue, Apr 22, 2014 at 12:57 PM, Nan Liu nan@gmail.com wrote:

 On Tue, Apr 22, 2014 at 4:34 AM, Remi Ferrand 
 remi.mathieu.ferr...@gmail.com wrote:

 Hi Nan,

 thanks for your answer.
 With this modification:

 diff --git a/spec/classes/puppetrspec_spec.rb
 b/spec/classes/puppetrspec_spec.rb
 index 9d06d79..80fae58 100644
 --- a/spec/classes/puppetrspec_spec.rb
 +++ b/spec/classes/puppetrspec_spec.rb
 @@ -22,7 +22,7 @@ describe 'puppetrspec', :type = :class do
  context 'with ensure undef' do

  let :params do {
 -:ensure = '# WHAT SHOULD WE USE HERE TO PASS PUPPET
 undef VALUE ?#'
 +:ensure =  :undef
  } end

  it 'should have File with ensure absent' do


 it fails with this error:

 % rake spec
 /usr/bin/ruby -S rspec spec/classes/puppetrspec_spec.rb --color
 .F

 Failures:

   1) puppetrspec with ensure undef should have File with ensure absent
  Failure/Error: should contain_file(filename).with_ensure('absent')
  Puppet::Error:
Could not parse for environment production: Syntax error at ':';
 expected '}' at line 4 on node ...
  # ./spec/classes/puppetrspec_spec.rb:30

 Finished in 1.51 seconds
 2 examples, 1 failure

 Failed examples:

 rspec ./spec/classes/puppetrspec_spec.rb:29 # puppetrspec with ensure
 undef should have File with ensure absent


 Same error with this modification:

 diff --git a/spec/classes/puppetrspec_spec.rb
 b/spec/classes/puppetrspec_spec.rb
 index 9d06d79..63faa11 100644
 --- a/spec/classes/puppetrspec_spec.rb
 +++ b/spec/classes/puppetrspec_spec.rb
 @@ -21,9 +21,9 @@ describe 'puppetrspec', :type = :class do

  context 'with ensure undef' do

 -let :params do {
 -:ensure = '# WHAT SHOULD WE USE HERE TO PASS PUPPET
 undef VALUE ?#'
 -} end
 +let(:params) {{
 +:ensure =  :undef
 +}}


 If you have any other idea, let me know :-)


 So internally it appears to be :undef, and I thought that would work for
 rspec, but clearly not.

 https://github.com/puppetlabs/puppet/blob/master/spec/unit/parser/ast/leaf_spec.rb#L101

 Trying to set it to Puppet::Parser::AST::Undef resulted in the wrong
 behavior with if $var {...}. I may have mixed this up with a puppet
 function where I needed to return undef. I guess I shouldn't count on my
 memory at this hour of the day.

 Nan

 --
 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/CACqVBqBGogT4Fig6fsH5drRjyRPyJcTmnkxBYh2gSOYyfutaUg%40mail.gmail.comhttps://groups.google.com/d/msgid/puppet-users/CACqVBqBGogT4Fig6fsH5drRjyRPyJcTmnkxBYh2gSOYyfutaUg%40mail.gmail.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/CAMTZwM%2B%2BWXCWeijX%3DRJs%3DVoeRs7apQY4CypePLGp%2B1mJQZ9aoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] facter doesn't show ec2 facts on aws vpc

2014-04-27 Thread Felipe Salum
I searched around about this but couldn't find if puppetlabs is working in 
a fix or not.

facter running in AWS VPC doesn't show ec2 facts:

# facter --version
2.0.1
# facter -p virtual
xenhvm
# facter -p | grep ec2

Returns nothing.

Thanks,
Felipe

-- 
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/2f3b3613-1180-4f74-875b-317ed172194b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] facter doesn't show ec2 facts on aws vpc

2014-04-27 Thread Jeremy T. Bouse
FACT-185 is the ticket I've been following for this issue. I haven't 
upgraded my AWS instances that are EC2-VPC vs EC2-Classic. The classic 
works, but VPC has been failing due to the fact that the EC2 fact 
depends on a constant MAC address which is not the case in VPC 
instances.


On 27.04.2014 15:23, Felipe Salum wrote:

I searched around about this but couldn't find if puppetlabs is
working in a fix or not.

facter running in AWS VPC doesn't show ec2 facts:

# facter --version
2.0.1
# facter -p virtual
xenhvm
# facter -p | grep ec2

Returns nothing.

Thanks,
Felipe

 --
 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 [1].
 To view this discussion on the web visit

https://groups.google.com/d/msgid/puppet-users/2f3b3613-1180-4f74-875b-317ed172194b%40googlegroups.com
[2].
 For more options, visit https://groups.google.com/d/optout [3].


Links:
--
[1] mailto:puppet-users+unsubscr...@googlegroups.com
[2]

https://groups.google.com/d/msgid/puppet-users/2f3b3613-1180-4f74-875b-317ed172194b%40googlegroups.com?utm_medium=emailutm_source=footer
[3] 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/0a8522bbd185ac45c2bec4236c12587b%40undergrid.net.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Error 400 on Server: 0 is not a string. It looks to be a Fixnum on node example.test.net

2014-04-27 Thread Tony Zhao
This is the error I got running puppetlab's puppetdb module trying to setup 
puppetdb and postgresql. I was able to run it locally with puppet apply.

I am running puppet 3.5.1 on both master and agent with hiera. Master is 
running Apache+Passenger.

Has anyone encounter similar issue before and can provide some insights?

-- 
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/461d498b-22d6-4b39-bc44-1e4d94a1e75b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.