Re: [Puppet Users] Re: Puppet 3.0.0 and Hiera

2012-10-21 Thread Jakov Sosic

On 10/16/2012 04:34 PM, jcbollinger wrote:

Here's one solution: keep parametrized classes themselves, but deprecate
and eventually remove the parametrized-class declaration syntax.  That
would leave class parameters as formalized declarations of external data
used by classes, while removing the possibility of inconsistent class
declarations.  It would also pull back from the confusing effort to make
classes appear to be resources when in fact they are not (for example,
create_resources() won't "create" classes).


I really like this solution.

Great post jcbollinger - as always. Really enjoy reading your opinions 
and solutions.




--
Jakov Sosic
www.srce.unizg.hr

--
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] Glassfish custom provider and 'file does not exist'

2012-10-21 Thread fatmcgav
Josh

Cheers for the info.
Are there any references on how to set the path when executing child
processes?

Cheers
Gavin
On Oct 19, 2012 6:03 PM, "Josh Cooper"  wrote:

> Hi Gavin,
>
> On Fri, Oct 19, 2012 at 9:35 AM, Gavin Williams 
> wrote:
> > Ok, I've found what was causing the provider to fail...
> >
> > Changed as follows:
> >
> > diff --git a/lib/puppet/provider/domain/asadmin.rb
> > b/lib/puppet/provider/domain/asadmin.rb
> > index 940c051..384f6ab 100644
> > --- a/lib/puppet/provider/domain/asadmin.rb
> > +++ b/lib/puppet/provider/domain/asadmin.rb
> > @@ -2,7 +2,7 @@
> >  Puppet::Type.type(:domain).provide(:asadmin,
> > :parent =>
> Puppet::Provider::Asadmin) do
> >desc "Glassfish support."
> > -  commands :asadmin => "asadmin"
> > +  commands :asadmin => "/usr/local/glassfish-3.1.2/bin/asadmin"
> >
> >def create
> >  args = []
> >
> > Any ideas how I can make commands use a variable?
> >
> > Cheers
> > Gavin
> >
> > On Monday, 15 October 2012 11:40:16 UTC+1, Gavin Williams wrote:
> >>
> >> Just got back from holiday, and need to get this one going...
> >>
> >> Any ideas on how I can proceed?
> >>
> >> Cheers
> >> Gavin
> >>
> >> On 29 September 2012 08:21, fatmcgav  wrote:
> >>>
> >>> Stefan
> >>>
> >>> Yes, the code is all in github.
> >>> https://github.com/fatmcgav/puppet-glassfish
> >>>
> >>> Cheers
> >>> Gav
> >>>
> >>> On Sep 29, 2012 1:28 AM, "Stefan Schulte"
> >>>  wrote:
> 
>  On Fri, Sep 28, 2012 at 10:39:11AM +0100, fatmcgav wrote:
>  > Ok, so I thought I'd take another look, and try and get some debug
>  > logging
>  > out of the provider to make sure it's constructing things
> correctly...
>  >
>  > I've applied the following patch to asadmin.rb, however I'm not
> seeing
>  > anything on the client trace...
>  >
>  > diff --git a/lib/puppet/provider/asadmin.rb
>  > b/lib/puppet/provider/asadmin.rb
>  > > index f95d6ab..c8bd4a7 100644
>  > > --- a/lib/puppet/provider/asadmin.rb
>  > > +++ b/lib/puppet/provider/asadmin.rb
>  > > @@ -8,6 +8,7 @@
>  > >  passed_args.each { |arg| args << arg }
>  > >  exec_args = args.join " "
>  > >  command = "#{@resource[:asadminpath]} #{exec_args}"
>  > > +Puppet.debug("Command = #{command}")
>  > >  command = "su - #{@resource[:user]} -c \"#{command}\"" if
>  > > @resource[:user] and
>  > >not command.match /create-service/
>  > >  self.debug command
>  > >
>  >
>  > Any ideas how I can get the provider logging???
>  >
>  > Cheers
>  > Gavin
>  >
> 
>  do you have the code somewhere? If you dropped the debug call in the
>  create method or something it will never be executed if puppet thinks
>  the provider is not valid at all.
> 
>  So having the actual provider code may make is more obvious why it is
>  failing for you.
> 
>  -Stefan
> 
>  --
>  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/-/hGGzpUwCUxsJ.
> >
> > 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 uses its `path` setting to resolve unqualified executables in
> commands[1]. You can specify this on a per-agent basis, or you can
> provide an environment or I've recently filed a ticket to add a
> per-resource path metaparameter[2]. If you're writing your own
> provider, you can also specify an environment that puppet will use to
> execute the child process.
>
> Josh
>
> [1] http://docs.puppetlabs.com/references/latest/configuration.html#path
> [2] http://projects.puppetlabs.com/issues/16997
> --
> Josh Cooper
> Developer, 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.
>
>

-- 
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

[Puppet Users] need a hand to troubleshoot this small setup

2012-10-21 Thread Omarinas
Hi all,
Im provisioning new Vms in a eucalyptus Private-Cloud.
once they are up and running i change the hostname to 
http_i-7ebd4301.cloud.mydomain.net
then via ssh install the puppet client and point the config file to the 
puppetMaster.
the pupet master config is very simple


[root@puppet manifests]# tree /etc/puppet/
/etc/puppet/
|-- auth.conf
|-- autosign.conf
|-- fileserver.conf
|-- manifests
|   |-- clases
|   |   `-- http.pp
|   `-- nodes.pp
`-- puppet.conf

the nodes request autosign the certs using the config in autosign 
[root@puppet puppet]# cat autosign.conf
*.cloud.mydomain.net

and while the vm is starting I can see the cert requst in the master logs.
Oct 21 10:41:16 puppet puppet-master[26745]: Could not resolve 
192.168.160.44: no name for 192.168.160.44
Oct 21 10:41:17 puppet last message repeated 3 times
Oct 21 10:41:17 puppet puppet-master[26745]: 
http_i-02953f34.cloud.mydomain.net has a waiting certificate request
Oct 21 10:41:17 puppet puppet-master[26745]: Signed certificate request for 
http_i-02953f34.cloud.mydomain.net
Oct 21 10:41:17 puppet puppet-master[26745]: Removing file 
Puppet::SSL::CertificateRequest http_i-02953f34.cloud.mydomain.net at 
'/var/lib/puppet/ssl/ca/requests/http_i-02953f34.cloud.mydomain.net.pem'
Oct 21 10:41:17 puppet puppet-master[26745]: Could not resolve 
192.168.160.44: no name for 192.168.160.44
Oct 21 10:41:20 puppet puppet-master[26745]: Compiled catalog for 
http_i-02953f34.cloud.mydomain.net in environment production in 0.01 seconds


the nodes.pp uses a regexp to match the hostname and apply the manifest 
based in the hostname
[root@puppet puppet]# cat manifests/nodes.pp
import "classes/http"
node /http_*/ {
notice("inside node")
include http
}

and the http.pp class is very simple as well
[root@puppet puppet]# cat manifests/clases/http.pp
# /etc/puppet/manifests/classes/http.pp
class http {
  package { 'httpd':
ensure => installed,
}
  service { 'httpd':
ensure=> running,
enable=> true,
}
}

I run the agent in the Vm
-bash-3.2# puppet agent --no-daemonize  --onetime --verbose
info: Caching catalog for http_i-02953f34.cloud.mydomain.net
info: Applying configuration version '1350830592'
notice: Finished catalog run in 0.14 seconds

So I see no errors in the agent os the master, but the http class should 
install and start apache and  never happend.

any clues why?
regards
Owen





-- 
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/-/QyY4QfJW7ZAJ.
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] SOLVED:Re: need a hand to troubleshoot this small setup

2012-10-21 Thread OwenM
Hate to do this. 
replying myself...
a typo in the classes directory

thx
OWen

On Sunday, October 21, 2012 10:47:32 AM UTC-4, OwenM wrote:
>
> Hi all,
> Im provisioning new Vms in a eucalyptus Private-Cloud.
> once they are up and running i change the hostname to 
> http_i-7ebd4301.cloud.mydomain.net
> then via ssh install the puppet client and point the config file to the 
> puppetMaster.
> the pupet master config is very simple
>
>
> [root@puppet manifests]# tree /etc/puppet/
> /etc/puppet/
> |-- auth.conf
> |-- autosign.conf
> |-- fileserver.conf
> |-- manifests
> |   |-- clases
> |   |   `-- http.pp
> |   `-- nodes.pp
> `-- puppet.conf
>
> the nodes request autosign the certs using the config in autosign 
> [root@puppet puppet]# cat autosign.conf
> *.cloud.mydomain.net
>
> and while the vm is starting I can see the cert requst in the master logs.
> Oct 21 10:41:16 puppet puppet-master[26745]: Could not resolve 
> 192.168.160.44: no name for 192.168.160.44
> Oct 21 10:41:17 puppet last message repeated 3 times
> Oct 21 10:41:17 puppet puppet-master[26745]: 
> http_i-02953f34.cloud.mydomain.net has a waiting certificate request
> Oct 21 10:41:17 puppet puppet-master[26745]: Signed certificate request 
> for http_i-02953f34.cloud.mydomain.net
> Oct 21 10:41:17 puppet puppet-master[26745]: Removing file 
> Puppet::SSL::CertificateRequest http_i-02953f34.cloud.mydomain.net at 
> '/var/lib/puppet/ssl/ca/requests/http_i-02953f34.cloud.mydomain.net.pem'
> Oct 21 10:41:17 puppet puppet-master[26745]: Could not resolve 
> 192.168.160.44: no name for 192.168.160.44
> Oct 21 10:41:20 puppet puppet-master[26745]: Compiled catalog for 
> http_i-02953f34.cloud.mydomain.net in environment production in 0.01 
> seconds
>
>
> the nodes.pp uses a regexp to match the hostname and apply the manifest 
> based in the hostname
> [root@puppet puppet]# cat manifests/nodes.pp
> import "classes/http"
> node /http_*/ {
> notice("inside node")
> include http
> }
>
> and the http.pp class is very simple as well
> [root@puppet puppet]# cat manifests/clases/http.pp
> # /etc/puppet/manifests/classes/http.pp
> class http {
>   package { 'httpd':
> ensure => installed,
> }
>   service { 'httpd':
> ensure=> running,
> enable=> true,
> }
> }
>
> I run the agent in the Vm
> -bash-3.2# puppet agent --no-daemonize  --onetime --verbose
> info: Caching catalog for http_i-02953f34.cloud.mydomain.net
> info: Applying configuration version '1350830592'
> notice: Finished catalog run in 0.14 seconds
>
> So I see no errors in the agent os the master, but the http class should 
> install and start apache and  never happend.
>
> any clues why?
> regards
> Owen
>
>
>
>
>
>

-- 
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/-/gklCdox8E3AJ.
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] use regex to ensure multiple directories are absent or exist

2012-10-21 Thread Panaman
Is it possible to use regex to ensure directories are deleted.

I want to be able to do something like:

file { '/var/directory[1-9]':
  ensure => absent,
}

Would also be nice to use regex to ensure directories are present...

-- 
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/-/ReHmba9K8z0J.
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] custom type with array property?

2012-10-21 Thread Jakov Sosic

Hi.


I'm having trouble to write a custom type that accepts array as 
property. This is example of my custom type resource definition:


customtype { 'blah':
  myarray => ['a','b'],
}


This is what I've got in provider:

def myarray=(value)
  require 'pp'
  pp value
end


But pp prints only "a"... It would be really helpful if I could see 
example of array in custom type... So any help is appreciated.







--
Jakov Sosic
www.srce.unizg.hr

--
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] Razor Mongodb related questions

2012-10-21 Thread Hong
 

I'm new to Razor and have two questions related to Razor Mongodb:

1. Is there available Razor object relationship diagram that describes 
relationships between Razor slices?

2. Does Razor make use of Mongo's JSON doc store features like automatic 
secondary indexing on all JSON attributes?

-- 
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/-/OosFbsQi3iQJ.
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] custom type with array property?

2012-10-21 Thread Nan Liu
On Sun, Oct 21, 2012 at 10:04 AM, Jakov Sosic  wrote:
> I'm having trouble to write a custom type that accepts array as property.
> This is example of my custom type resource definition:
>
> customtype { 'blah':
>   myarray => ['a','b'],
> }
>
> This is what I've got in provider:
>
> def myarray=(value)
>   require 'pp'
>   pp value
> end
>
>
> But pp prints only "a"... It would be really helpful if I could see example
> of array in custom type... So any help is appreciated.

Puppet::Type.newtype(:customtype) do
  newproperty(:myarray, array_matching => :all) do
  end
end

HTH,

Nan

-- 
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 node_aws fingerprint vs configprint

2012-10-21 Thread Ignasi López
Hi! 
I've been playing with puppet node_aws on my ec2 instances and there is a 
problem which I don't know how to solve it. 
The problem is: when i run puppet node_aws bootstrap in order to create and 
install puppet in new instance, I see at the end of logs:
debug: Command: sudo puppet agent --configprint certname err: fingerprint 
f4:19:2a:53:b9:43:26:73:2e:b6:b7:9c:18:c3:db:aa does not match for 
"ec2-107-21-150-66.compute-1.amazonaws.com,10.122.94.180"
I tried to execute puppet agent --configprint certname and I get 
"ec2-107-21-150-66.compute-1.amazonaws.com,10.122.94.180" why puppet is 
expecting the fingerprint ?

I haven't found information about --configprint parameter. What is the 
function of this parameter? And why has "certname" as a value? 

Maybe if i could understant this parameter I would find the solution of my 
problem.

Thanks,
Ignasi

-- 
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/-/lbslEY9alv8J.
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] Re: Variables and autoloading

2012-10-21 Thread Guzman Braso
John,

I'm new to puppet and your mails confuse me a little bit... if
parameterized classes are not recommended and you suggest when dealing with
someone else parameterized class to set it through hiera (Puppet 3).
Then I don't understand how to proceed with puppet 2 modules...

Should I hack every module I need to set the defaults inside the module?

If this is the way, what if I need to reuse the module with different
defaults?
I thought a good module was a module I don't need to touch and I can set my
defaults from my call, with this approach as soon I start using a module
I'll likely not keep up to date with it, as it will have to deal with all
the hacked code during upgrades.

And if making a module, without using parameters, how I can reuse the
module with different defaults ? Should I create a different params.pp for
each scenario I need and then include it inheriting each one of the
defaults, this would be a mess to deal with large arquitectures with many
different types of nodes.

I'm sorry to ask but since we started using puppet (a few months ago) we
started doing everything with parameters as puppet docs said on
http://docs.puppetlabs.com/guides/parameterized_classes.html and since then
we had no issue (yet) with it.  And now you say that parameters are a
sickness and should not be used. Then how on Puppet 2? And why it's still
puppet docs still recommending it?

Thanks in advance for your time!

Guzmán
On Mon, Oct 15, 2012 at 6:56 PM, jcbollinger wrote:

>
>
> On Monday, October 15, 2012 9:43:48 AM UTC-5, Matt Zagrabelny wrote:
>>
>> Can you suggest an alternative to parameterized classes?
>>
>>
> Funny that you ask.  I just did exactly that a few doors down:
> https://groups.google.com/forum/#!msg/puppet-users/dICUPHn3azY/b0wJaiSbs8kJ.  
> I'm afraid I waxed long-winded, but there is an example in there.
> Basically, thoug
>
h, it's to use hiera, and to do so explicitly instead of via 3.0's hiera /
> class parameter integration.
>
>
> John
>
> --
> 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/-/ZNXpUwtq3UgJ.
>
> 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.
>



-- 
GuruHub - Guzmán Brasó
http://www.guruhub.com.uy - +59898674020
Rivera 3565 - CP11400 - Montevideo, Uruguay

-- 
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] Razor Mongodb related questions

2012-10-21 Thread Daniel Pittman
On Sun, Oct 21, 2012 at 10:12 AM, Hong  wrote:
> I'm new to Razor and have two questions related to Razor Mongodb:

Hey.  A better place for developer type questions like this is
probably the dev list, just because the volume of mail here on the
user list can make it easy to miss.

> 1. Is there available Razor object relationship diagram that describes
> relationships between Razor slices?

Not really.  There is some per-slice documentation that kind of covers
this here: https://github.com/puppetlabs/Razor/wiki

What, concretely, were you looking for?  I know that better
documentation is needed, but having real stories about the questions
people were trying to answer will help make it much better, much
sooner. :)

> 2. Does Razor make use of Mongo's JSON doc store features like automatic
> secondary indexing on all JSON attributes?

...not really, in the sense that Razor doesn't actually have *any*
sort of query across the data, just key lookup or full collection
lookup.

Why do you ask?

-- 
Daniel Pittman
⎋ Puppet Labs Developer – http://puppetlabs.com
♲ Made with 100 percent post-consumer electrons

-- 
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.