Re: [Puppet Users] Implementing hooks

2012-04-12 Thread Gabriel Filion
On 12-04-12 04:18 AM, Luke Bigum wrote:
> Could you get by with a wrapper? Say, a 'my_nagios' define that does
> it's own thing, then uses the third party 'nagios' definition?
> 
> You could add your own resources in your my_nagios that 'Subscribes' to
> resources in the 'nagios' define to insert your own resources into the
> dependency chain.

I've just thought about that: maybe I could get what I want by setting a
default value to some parameters to the define? for example, if I'd like
to define some groups depending on an arbitrary "level" of service :

class level1_apache_server {
  Nagios::Service {
base_groups => 'level1-apache-server',
  }

  include apache_logic
}

I think I remember seeing discussion about this kind of feature getting
killed sometime because of scoping issues.. is that right?

-- 
Gabriel Filion

-- 
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: [Puppet-dev] Taking github noise away from puppet-dev list

2012-04-12 Thread Andrew Parker
I just recently started working at Puppet Labs and have been pretty much been 
ignoring most of what I see from this list because of the amount of github mail 
on it. I think that removing the github email from this list will help it to do 
what I'm hoping to see on it, which is to have discussions around the design of 
puppet and not about being notified or reviewing the code of its 
implementation. So to the level that code showing up on the list helps to 
foster discussion about what puppet is or should be, then I think that it would 
add quite a lot, but when most of it is just a running stream of commits and 
merges of things that are not part of a larger discussion it seems like it 
would just add noise.

On Apr 12, 2012, at 8:02 AM, James Turnbull wrote:

>> * no close e-mail
>> * more readable inlined patches (syntax coloring?, broken in different
>> e-mails per commit?)
>> * send back to the thread on this list the internal discussion happening
>> on github
> 
> I agree with Brice. The only way to bring the conversation back here is
> not to segment/split the conversation...
> 
> James
> 
> 
> -- 
> James Turnbull
> Puppet Labs
> 1-503-734-8571
> To schedule a meeting with me: http://tungle.me/jamtur01
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Developers" group.
> To post to this group, send email to puppet-...@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-dev+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-dev?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] Implementing hooks

2012-04-12 Thread Gabriel Filion
On 12-04-12 04:18 AM, Luke Bigum wrote:
> Could you get by with a wrapper? Say, a 'my_nagios' define that does
> it's own thing, then uses the third party 'nagios' definition?
> 
> You could add your own resources in your my_nagios that 'Subscribes' to
> resources in the 'nagios' define to insert your own resources into the
> dependency chain.

Well, I've thought about that. But the problem with this approach is
that all the nagios services defined in other modules to automatically
verify services will not be using the 'my_nagios' definition, but still
the one from the nagios module.

> If you actually need to modify parameters of a resource in a definition
> though then the only way I know of would be to have that parameter
> controlled by an argument to the defined type.

yeah, hence the need to modify the define to add in the additional logic :\

> On 12/04/12 07:10, Gabriel Filion wrote:
>> I'm currently using a "nagios" module that's developed by an opensource
>> community, and I'd like to hook some logic into a define to implement
>> some kind of notion that's really specific to the place I work.
>>
>> For now, I've been obligated to keep a modified version of the module,
>> but that means I always need to rebase re-arrange my code around
>> upstream modifications.. and for maintenance, it really adds a bunch of
>> work.
>>
>> Do you guys know if it would be possible to implement a way to "hook" my
>> extraneous logic into the define so that I don't need to modify the
>> module directly anymore?
>>
> 
> 

-- 
Gabriel Filion

-- 
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] Installing from source, not a package

2012-04-12 Thread John Shoemaker
Is it possible to install packages to specific directories for most 
providers? (for example, passing --instdir to dpkg -i).

On Monday, July 18, 2011 4:18:18 PM UTC-7, chiggsy wrote:
>
> use fpm . You still 
> should know how to make a package, but fpm will make one from a gem, or 
> sources. If you are i a rush, that is.

-- 
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/-/qSe563kkMwoJ.
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] Developing a module: Use it from the current directory?

2012-04-12 Thread Michael Elsdörfer
In general, the loading/import/namespacing mechanism is really something 
that I cannot wrap my head around, even after reading the relevant sections 
in the documentation.

Specifically, I'm trying to put together a module. I believe I have the 
correct module structure:

$ find
.
./test.pp
./graphite
./graphite/manifests
./graphite/manifests/init.pp
./graphite/files
./graphite/files/local_settings.py

The test.pp file looks like this:

  include graphite

This will not find the module I have placed in the same directory. If I 
import the module explicitly, it still does not work:

  import 'graphite'
  include graphite

This does work in sofar as that the script runs a good while:

  import 'graphite/manifests/init.pp'
  include graphite 

However, in that case, it isn't able to resolve puppet:// urls:

  Could not evaluate: Could not retrieve information from environment 
production source(s) 

The only way I can get this to work is:

  sudo puppet apply --modulepath=. test.pp

Is that right? Shouldn't there be a simpler way?

-- 
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/-/1PmY6CcY4xcJ.
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: service restart upon notify

2012-04-12 Thread Trevor Smith


On Thursday, April 12, 2012 4:07:40 PM UTC-4, puppetguest wrote:
>
> I have choosen to split my module into several .pp files as i have 
> seen in an example and makes it cleaner i think. 
>
> \modules\mysoftware\ 
> init.pp 
> install.pp 
> config.pp 
> service.pp 
>
> Is that recommended or too many disadvantages ? 
>
> So my install.pp went through fine, config.pp as well. 
> When i change a config-file and puppet runs again i want the automatic 
> service restart but doesnt work unfortunately. 
>
> Does someone know the proper syntax how to trigger from config.pp  the 
> function in service.pp for such a case ? 
>
> Examples like these dont work :-( 
>notify  => Class["mysoftware::service"] 
>notify  => Class["mysoftware::service::mysoftwarerestart"] 
>... 
>
>
How about:

notify => Exec['mysoftwarerestart']
 
You could also look at 'refreshonly' under the type reference for exec:  
http://docs.puppetlabs.com/references/2.7.0/type.html#exec


> I should mention that the service has to restart via a shell-script, 
> not via init services ! 
> So may be the service.pp needs some corrections too ? 
>
> service.pp 
>
> class mysoftware::service ( 
>   $user= "myuser", 
>  ) { 
>
>   exec {"mysoftwarerestart": 
> command  => "/opt/mysoftware/bin/script.sh restart", 
> require  => Class["mysoftware::config"], 
>   } 
>
> } 
>
>

-- 
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/-/hzUXRE0EmLMJ.
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] Define node environment on puppet master nodes.pp?

2012-04-12 Thread Will S. G.
Hello,

Is there a way to define an environment for the prospective nodes in 
nodes.pp (maybe a default node?) I'd like to be able to define it there and 
then have my puppet module configure the node puppet.conf (erb template) 
based on the parameters that’s passed on from the master. Possible?

Thanks,
Will

-- 
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/-/IFHCUekQhhAJ.
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] Defining node environment on master nodes.pp?

2012-04-12 Thread Will S. G.
 

Hello, 

Is there a way to define an environment for the prospective nodes in 
nodes.pp? *I'd like to be able to define it there and then have my puppet 
module configure the node puppet.conf* (*erb* template) *based* on the 
parameters that*’s* passed on from the master. Possible? 

Thanks,
Will

-- 
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/-/L5KHhYA8H4cJ.
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] service restart upon notify

2012-04-12 Thread puppetguest
I have choosen to split my module into several .pp files as i have
seen in an example and makes it cleaner i think.

\modules\mysoftware\
init.pp
install.pp
config.pp
service.pp

Is that recommended or too many disadvantages ?

So my install.pp went through fine, config.pp as well.
When i change a config-file and puppet runs again i want the automatic
service restart but doesnt work unfortunately.

Does someone know the proper syntax how to trigger from config.pp  the
function in service.pp for such a case ?

Examples like these dont work :-(
   notify  => Class["mysoftware::service"]
   notify  => Class["mysoftware::service::mysoftwarerestart"]
   ...


I should mention that the service has to restart via a shell-script,
not via init services !
So may be the service.pp needs some corrections too ?

service.pp

class mysoftware::service (
  $user= "myuser",
 ) {

  exec {"mysoftwarerestart":
command  => "/opt/mysoftware/bin/script.sh restart",
require  => Class["mysoftware::config"],
  }

}

-- 
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] template arrays

2012-04-12 Thread Marek Dohojda
Hey that does look heck of a lot prettier! Thanks!

On Thu, Apr 12, 2012 at 1:02 PM, Steven King  wrote:

>  Marek,
>
> I'd suggest using something like the following to use a template based on
> hostname:
>
> file { '/path/to/file':
>   template => $hostname ? {
> /regex/   => 'puppet://module/template.erb',
> /regex2/ => 'puppet://module/template1.erb',
> default=> 'puppet://module/default-template.erb',
>   }
> }
>
> This is a more elegant solution than a bunch of if statements, well this
> is essentially an if statement as well, just prettier.
>
>
> On 4/12/12 2:39 PM, Marek Dohojda wrote:
>
> Hello
>
> Thank you
> Unfortunately this won't help me at the moment because the files are
> different completely and not just few parameters.  I need different
> templates based on hostname.
> I am fully aware that I can use "if" but well..ahm.. its ugly :)
>
>
>
> On Thu, Apr 12, 2012 at 10:53 AM, Gary Larizza wrote:
>
>> Hey Marek,
>>
>>  Templates do have different functionality here - they will concatenate
>> arrays of templates (i.e. if you pass more than one template, it
>> concatenates them all together into one file).  You might want to check out
>> the blog on separating data from code (
>> http://puppetlabs.com/blog/the-problem-with-separating-data-from-puppet-code/)
>> to see ways that you can specify that piece of data entirely separate from
>> your puppet code.
>>
>>
>>
>>  On Thu, Apr 12, 2012 at 9:42 AM, Marek Dohojda wrote:
>>
>>>  Sorry if this has been asked, but Google has failed me and I haven't
>>> been able to find an answer.
>>>
>>> With a source one can declare array so that if file exist puppet will
>>> pull it out first, if not move to the next file in this fashion:
>>>
>>> source => ["puppet:///conf/httpd_$hostname.conf",
>>>  "puppet:///conf/httpd.conf",
>>> ],
>>>
>>> To the best of my knowledge one can't do that with a Template (at least as 
>>> of 0.24, I am hoping this has changed).
>>>
>>> What is the recommended way of dealing with this?
>>>
>>> I do know that I can have an "if" statement within a class/module to go 
>>> like this:
>>>
>>>
>>>
>>>
>>> if $hostname {
>>>content =...
>>>
>>> However that isn't as clean as being able to do this from within the same 
>>> array as "source".  That way instead of keep having to add "if/else" I can 
>>> simply add a file as needed.
>>>
>>>
>>>
>>>
>>> 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.
>>>
>>
>>
>>
>>  --
>>
>> 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.
>>
>
> --
> 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.
>
>
> --
> Steve King
>
> Network/Linux Engineer - AdSafe Media
> Cisco Certified Network Professional
> CompTIA Linux+ Certified Professional
> CompTIA A+ Certified Professional
>
>  --
> 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: Need puppet module for condition copy

2012-04-12 Thread Sans
You probably getting: "file not found" or something like that? It's
because you are trying to copy a file from one machine (i.e. puppet
server) to another machine, your puppet agent, using "cp" command.
Puppet has file{} resource and "source" parameter for that. Other than
that, if not typo, I don't see any gap between the source_path and the
dest_path in your "cp" command.

Also, I think "class d_services::jboss" is wrong in your case. You
don't have any "d_services" module, I suppose. Try this: If "jmx-
console-users.properties" is the file that your are trying to copy,
then create a directory on your Puppet-master at "etc/puppet/modules/
dev_jboss_jeeva/files" and put the configuration file(s) in there
first. Then, use this:



# /etc/puppet/modules/dev_jboss_jeeva/manifests/jboss.pp


class dev_jboss_jeeva::jboss {

define opt_dir($path) {

$j_conf = 'jmx-console-users.properties'

exec { "chk_${path}":
 path => [ '/bin', '/usr/bin' ],
 command  => "test -d /opt/${path}",
 }

file { "${path}_${j_conf}":
name=> "/opt/${path}/${j_conf}",
mode=> '0644', owner => 'root', group => 'root',
source  => "puppet:///modules/dev_jboss_jeeva/${j_conf}",
require => Exec[ "chk_${path}" ];
}
}
}


Now, suppose you are copying the file: jmx-console-users.properties to
"/opt/jboss_1", "/opt/jboss_2" and "/opt/jboss_3" on the agent (if
available), change the init.pp like this:



# /etc/puppet/modules/dev_jboss_jeeva/manifests/init.pp

class copy_jboss_conf {

include dev_jboss_jeeva::jboss
dev_jboss_jeeva::jboss::opt_dir {

'copy_to_1st':
path => 'jboss_1';

'copy_to_2nd':
path => 'jboss_2';

'copy_to_3rd':
path => 'jboss_3';
}
}
**


Not tested, but should work. At least it's working for me in similar
fashion. Cheers!!



On Apr 12, 6:40 pm, Munna S <19.mu...@gmail.com> wrote:
> Hi Sans,
>
> This is my jboss.pp file
>
> class d_services::jboss {
>     define opt_dir($path) {
>         exec { "copy_${path}":
>             path    => [ '/bin', '/usr/bin' ],
>             command => "cp /etc/puppet/modules/dev_jboss_jeeva/opt/jboss/
> jboss-4.2.3.GA/server/default/conf/props/jmx-console-users.properties/opt/${path}",
>             onlyif  => "test -d /opt/${path}",
>         }
>     }
>
> }
>
> this is my init.pp file
>
> class dev_jboss_jeeva {
>   include d_services::jboss
>     d_services::jboss::opt_dir {
>         'jboss_1':
>         path => '/opt/jboss/jboss-4.2.3.GA/server/default/conf/props/';
>     }
>
> }
>
> But i am still getting the error
>

-- 
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] template arrays

2012-04-12 Thread Steven King

Marek,

I'd suggest using something like the following to use a template based 
on hostname:


file { '/path/to/file':
  template => $hostname ? {
/regex/   => 'puppet://module/template.erb',
/regex2/ => 'puppet://module/template1.erb',
default=> 'puppet://module/default-template.erb',
  }
}

This is a more elegant solution than a bunch of if statements, well this 
is essentially an if statement as well, just prettier.


On 4/12/12 2:39 PM, Marek Dohojda wrote:

Hello

Thank you
Unfortunately this won't help me at the moment because the files are 
different completely and not just few parameters.  I need different 
templates based on hostname.

I am fully aware that I can use "if" but well..ahm.. its ugly :)



On Thu, Apr 12, 2012 at 10:53 AM, Gary Larizza > wrote:


Hey Marek,

Templates do have different functionality here - they will
concatenate arrays of templates (i.e. if you pass more than one
template, it concatenates them all together into one file).  You
might want to check out the blog on separating data from code

(http://puppetlabs.com/blog/the-problem-with-separating-data-from-puppet-code/)
to see ways that you can specify that piece of data entirely
separate from your puppet code.



On Thu, Apr 12, 2012 at 9:42 AM, Marek Dohojda mailto:chro...@gmail.com>> wrote:

Sorry if this has been asked, but Google has failed me and I
haven't been able to find an answer.

With a source one can declare array so that if file exist
puppet will pull it out first, if not move to the next file in
this fashion:

source  =>  ["puppet:///conf/httpd_$hostname.conf",
  "puppet:///conf/httpd.conf",
 ],

To the best of my knowledge one can't do that with a Template (at least 
as of 0.24, I am hoping this has changed).

What is the recommended way of dealing with this?

I do know that I can have an "if" statement within a class/module to go 
like this:




if $hostname {
content =...

However that isn't as clean as being able to do this from within the same array as 
"source".  That way instead of keep having to add "if/else" I can simply add a 
file as needed.




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.




-- 


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.


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


--
Steve King

Network/Linux Engineer - AdSafe Media
Cisco Certified Network Professional
CompTIA Linux+ Certified Professional
CompTIA A+ Certified Professional

--
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] template arrays

2012-04-12 Thread Gary Larizza
On Thu, Apr 12, 2012 at 11:39 AM, Marek Dohojda  wrote:

> Hello
>
> Thank you
> Unfortunately this won't help me at the moment because the files are
> different completely and not just few parameters.  I need different
> templates based on hostname.
> I am fully aware that I can use "if" but well..ahm.. its ugly :)
>
>
Right,

If you used something like Hiera you could do a lookup on a variable (like
$foo_content for example) and hiera would pass a different value for the
content attribute based on the hostname of the machine.  So if it were one
hostname you could get something like
"template('module/first_template.erb')" and another hostname would return a
value of "template('module/second_template.erb')".  Then, in the
declaration, you could do:

file { '/path/to/file':
  ensure => present,
  content => $foo_content,
}

Your Puppet code would be generic (only using a variable) and all your data
would be determined in Hiera.  If you're interested in this method, there's
also a blog post for using Hiera here -->
http://puppetlabs.com/blog/first-look-installing-and-using-hiera/





>
>
>
> On Thu, Apr 12, 2012 at 10:53 AM, Gary Larizza wrote:
>
>> Hey Marek,
>>
>> Templates do have different functionality here - they will concatenate
>> arrays of templates (i.e. if you pass more than one template, it
>> concatenates them all together into one file).  You might want to check out
>> the blog on separating data from code (
>> http://puppetlabs.com/blog/the-problem-with-separating-data-from-puppet-code/)
>> to see ways that you can specify that piece of data entirely separate from
>> your puppet code.
>>
>>
>>
>> On Thu, Apr 12, 2012 at 9:42 AM, Marek Dohojda  wrote:
>>
>>> Sorry if this has been asked, but Google has failed me and I haven't
>>> been able to find an answer.
>>>
>>> With a source one can declare array so that if file exist puppet will
>>> pull it out first, if not move to the next file in this fashion:
>>>
>>> source => ["puppet:///conf/httpd_$hostname.conf",
>>>  "puppet:///conf/httpd.conf",
>>> ],
>>>
>>> To the best of my knowledge one can't do that with a Template (at least as 
>>> of 0.24, I am hoping this has changed).
>>>
>>> What is the recommended way of dealing with this?
>>>
>>> I do know that I can have an "if" statement within a class/module to go 
>>> like this:
>>>
>>>
>>>
>>> if $hostname {
>>>content =...
>>>
>>> However that isn't as clean as being able to do this from within the same 
>>> array as "source".  That way instead of keep having to add "if/else" I can 
>>> simply add a file as needed.
>>>
>>>
>>>
>>> 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.
>>>
>>
>>
>>
>> --
>>
>> 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.
>>
>
>  --
> 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.



Re: [Puppet Users] template arrays

2012-04-12 Thread Marek Dohojda
Hello

Thank you
Unfortunately this won't help me at the moment because the files are
different completely and not just few parameters.  I need different
templates based on hostname.
I am fully aware that I can use "if" but well..ahm.. its ugly :)



On Thu, Apr 12, 2012 at 10:53 AM, Gary Larizza  wrote:

> Hey Marek,
>
> Templates do have different functionality here - they will concatenate
> arrays of templates (i.e. if you pass more than one template, it
> concatenates them all together into one file).  You might want to check out
> the blog on separating data from code (
> http://puppetlabs.com/blog/the-problem-with-separating-data-from-puppet-code/)
> to see ways that you can specify that piece of data entirely separate from
> your puppet code.
>
>
>
> On Thu, Apr 12, 2012 at 9:42 AM, Marek Dohojda  wrote:
>
>> Sorry if this has been asked, but Google has failed me and I haven't been
>> able to find an answer.
>>
>> With a source one can declare array so that if file exist puppet will
>> pull it out first, if not move to the next file in this fashion:
>>
>> source => ["puppet:///conf/httpd_$hostname.conf",
>>  "puppet:///conf/httpd.conf",
>> ],
>>
>> To the best of my knowledge one can't do that with a Template (at least as 
>> of 0.24, I am hoping this has changed).
>>
>> What is the recommended way of dealing with this?
>>
>> I do know that I can have an "if" statement within a class/module to go like 
>> this:
>>
>>
>> if $hostname {
>>content =...
>>
>> However that isn't as clean as being able to do this from within the same 
>> array as "source".  That way instead of keep having to add "if/else" I can 
>> simply add a file as needed.
>>
>>
>> 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.
>>
>
>
>
> --
>
> 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.
>

-- 
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] using array parameters with inherited parameterized classes

2012-04-12 Thread Shantanu

I am trying to use an inherited  array parameter in a parameterized
class as follows:


class params{
  $packages = $operatingsystem ? {
Centos => ['scons','bzip2'],
Ubuntu => ['scons','bzip2'],
# Ubuntu => 'scons',
  }
}

class depacks(
  $packages = "$params::packages"
) inherits params {

  package{ $packages:
ensure => 'present',
  }
}

class {"depacks": }



* It's failing with following error:

err: /Stage[main]/Depacks/Package[sconsbzip2]/ensure: change from
purged to present failed: Execution of '/usr/bin/apt-get -q -y -o
DPkg::Options::=--force-confold install sconsbzip2' returned 100:
Reading package lists...
Building dependency tree...
Reading state information...
E: Couldn't find package sconsbzip2


* It works fine if I override the inherited array parameter while
calling/evaluating the class:

class {"depacks":
 packages => ['scons','bzip2'],
}


I am using Puppet 2.6.14 with Ruby 1.8.7. The error occurs on both
Ubuntu and CentOS systems.

Am I missing something here? Any pointers will be really helpful.

--
Thanks,
Shantanu

-- 
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] Re: Need puppet module for condition copy

2012-04-12 Thread Munna S
Hi Sans,

This is my jboss.pp file

class d_services::jboss {
define opt_dir($path) {
exec { "copy_${path}":
path=> [ '/bin', '/usr/bin' ],
command => "cp /etc/puppet/modules/dev_jboss_jeeva/opt/jboss/
jboss-4.2.3.GA/server/default/conf/props/jmx-console-users.properties/opt/${path}",
onlyif  => "test -d /opt/${path}",
}
}
}

this is my init.pp file

class dev_jboss_jeeva {
  include d_services::jboss
d_services::jboss::opt_dir {
'jboss_1':
path => '/opt/jboss/jboss-4.2.3.GA/server/default/conf/props/';
}
}

But i am still getting the error

On Thu, Apr 12, 2012 at 12:26 PM, Munna S <19.mu...@gmail.com> wrote:

> source file path it will take from my puppet master server right ?
>
> -Jeeva
>
> On Thu, Apr 12, 2012 at 11:20 AM, Sans  wrote:
>
>> w.r.t ${file}, what I meant is you can make it "super dynamic" with
>> filenames, if you had to copy different files, as opposed to "a
>> single" file. This is a perfectly working example (change the values/
>> parameter as required):
>>
>>
>>
>> # /etc/puppet/modules//manifests/test.pp
>> --
>> class d_services::test {
>>
>>define opt_dir($path) {
>>
>>exec { "copy_${path}":
>> path=> [ '/bin', '/usr/bin' ],
>> command => "cp /tmp/yum.conf.security /opt/${path}",
>> onlyif  => "test -d /opt/${path}",
>>}
>>}
>> }
>>
>>
>> # /etc/puppet/modules//manifests/init.pp
>> ---
>> class mod_test {
>>
>>include d_services::test
>>d_services::test::opt_dir {
>>
>>'test_1':
>>path => 'test1';
>>
>>'test_2':
>>path => 'test2';
>>
>>'test_3':
>>path => 'test3';
>>
>>}
>> }
>> ---
>>
>>
>> It will copy "/tmp/yum.conf.security" to "/opt/test{1|2|3}", if
>> available.
>> Hope this helps. Cheers!!
>>
>>
>>
>>
>> On Apr 12, 4:17 pm, Munna S <19.mu...@gmail.com> wrote:
>> > I am bit confused about /var/staging/${file} . Let me explain again my
>> > requirement.
>> >
>> > we have 3 version of jboss running on multiple servers.
>> >
>> > I need a puppet module to copy a jboss config file to different location
>> > based on path condition check . Below is my requirement
>> >
>> > if /opt/path1 found on the server  then copy file1 or 2
>> > if /opt/path2 found on the server then copy file1 or 2
>> > if /opt/path3 found on the server then copy file1 or 2
>> >
>> > if none of the above path found then dont copy any file
>> >
>>
>> --
>> 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] Re: Need puppet module for condition copy

2012-04-12 Thread Munna S
source file path it will take from my puppet master server right ?

-Jeeva

On Thu, Apr 12, 2012 at 11:20 AM, Sans  wrote:

> w.r.t ${file}, what I meant is you can make it "super dynamic" with
> filenames, if you had to copy different files, as opposed to "a
> single" file. This is a perfectly working example (change the values/
> parameter as required):
>
>
>
> # /etc/puppet/modules//manifests/test.pp
> --
> class d_services::test {
>
>define opt_dir($path) {
>
>exec { "copy_${path}":
> path=> [ '/bin', '/usr/bin' ],
> command => "cp /tmp/yum.conf.security /opt/${path}",
> onlyif  => "test -d /opt/${path}",
>}
>}
> }
>
>
> # /etc/puppet/modules//manifests/init.pp
> ---
> class mod_test {
>
>include d_services::test
>d_services::test::opt_dir {
>
>'test_1':
>path => 'test1';
>
>'test_2':
>path => 'test2';
>
>'test_3':
>path => 'test3';
>
>}
> }
> ---
>
>
> It will copy "/tmp/yum.conf.security" to "/opt/test{1|2|3}", if
> available.
> Hope this helps. Cheers!!
>
>
>
>
> On Apr 12, 4:17 pm, Munna S <19.mu...@gmail.com> wrote:
> > I am bit confused about /var/staging/${file} . Let me explain again my
> > requirement.
> >
> > we have 3 version of jboss running on multiple servers.
> >
> > I need a puppet module to copy a jboss config file to different location
> > based on path condition check . Below is my requirement
> >
> > if /opt/path1 found on the server  then copy file1 or 2
> > if /opt/path2 found on the server then copy file1 or 2
> > if /opt/path3 found on the server then copy file1 or 2
> >
> > if none of the above path found then dont copy any file
> >
>
> --
> 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] Testing a single module

2012-04-12 Thread Gary Larizza
James,

If the modules are in your modulepath and environments are defined in
puppet.conf, you can actually use puppet apply to declare classes from the
command line.  For example, if you just wanted to test the nginx::config
class you could run:  puppet apply -v -e 'include nginx::config'   This
(specifically the -e flag with the code you want to pass in quotes) allows
you to 'test' a specific class out-of-band from your regular Puppet runs.
 DO NOTE, HOWEVER, that 'test' in this sense means that it will ACTUALLY
DECLARE THE CLASS AND PERFORM THE ACTION!  If this is not what you want,
you'll still need to add the --noop flag to SIMULATE the code.  You can
also create individual files in your modules 'tests' directory and declare
them with puppet apply too (if you need more than just one line to test
your code - a la Defined Resource Types).  Note that you can ALSO pass the
environment from the command line with '--environment test'.

Does this help?


On Thu, Apr 12, 2012 at 7:00 AM, James Patterson <
jamespatter...@operamail.com> wrote:

> Hello,
>
> I have a production puppet environment that is working well.
>
> Now more people are developing modules for it we are using a test
> environment using environment=test in the puppet.conf file.
> This prevents changes to modules in the production environment being
> affected by changes in the test environment. So far so good.
>
> By module I mean class, in case it's the wrong class.
>
> 1. I need to test a change to a single module on a production server,
> without breaking all other production servers.
> I could put this single production server into the test environment, but
> this has the danger of pulling in changes from other people's modules as
> well.
> Should I create yet another environment to do this?
>
> 2. Can I define certain modules as being taken from another environment,
> the "test" environment, for example?
>
> Thanks in advance,
>
> --
>  James Patterson
>  jamespatter...@operamail.com
>
> --
> http://www.fastmail.fm - Same, same, but different...
>
> --
> 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.



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

2012-04-12 Thread Jeff McCune
On Wed, Apr 11, 2012 at 9:59 PM, Wil Cooley  wrote:
> 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
> #
>
> I've got 2.7.13, RPMs built yesterday, both puppet and puppet-master
> installed:

Ah, this is a problem our platform team is actively working on right now.

The problem is that modules like stdlib need Puppet to be initialized
in a manner suitable for testing.  Setting things like confdir and
what not.  This means different actions for different versions of
Puppet, and stdlib works all the way back through 2.6.

In any event, if you run against Puppet 2.7.x from source, this method
should already be added to Puppet.

We should also have stdlib fixed up shortly.

If you'd like to actively work on this, please feel free to hop into
#puppet and or #puppet-dev on freenode and ping cprice or myself.

More background information on this problem is located at:
http://projects.puppetlabs.com/issues/13693

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] template arrays

2012-04-12 Thread Gary Larizza
Hey Marek,

Templates do have different functionality here - they will concatenate
arrays of templates (i.e. if you pass more than one template, it
concatenates them all together into one file).  You might want to check out
the blog on separating data from code (
http://puppetlabs.com/blog/the-problem-with-separating-data-from-puppet-code/)
to see ways that you can specify that piece of data entirely separate from
your puppet code.



On Thu, Apr 12, 2012 at 9:42 AM, Marek Dohojda  wrote:

> Sorry if this has been asked, but Google has failed me and I haven't been
> able to find an answer.
>
> With a source one can declare array so that if file exist puppet will pull
> it out first, if not move to the next file in this fashion:
>
> source => ["puppet:///conf/httpd_$hostname.conf",
>  "puppet:///conf/httpd.conf",
> ],
>
> To the best of my knowledge one can't do that with a Template (at least as of 
> 0.24, I am hoping this has changed).
>
> What is the recommended way of dealing with this?
>
> I do know that I can have an "if" statement within a class/module to go like 
> this:
>
> if $hostname {
>content =...
>
> However that isn't as clean as being able to do this from within the same 
> array as "source".  That way instead of keep having to add "if/else" I can 
> simply add a file as needed.
>
> 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.
>



-- 

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] template arrays

2012-04-12 Thread Marek Dohojda
Sorry if this has been asked, but Google has failed me and I haven't been
able to find an answer.

With a source one can declare array so that if file exist puppet will pull
it out first, if not move to the next file in this fashion:

source => ["puppet:///conf/httpd_$hostname.conf",
 "puppet:///conf/httpd.conf",
],

To the best of my knowledge one can't do that with a Template (at
least as of 0.24, I am hoping this has changed).

What is the recommended way of dealing with this?

I do know that I can have an "if" statement within a class/module to
go like this:

if $hostname {
   content =...

However that isn't as clean as being able to do this from within the
same array as "source".  That way instead of keep having to add
"if/else" I can simply add a file as needed.

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.



[Puppet Users] Re: Error 400 on SERVER: Duplicate definition

2012-04-12 Thread Sans
Thanks Bernd! Make sense. Cheers!!


On Apr 12, 3:19 pm, Bernd Adamowicz 
wrote:
> No problem. You're wellcome! And you're not silly. It's just a common 
> pitfall. If you define a resource within a function, this resource will be 
> re-defined with every function call. And since resources have to be unique, 
> the second call to the function will lead to a duplicate definition.
>
> So that's expected behavior. The only thing that could be improved is the 
> error message which does not lead to the real problem. Maybe the Puppet guys 
> could work on this in the future ;-)
>
> Cheers Bernd

-- 
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] Re: Puppet Certificate's

2012-04-12 Thread Gary Larizza
Hey Guys,

Let me try to step through this one step at a time.  I recommend
downloading one of our VMs that we host for testing puppet (I'm using the
VM we use for training located here -->
http://downloads.puppetlabs.com/training/puppet-vmware.zip but there's also
one for VirtualBox too -->
http://downloads.puppetlabs.com/training/puppet-vbox.zip) to test this
setup.  If you do that, make sure DNS and networking are working (So, setup
host entries on your laptop for each VM, setup the hostname and FQDN ON
EACH VM, and make sure each VM can ping the VM Master).  I'm using three
VMs (a master and two agents): nodemaster.puppetlabs.vm,
node1.puppetlabs.vm, and node2.puppetlabs.vm.  Once DNS resolves and is
working, setup Puppet on the master FIRST, and then setup the remaining
nodes as agents.  Again, I recommend using the VMs and using Puppet
Enterprise because it makes it MUCH EASIER to setup Puppet - just use the
puppet-enterprise-installer script (once you get the process of using a
single cert and multiple node_names DOWN, THEN you can start on some actual
machines).

Now we can start customizing Puppet.  There are a couple of key steps that
need to be taken since we're shipping around a single cert for all machines:

1. When you stand up a PE Agent, it's going to contact the master and setup
a Certificate Signing Request.  Because of this, go to the master node's
$ssldir (which, on Puppet Enterprise, is /etc/puppetlabs/puppet/ssl.  If
you want to find the $ssldir on YOUR master, just run `puppet config print
ssldir` and it will print it out for you) and remove the CSRs that are in
the ca/requests/ directory (they should be named after your nodes).

2. Next, lets generate the single certificate that will be shopped around.
 You will need to use the same 'certname' on every node.  This is the name
of the node as SSL is aware (in my case I'm using 'macs.puppetlabs.vm').
 Do this by doing `puppet cert generate macs.puppetlabs.vm` on your MASTER
machine.  The master will generate the certs and your $ssldir will look
something like this:

ssl

|-- ca

|   |-- ca_crl.pem

|   |-- ca_crt.pem

|   |-- ca_key.pem

|   |-- ca_pub.pem

|   |-- inventory.txt

|   |-- private

|   |   `-- ca.pass

|   |-- requests

|   |-- serial

|   `-- signed

|   |-- macs.puppetlabs.vm.pem

|   |-- nodemaster.puppetlabs.vm.pem

|   |-- pe-internal-broker.pem

|   |-- pe-internal-dashboard.pem

|   |-- pe-internal-mcollective-servers.pem

|   |-- pe-internal-peadmin-mcollective-client.pem

|   `-- pe-internal-puppet-console-mcollective-client.pem

|-- certificate_requests

|-- certs

|   |-- ca.pem

|   |-- macs.puppetlabs.vm.pem

|   |-- nodemaster.puppetlabs.vm.pem

|   |-- pe-internal-broker.pem

|   |-- pe-internal-mcollective-servers.pem

|   |-- pe-internal-peadmin-mcollective-client.pem

|   `-- pe-internal-puppet-console-mcollective-client.pem

|-- crl.pem

|-- private

|-- private_keys

|   |-- macs.puppetlabs.vm.pem

|   |-- nodemaster.puppetlabs.vm.pem

|   |-- pe-internal-broker.pem

|   |-- pe-internal-mcollective-servers.pem

|   |-- pe-internal-peadmin-mcollective-client.pem

|   `-- pe-internal-puppet-console-mcollective-client.pem

`-- public_keys

|-- foo.puppetlabs.vm.pem

|-- macs.puppetlabs.vm.pem

|-- nodemaster.puppetlabs.vm.pem

|-- pe-internal-broker.pem

|-- pe-internal-mcollective-servers.pem

|-- pe-internal-peadmin-mcollective-client.pem

`-- pe-internal-puppet-console-mcollective-client.pem


3.  There are three files you need to collect on your master and ship
around to all of your nodes.  They are ALL in the $ssldir, so these paths
are relative to THAT directory.  The three files are:

   - $ssldir/private_keys/macs.puppetlabs.vm.pem on the master  ->  gets
   copied to the agent's $ssldir/private_keys directory
   - $ssldir/public_keys/macs.puppetlabs.vm.pem on the master   ->  gets
   copied to the agent's $ssldir/public_keys directory
   - $ssldir/ca/signed/macs.puppetlabs.vm.pem on the master   ->  gets
   copied to the agent's $ssldir/certs directory

4.  You need to modify /etc/puppetlabs/puppet/auth.conf on the master so
every node can access the find action on the catalog REST endpoint for the
master (i.e. The Mac nodes can get their catalog).  Look for this stanza in
auth.conf:

# allow nodes to retrieve their own catalog (ie their configuration)
path ~ ^/catalog/([^/]+)$
method find
allow $1

Add the following line under 'allow $1': (Remember that I'm using the
certname of macs.puppetlabs.vm - you would substitute the certname you will
use in your infrastructure)

   - allow macs.puppetlabs.vm


5.  Now, we need to modify /etc/puppetlabs/puppet/puppet.conf on the NODES
themselves.  There are two changes that need to be made: the certname and
the nodename.  Remember that we need to decouple the name that SSL uses to
identify the node (macs.puppetlabs.vm) with the name that PUPPET uses to
CLASSIFY the node (node1.puppetlabs.vm and 

[Puppet Users] Re: Need puppet module for condition copy

2012-04-12 Thread Sans
w.r.t ${file}, what I meant is you can make it "super dynamic" with
filenames, if you had to copy different files, as opposed to "a
single" file. This is a perfectly working example (change the values/
parameter as required):



# /etc/puppet/modules//manifests/test.pp
--
class d_services::test {

define opt_dir($path) {

exec { "copy_${path}":
path=> [ '/bin', '/usr/bin' ],
command => "cp /tmp/yum.conf.security /opt/${path}",
onlyif  => "test -d /opt/${path}",
}
}
}


# /etc/puppet/modules//manifests/init.pp
---
class mod_test {

include d_services::test
d_services::test::opt_dir {

'test_1':
path => 'test1';

'test_2':
path => 'test2';

'test_3':
path => 'test3';

}
}
---


It will copy "/tmp/yum.conf.security" to "/opt/test{1|2|3}", if
available.
Hope this helps. Cheers!!




On Apr 12, 4:17 pm, Munna S <19.mu...@gmail.com> wrote:
> I am bit confused about /var/staging/${file} . Let me explain again my
> requirement.
>
> we have 3 version of jboss running on multiple servers.
>
> I need a puppet module to copy a jboss config file to different location
> based on path condition check . Below is my requirement
>
> if /opt/path1 found on the server  then copy file1 or 2
> if /opt/path2 found on the server then copy file1 or 2
> if /opt/path3 found on the server then copy file1 or 2
>
> if none of the above path found then dont copy any file
>

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

2012-04-12 Thread Dan White
Have you seen SecState ?

https://fedorahosted.org/secstate/

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

- Kiki  wrote:
> Hi
> 
> Does Puppet support SCAP? If yes, how do you use it? If no, have you
> thought about it? Is it possible? Have you dismissed the idea
> completely? If it does support SCAP or will in the future, will the
> operating system be a factor, i.e. will it support both Linux and
> Windows?
> 
> Thank you
> Kiki
> 
> -- 
> 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] Abridged summary of puppet-users@googlegroups.com - 44 Messages in 16 Topics

2012-04-12 Thread Dave Soucy


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

2012-04-12 Thread Kiki
Hi

Does Puppet support SCAP? If yes, how do you use it? If no, have you
thought about it? Is it possible? Have you dismissed the idea
completely? If it does support SCAP or will in the future, will the
operating system be a factor, i.e. will it support both Linux and
Windows?

Thank you
Kiki

-- 
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] Re: Need puppet module for condition copy

2012-04-12 Thread Munna S
I am bit confused about /var/staging/${file} . Let me explain again my
requirement.

we have 3 version of jboss running on multiple servers.

I need a puppet module to copy a jboss config file to different location
based on path condition check . Below is my requirement

if /opt/path1 found on the server  then copy file1 or 2
if /opt/path2 found on the server then copy file1 or 2
if /opt/path3 found on the server then copy file1 or 2

if none of the above path found then dont copy any file
On Thu, Apr 12, 2012 at 10:10 AM, Sans  wrote:

> You mean, doing this:
>
>define opt_dir($fl_name, $path) {
>
> instead of this?
>
>define opt_dir($file, $path) {
>
>
>
> On Apr 12, 4:04 pm, Brian Gallew  wrote:
> > You can't put a file{} resource inside an exec{} resource.
>
> --
> 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: Need puppet module for condition copy

2012-04-12 Thread Sans
You mean, doing this:

define opt_dir($fl_name, $path) {

instead of this?

define opt_dir($file, $path) {



On Apr 12, 4:04 pm, Brian Gallew  wrote:
> You can't put a file{} resource inside an exec{} resource.

-- 
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] Re: Need puppet module for condition copy

2012-04-12 Thread Brian Gallew
You can't put a file{} resource inside an exec{} resource.


On Thu, Apr 12, 2012 at 7:53 AM, Munna S <19.mu...@gmail.com> wrote:

> Hi Brian,
>
> below is my updated init.pp file. but i am getting the error as
>
> Apr 12 14:49:51 pil-vm-pup-01 puppet-master[14586]:
> (//vm-jeeva2.aircell.prod/Puppet) Could not retrieve catalog from remote
> server: Error 400 on SERVER: Could not find class dev_jboss_jeeva for
> vm-jeeva2.aircell.prod at /etc/puppet/manifests/nodes/jeeva_base.pp:2 on
> node vm-jeeva2.aircell.prod
> Apr 12 14:49:51 pil-vm-pup-01 puppet-master[14586]:
> (//vm-jeeva2.aircell.prod/Puppet) Using cached catalog
> Apr 12 14:49:51 pil-vm-pup-01 puppet-master[14586]:
> (//vm-jeeva2.aircell.prod/Puppet) Could not retrieve catalog; skipping run
> my init.pp file
>
> class dev_jboss_jeeva {
> exec {
> onlyif => "test -d /opt/xyz"
>
> file { "/opt/xyz/file.txt":
> owner => "jboss",
> group => "jboss",
> source => "puppet://$puppetserver/modules/module_name/opt/xyz/file.txt",
> }
> }
> }
>
> Thanks,
> Jeeva
> On Thu, Apr 12, 2012 at 9:24 AM, Brian Gallew  wrote:
>
>> Another alternative is to unconditionally copy the file to a staging
>> director (e.g. /var/staging) and then have
>>
>> exec {
>>   "conditional copy to path1":
>> onlyif => "test -d /opt/path1"
>> command => "rsync -a /var/staging/file.txt /opt/path1";
>>   "conditional copy to path2":
>> onlyif => "test -d /opt/path2"
>> command => "rsync -a /var/staging/file.txt /opt/path2";
>>   "conditional copy to path3":
>> onlyif => "test -d /opt/path3"
>> command => "rsync -a /var/staging/file.txt /opt/path3";
>> }
>>
>> For neatness' sake, you could turn that into a define{}
>>
>> On Thu, Apr 12, 2012 at 7:18 AM, Munna S <19.mu...@gmail.com> wrote:
>>
>>> Hi  Gary,
>>>
>>> I created a custom fact path_to_check.rb and placed it under
>>> .../module_name/lib/facter
>>>
>>> below is my init.pp file
>>>
>>> class class_name
>>> if $path_to_check == present{
>>> file { "/opt/xyz/file.txt":
>>> owner => "jboss",
>>> group => "jboss",
>>> source =>
>>> "puppet://$puppetserver/modules/module_name/opt/xyz/file.txt",
>>>  }
>>> }
>>> }
>>> But  i dont see files are getting pushed
>>> On Sun, Apr 1, 2012 at 11:08 PM, Munna S <19.mu...@gmail.com> wrote:
>>>
 Thank you so much Gary. I will try this

 Thanks,
 Jeeva

 On Sun, Apr 1, 2012 at 11:05 PM, Gary Larizza wrote:

> Jeeva,
>
> Your custom fact would do something like:
>  File.directory?('/path/to/check')  that returns true or false depending 
> on
> whether the directory existed.  Your fact would return a true or false
> value (so if the custom fact were named 'path_to_x' you would do something
> like this in your init.pp
>
> if $path_to_x == 'true' {
>   # Do something here
> } else {
>   # Do something else here
> }
>
> Do this for every custom fact (corresponding to the paths you want to
> check) in your manifest, or combine them into one giant if statement like:
>
> if ($path_to_x == 'true') or ($path_to_y == 'true') {
>   # Do something
> }
>
> Does this make sense?
>
>
> On Sun, Apr 1, 2012 at 8:48 PM, Munna S <19.mu...@gmail.com> wrote:
>
>> Hi Gary,
>>
>> How i can put this in my init.pp file. Actually i am checking for the
>> path. if path found then copy the file else dont create any file/folder. 
>> So
>> here i need to check for 3 different path on each server. if any of the
>> below path exist then copy the file.
>>
>> Thanks,
>> Jeeva
>>
>> On Sun, Apr 1, 2012 at 10:41 PM, Gary Larizza wrote:
>>
>>> Jeeva,
>>>
>>>
>>> I would make a custom fact (
>>> http://docs.puppetlabs.com/guides/custom_facts.html) that checks
>>> for the presence of these files.  Your Puppet manifest would check the
>>> condition of this fact to ensure the file absent or present (i.e. if
>>> $custom_fact { file { '/path/to/file': ensure => file } } ).
>>>
>>>
>>> Does that make sense?
>>>
>>>
>>>
>>> On Sun, Apr 1, 2012 at 8:37 PM, Munna S <19.mu...@gmail.com> wrote:
>>>
 Team,

 Any help

 Thanks,
 Jeeva

 On Fri, Mar 30, 2012 at 12:51 PM, Munna S <19.mu...@gmail.com>wrote:

> Team,
>
> I need a puppet module to copy a file to different location based
> on condition check . Below is my requirement
>
> if /opt/path1 found on the server  then copy file1
> if /opt/path2 found on the server then copy file1
> if /opt/path3 found on the server then copy file1
>
> if none of the above path found then dont copy file1
>
> Thanks,
> Jeeva
>>>

[Puppet Users] Re: [Puppet-dev] Taking github noise away from puppet-dev list

2012-04-12 Thread James Turnbull
> * no close e-mail
> * more readable inlined patches (syntax coloring?, broken in different
> e-mails per commit?)
> * send back to the thread on this list the internal discussion happening
> on github

I agree with Brice. The only way to bring the conversation back here is
not to segment/split the conversation...

James


-- 
James Turnbull
Puppet Labs
1-503-734-8571
To schedule a meeting with me: http://tungle.me/jamtur01

-- 
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: Puppet Certificate's

2012-04-12 Thread Sean McGrath
Gary,

Thanks very much for getting back to me on this. While I have been
researching Puppet for our Mac fleet I have used a lot of the very
useful information you have published about this so thank you very
much for that.

In regards your response. Firstly, apologies for my lack of knowledge
in this matter and any help that can be provided will be very much
appreciated.

I am interested in #3 and am having looking at it now but the
following are some of the things that have crossed my mind

The private cert to distribute to the client nodes, which one from the
master is it? There are a few there and I cannot tell which one it is
and where does it go on the client?

Is there any other configuration that is needed on the master?

In the clients /etc/puppet/puppet.conf file would the following
configuration be correct for this approach.

[puppetd]
node_name_fact = hostname
node_name_value = certname # i.e. the one from the server

Is this correct?

Thats it for now, I'm going to stay playing around with this and see
where I can get but any help and guidance that anyone can provide will
be very much appreciated.

Regards

Sean

On Apr 11, 5:32 pm, Gary Larizza  wrote:
> 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#noden...
> 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 wrote:
>
>
>
>
>
>
>
>
>
> > 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] Re: Need puppet module for condition copy

2012-04-12 Thread Sans
As Brian suggested, using define{} is the better way of doing it; you
can even copy different files to different directories, if required.
Something like this:


# /etc/puppet/modules//manifests/staging.pp
--
class ur_module::staging {

define opt_dir($file, $path) {

exec { "copy_${dir}":
path=> [ '/bin', '/usr/bin' ],
command => "rsync -a /var/staging/${file} /opt/${path}",
onlyif  => "test -d /opt/${path}",
}
}
---


and, then in the init.pp:


# /etc/puppet/modules//manifests/init.pp
---
class file_copy {

include ur_module::staging

ur_module::staging::opt_dir {

'path_1':
file => 'file.txt',
path => 'path1';

'path_2':
file => 'another_file.txt',
path => 'path2';

.
... keep carrying on ...
}
}
---


That should do that job. Cheers!!




On Apr 12, 3:24 pm, Brian Gallew  wrote:
> Another alternative is to unconditionally copy the file to a staging
> director (e.g. /var/staging) and then have
>
> exec {
>   "conditional copy to path1":
>     onlyif => "test -d /opt/path1"
>     command => "rsync -a /var/staging/file.txt /opt/path1";
>   "conditional copy to path2":
>     onlyif => "test -d /opt/path2"
>     command => "rsync -a /var/staging/file.txt /opt/path2";
>   "conditional copy to path3":
>     onlyif => "test -d /opt/path3"
>     command => "rsync -a /var/staging/file.txt /opt/path3";
>
> }
>
> For neatness' sake, you could turn that into a define{}

-- 
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-12 Thread David Alden
Hi,

On Apr 11, 2012, at 7:38 PM, Jason Antman wrote:
> 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.

Yup - that did it.  Time to modify my check-puppet script to do the echo.  :-)

...thnx,
...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] Re: Need puppet module for condition copy

2012-04-12 Thread Munna S
Hi Brian,

below is my updated init.pp file. but i am getting the error as

Apr 12 14:49:51 pil-vm-pup-01 puppet-master[14586]:
(//vm-jeeva2.aircell.prod/Puppet) Could not retrieve catalog from remote
server: Error 400 on SERVER: Could not find class dev_jboss_jeeva for
vm-jeeva2.aircell.prod at /etc/puppet/manifests/nodes/jeeva_base.pp:2 on
node vm-jeeva2.aircell.prod
Apr 12 14:49:51 pil-vm-pup-01 puppet-master[14586]:
(//vm-jeeva2.aircell.prod/Puppet) Using cached catalog
Apr 12 14:49:51 pil-vm-pup-01 puppet-master[14586]:
(//vm-jeeva2.aircell.prod/Puppet) Could not retrieve catalog; skipping run
my init.pp file

class dev_jboss_jeeva {
exec {
onlyif => "test -d /opt/xyz"
file { "/opt/xyz/file.txt":
owner => "jboss",
group => "jboss",
source => "puppet://$puppetserver/modules/module_name/opt/xyz/file.txt",
}
}
}

Thanks,
Jeeva
On Thu, Apr 12, 2012 at 9:24 AM, Brian Gallew  wrote:

> Another alternative is to unconditionally copy the file to a staging
> director (e.g. /var/staging) and then have
>
> exec {
>   "conditional copy to path1":
> onlyif => "test -d /opt/path1"
> command => "rsync -a /var/staging/file.txt /opt/path1";
>   "conditional copy to path2":
> onlyif => "test -d /opt/path2"
> command => "rsync -a /var/staging/file.txt /opt/path2";
>   "conditional copy to path3":
> onlyif => "test -d /opt/path3"
> command => "rsync -a /var/staging/file.txt /opt/path3";
> }
>
> For neatness' sake, you could turn that into a define{}
>
> On Thu, Apr 12, 2012 at 7:18 AM, Munna S <19.mu...@gmail.com> wrote:
>
>> Hi  Gary,
>>
>> I created a custom fact path_to_check.rb and placed it under
>> .../module_name/lib/facter
>>
>> below is my init.pp file
>>
>> class class_name
>> if $path_to_check == present{
>> file { "/opt/xyz/file.txt":
>> owner => "jboss",
>> group => "jboss",
>> source =>
>> "puppet://$puppetserver/modules/module_name/opt/xyz/file.txt",
>>  }
>> }
>> }
>> But  i dont see files are getting pushed
>> On Sun, Apr 1, 2012 at 11:08 PM, Munna S <19.mu...@gmail.com> wrote:
>>
>>> Thank you so much Gary. I will try this
>>>
>>> Thanks,
>>> Jeeva
>>>
>>> On Sun, Apr 1, 2012 at 11:05 PM, Gary Larizza wrote:
>>>
 Jeeva,

 Your custom fact would do something like:
  File.directory?('/path/to/check')  that returns true or false depending on
 whether the directory existed.  Your fact would return a true or false
 value (so if the custom fact were named 'path_to_x' you would do something
 like this in your init.pp

 if $path_to_x == 'true' {
   # Do something here
 } else {
   # Do something else here
 }

 Do this for every custom fact (corresponding to the paths you want to
 check) in your manifest, or combine them into one giant if statement like:

 if ($path_to_x == 'true') or ($path_to_y == 'true') {
   # Do something
 }

 Does this make sense?


 On Sun, Apr 1, 2012 at 8:48 PM, Munna S <19.mu...@gmail.com> wrote:

> Hi Gary,
>
> How i can put this in my init.pp file. Actually i am checking for the
> path. if path found then copy the file else dont create any file/folder. 
> So
> here i need to check for 3 different path on each server. if any of the
> below path exist then copy the file.
>
> Thanks,
> Jeeva
>
> On Sun, Apr 1, 2012 at 10:41 PM, Gary Larizza wrote:
>
>> Jeeva,
>>
>>
>> I would make a custom fact (
>> http://docs.puppetlabs.com/guides/custom_facts.html) that checks for
>> the presence of these files.  Your Puppet manifest would check the
>> condition of this fact to ensure the file absent or present (i.e. if
>> $custom_fact { file { '/path/to/file': ensure => file } } ).
>>
>>
>> Does that make sense?
>>
>>
>>
>> On Sun, Apr 1, 2012 at 8:37 PM, Munna S <19.mu...@gmail.com> wrote:
>>
>>> Team,
>>>
>>> Any help
>>>
>>> Thanks,
>>> Jeeva
>>>
>>> On Fri, Mar 30, 2012 at 12:51 PM, Munna S <19.mu...@gmail.com>wrote:
>>>
 Team,

 I need a puppet module to copy a file to different location based
 on condition check . Below is my requirement

 if /opt/path1 found on the server  then copy file1
 if /opt/path2 found on the server then copy file1
 if /opt/path3 found on the server then copy file1

 if none of the above path found then dont copy file1

 Thanks,
 Jeeva


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

[Puppet Users] Re: Puppet Certificate's

2012-04-12 Thread Allister Banks
Hey there,

I've got fire in ma belly to get this solved, as I'm impatient to use
Puppet's CA to bootstrap Simian, but due to this same sticking point
the bootstrapping process is more ungainly then it should be. My point
is we customize things about each machine while naming and binding,
why can't cert distribution (preceded by generation if necessary) be
part of that step in the process? Then it's a (debatably) more secure
and simple process, in my opinion.

Pardon I haven't looked in to puppet cert yet(it allows me to generate
certs for clients in advance based on supplied info/UUID's/serial
numbers, etc?), and I also need to figure out how generic I can make
the puppet install/config in the deployed image so only this cert
needs to be a custom addition.

My proposal is scripting DeployStudio to add a filedrop (or similar)
workflow to seed the right cert on the imaged system. I'll report back
as soon as I have a proof-of-concept.

Allister

On Apr 11, 11:31 am, Sean McGrath  wrote:
> 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] Re: Need puppet module for condition copy

2012-04-12 Thread Brian Gallew
Another alternative is to unconditionally copy the file to a staging
director (e.g. /var/staging) and then have

exec {
  "conditional copy to path1":
onlyif => "test -d /opt/path1"
command => "rsync -a /var/staging/file.txt /opt/path1";
  "conditional copy to path2":
onlyif => "test -d /opt/path2"
command => "rsync -a /var/staging/file.txt /opt/path2";
  "conditional copy to path3":
onlyif => "test -d /opt/path3"
command => "rsync -a /var/staging/file.txt /opt/path3";
}

For neatness' sake, you could turn that into a define{}

On Thu, Apr 12, 2012 at 7:18 AM, Munna S <19.mu...@gmail.com> wrote:

> Hi  Gary,
>
> I created a custom fact path_to_check.rb and placed it under
> .../module_name/lib/facter
>
> below is my init.pp file
>
> class class_name
> if $path_to_check == present{
> file { "/opt/xyz/file.txt":
> owner => "jboss",
> group => "jboss",
> source =>
> "puppet://$puppetserver/modules/module_name/opt/xyz/file.txt",
>  }
> }
> }
> But  i dont see files are getting pushed
> On Sun, Apr 1, 2012 at 11:08 PM, Munna S <19.mu...@gmail.com> wrote:
>
>> Thank you so much Gary. I will try this
>>
>> Thanks,
>> Jeeva
>>
>> On Sun, Apr 1, 2012 at 11:05 PM, Gary Larizza wrote:
>>
>>> Jeeva,
>>>
>>> Your custom fact would do something like:
>>>  File.directory?('/path/to/check')  that returns true or false depending on
>>> whether the directory existed.  Your fact would return a true or false
>>> value (so if the custom fact were named 'path_to_x' you would do something
>>> like this in your init.pp
>>>
>>> if $path_to_x == 'true' {
>>>   # Do something here
>>> } else {
>>>   # Do something else here
>>> }
>>>
>>> Do this for every custom fact (corresponding to the paths you want to
>>> check) in your manifest, or combine them into one giant if statement like:
>>>
>>> if ($path_to_x == 'true') or ($path_to_y == 'true') {
>>>   # Do something
>>> }
>>>
>>> Does this make sense?
>>>
>>>
>>> On Sun, Apr 1, 2012 at 8:48 PM, Munna S <19.mu...@gmail.com> wrote:
>>>
 Hi Gary,

 How i can put this in my init.pp file. Actually i am checking for the
 path. if path found then copy the file else dont create any file/folder. So
 here i need to check for 3 different path on each server. if any of the
 below path exist then copy the file.

 Thanks,
 Jeeva

 On Sun, Apr 1, 2012 at 10:41 PM, Gary Larizza wrote:

> Jeeva,
>
>
> I would make a custom fact (
> http://docs.puppetlabs.com/guides/custom_facts.html) that checks for
> the presence of these files.  Your Puppet manifest would check the
> condition of this fact to ensure the file absent or present (i.e. if
> $custom_fact { file { '/path/to/file': ensure => file } } ).
>
>
> Does that make sense?
>
>
>
> On Sun, Apr 1, 2012 at 8:37 PM, Munna S <19.mu...@gmail.com> wrote:
>
>> Team,
>>
>> Any help
>>
>> Thanks,
>> Jeeva
>>
>> On Fri, Mar 30, 2012 at 12:51 PM, Munna S <19.mu...@gmail.com> wrote:
>>
>>> Team,
>>>
>>> I need a puppet module to copy a file to different location based on
>>> condition check . Below is my requirement
>>>
>>> if /opt/path1 found on the server  then copy file1
>>> if /opt/path2 found on the server then copy file1
>>> if /opt/path3 found on the server then copy file1
>>>
>>> if none of the above path found then dont copy file1
>>>
>>> Thanks,
>>> Jeeva
>>>
>>>
>>
>>  --
>> 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.
>

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

AW: [Puppet Users] Re: Error 400 on SERVER: Duplicate definition

2012-04-12 Thread Bernd Adamowicz
No problem. You're wellcome! And you're not silly. It's just a common pitfall. 
If you define a resource within a function, this resource will be re-defined 
with every function call. And since resources have to be unique, the second 
call to the function will lead to a duplicate definition.

So that's expected behavior. The only thing that could be improved is the error 
message which does not lead to the real problem. Maybe the Puppet guys could 
work on this in the future ;-)

Cheers Bernd

> -Ursprüngliche Nachricht-
> Von: puppet-users@googlegroups.com [mailto:puppet-
> us...@googlegroups.com] Im Auftrag von Sans
> Gesendet: Donnerstag, 12. April 2012 16:11
> An: Puppet Users
> Betreff: [Puppet Users] Re: Error 400 on SERVER: Duplicate definition
> 
> WOW!! that was real fast (I feel myself so silly now!!). Thanks a lot.
> But do you mind explaining why I was getting errors in the first place?
> If I do that 'static way', like this:
> 
> 
> # /etc/puppet/modules/d_services/manifests/init.pp:
> ---
> class voms_cert {
> 
> $voms_dir = '/etc/grid-security/vomsdir'
> exec { 'chk_vomsdir':
> path=> [ '/bin', '/usr/bin' ],
> command => "test -d ${voms_dir}",
> }
> 
> file {
> 'camont':
> name=> "${voms_dir}/camont/voms.gridpp.ac.uk.lsc",
> mode=> '0644', owner => 'root', group => 'root',
> source  => "puppet:///modules/d_services/vomsdir/
> voms.gridpp.ac.uk.lsc",
> require => Exec[ 'chk_vomsdir' ];
> 
> 'atls':
> name=> "${voms_dir}/atlas/voms.cern.ch.lsc",
> mode=> '0644', owner => 'root', group => 'root',
> source  => "puppet:///modules/d_services/vomsdir/
> voms.cern.ch.lsc",
> require => Exec[ 'chk_vomsdir' ];
> }
> }
> ---
> 
> I don't get any error at all.
> 
> Cheers,
> San
> 
> 
> On Apr 12, 2:55 pm, Bernd Adamowicz 
> wrote:
> > Try to change
> >
> > * exec { 'chk_vomsdir':
> >
> > to something like
> >
> > * exec { "chk_vomsdir_${dir}":
> >
> > and
> >
> > * require => Exec[ 'chk_vomsdir' ];
> >
> > to
> >
> > * require => Exec["chk_vomsdir_${dir}"];
> >
> > This should make everything unique.
> >
> > Bernd
> 
> --
> 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] Re: Creating classes for individual nodes

2012-04-12 Thread Brian Gallew
I'm absolutely with John on this.  As an example, for our JBoss application
we need the configuration file to be different based on the the hostname
(we only host one app per host/VM) and environment
(dev/integration/qa/staging/production).  Further, some "dev" boxes need to
allow the developers to hand-update their configs.  So what I have is a
templated configuration file that has all the configuration information in
it for all the environments, and only the pertinent information gets
shipped to the Puppet client.  Further, I wrap this in a define{} so that
the file Puppet actually manages is "server.properties-default".  There is
an exec{} in the define which checks for a "server.properties-noupdate"
file.  If that file exists, the exec{} bails.  If it doesn't, then it
rsync's the -default file onto the "server.properties" file that JBoss
references.  Finally, the define{} also creates a
"server.properties-README" which tells the developer about how the file is
managed and what they can do if they want to override Puppet.


On Wed, Apr 11, 2012 at 1:52 PM, jcbollinger wrote:

>
>
> On Apr 11, 12:04 pm, Josh  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.
>
>

-- 
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] Re: Need puppet module for condition copy

2012-04-12 Thread Munna S
Hi  Gary,

I created a custom fact path_to_check.rb and placed it under
.../module_name/lib/facter

below is my init.pp file

class class_name
if $path_to_check == present{
file { "/opt/xyz/file.txt":
owner => "jboss",
group => "jboss",
source =>
"puppet://$puppetserver/modules/module_name/opt/xyz/file.txt",
 }
}
}
But  i dont see files are getting pushed
On Sun, Apr 1, 2012 at 11:08 PM, Munna S <19.mu...@gmail.com> wrote:

> Thank you so much Gary. I will try this
>
> Thanks,
> Jeeva
>
> On Sun, Apr 1, 2012 at 11:05 PM, Gary Larizza  wrote:
>
>> Jeeva,
>>
>> Your custom fact would do something like:
>>  File.directory?('/path/to/check')  that returns true or false depending on
>> whether the directory existed.  Your fact would return a true or false
>> value (so if the custom fact were named 'path_to_x' you would do something
>> like this in your init.pp
>>
>> if $path_to_x == 'true' {
>>   # Do something here
>> } else {
>>   # Do something else here
>> }
>>
>> Do this for every custom fact (corresponding to the paths you want to
>> check) in your manifest, or combine them into one giant if statement like:
>>
>> if ($path_to_x == 'true') or ($path_to_y == 'true') {
>>   # Do something
>> }
>>
>> Does this make sense?
>>
>>
>> On Sun, Apr 1, 2012 at 8:48 PM, Munna S <19.mu...@gmail.com> wrote:
>>
>>> Hi Gary,
>>>
>>> How i can put this in my init.pp file. Actually i am checking for the
>>> path. if path found then copy the file else dont create any file/folder. So
>>> here i need to check for 3 different path on each server. if any of the
>>> below path exist then copy the file.
>>>
>>> Thanks,
>>> Jeeva
>>>
>>> On Sun, Apr 1, 2012 at 10:41 PM, Gary Larizza wrote:
>>>
 Jeeva,


 I would make a custom fact (
 http://docs.puppetlabs.com/guides/custom_facts.html) that checks for
 the presence of these files.  Your Puppet manifest would check the
 condition of this fact to ensure the file absent or present (i.e. if
 $custom_fact { file { '/path/to/file': ensure => file } } ).


 Does that make sense?



 On Sun, Apr 1, 2012 at 8:37 PM, Munna S <19.mu...@gmail.com> wrote:

> Team,
>
> Any help
>
> Thanks,
> Jeeva
>
> On Fri, Mar 30, 2012 at 12:51 PM, Munna S <19.mu...@gmail.com> wrote:
>
>> Team,
>>
>> I need a puppet module to copy a file to different location based on
>> condition check . Below is my requirement
>>
>> if /opt/path1 found on the server  then copy file1
>> if /opt/path2 found on the server then copy file1
>> if /opt/path3 found on the server then copy file1
>>
>> if none of the above path found then dont copy file1
>>
>> Thanks,
>> Jeeva
>>
>>
>
>  --
> 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.

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

-- 
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] GitHub -> PuppetForge

2012-04-12 Thread Ken Barber
(I don't have a direct tool - but its an interesting conceptual problem)

You would ordinarily want an intermediate system for this, either
something custom - or a CI system like Jenkins (and perhaps Travis CI
does this as well) where you would put your 'publish' logic.

The problem of course, being - when do you push? Ordinarily this would
only occur with a new tag (and only if the tag is valid) ... so as
long as you could capture a tag change perhaps and publish on that you
might be okay. This kind of special handling might need something
custom - but looks like Github supports HTTP POST requests, so you
could right something yourself.

Of course - you need to have a way of falling back to a poll type of
system, or some manual method ... as notifies aren't perfect. If your
receiver is down, or if github doesn't send the notify for some reason
then you need a fallback. Jenkins CI can poll, but again - you really
need a system that supports 'publishing on tag' not publishing on
every change :-).

ken.

On Thu, Apr 12, 2012 at 3:56 PM, Dennis Hoppe
 wrote:
> Hello,
>
> i am managing my Puppet modules with GitHub and today i discovered the
> GitHub Service Hooks. Does anybody know if it is possible to use a
> GitHub Service Hook to push the lates *.tar.gz into PuppetForge?
>
> Regards, Dennis
>

-- 
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: Error 400 on SERVER: Duplicate definition

2012-04-12 Thread Sans
WOW!! that was real fast (I feel myself so silly now!!). Thanks a lot.
But do you mind explaining why I was getting errors in the first
place? If I do that 'static way', like this:


# /etc/puppet/modules/d_services/manifests/init.pp:
---
class voms_cert {

$voms_dir = '/etc/grid-security/vomsdir'
exec { 'chk_vomsdir':
path=> [ '/bin', '/usr/bin' ],
command => "test -d ${voms_dir}",
}

file {
'camont':
name=> "${voms_dir}/camont/voms.gridpp.ac.uk.lsc",
mode=> '0644', owner => 'root', group => 'root',
source  => "puppet:///modules/d_services/vomsdir/
voms.gridpp.ac.uk.lsc",
require => Exec[ 'chk_vomsdir' ];

'atls':
name=> "${voms_dir}/atlas/voms.cern.ch.lsc",
mode=> '0644', owner => 'root', group => 'root',
source  => "puppet:///modules/d_services/vomsdir/
voms.cern.ch.lsc",
require => Exec[ 'chk_vomsdir' ];
}
}
---

I don't get any error at all.

Cheers,
San


On Apr 12, 2:55 pm, Bernd Adamowicz 
wrote:
> Try to change
>
> * exec { 'chk_vomsdir':
>
> to something like
>
> * exec { "chk_vomsdir_${dir}":
>
> and
>
> * require => Exec[ 'chk_vomsdir' ];
>
> to
>
> * require => Exec["chk_vomsdir_${dir}"];
>
> This should make everything unique.
>
> Bernd

-- 
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] Testing a single module

2012-04-12 Thread James Patterson
Hello,

I have a production puppet environment that is working well.

Now more people are developing modules for it we are using a test
environment using environment=test in the puppet.conf file.
This prevents changes to modules in the production environment being
affected by changes in the test environment. So far so good.

By module I mean class, in case it's the wrong class.

1. I need to test a change to a single module on a production server,
without breaking all other production servers.
I could put this single production server into the test environment, but
this has the danger of pulling in changes from other people's modules as
well.
Should I create yet another environment to do this?

2. Can I define certain modules as being taken from another environment,
the "test" environment, for example?

Thanks in advance,

-- 
  James Patterson
  jamespatter...@operamail.com

-- 
http://www.fastmail.fm - Same, same, but different...

-- 
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] GitHub -> PuppetForge

2012-04-12 Thread Dennis Hoppe
Hello,

i am managing my Puppet modules with GitHub and today i discovered the
GitHub Service Hooks. Does anybody know if it is possible to use a
GitHub Service Hook to push the lates *.tar.gz into PuppetForge?

Regards, Dennis



signature.asc
Description: OpenPGP digital signature


AW: [Puppet Users] Error 400 on SERVER: Duplicate definition

2012-04-12 Thread Bernd Adamowicz
Try to change 

* exec { 'chk_vomsdir':

to something like

* exec { "chk_vomsdir_${dir}":

and

* require => Exec[ 'chk_vomsdir' ];

to

* require => Exec["chk_vomsdir_${dir}"];

This should make everything unique.

Bernd

> -Ursprüngliche Nachricht-
> Von: puppet-users@googlegroups.com [mailto:puppet-
> us...@googlegroups.com] Im Auftrag von Sans
> Gesendet: Donnerstag, 12. April 2012 15:50
> An: Puppet Users
> Betreff: [Puppet Users] Error 400 on SERVER: Duplicate definition
> 
> Dear all,
> 
> I'm getting this "Duplicate definition" error but can't make sure
> what's going wrong. I have this definition: voms in the vomscert.pp:
> 
> 
> # /etc/puppet/modules/d_services/manifests/vomscert.pp
> ---
> -
> class d_services::vomscert {
> 
> define voms($dir, $lsc) {
> 
> $voms_dir = '/etc/grid-security/vomsdir'
> exec { 'chk_vomsdir':
> path  => [ '/bin', '/usr/bin' ],
> command => "test -d ${voms_dir}/${dir}",
> }
> 
> file { "${dir}":
> name=> "${voms_dir}/${dir}/${lsc}",
> mode=> '0644', owner => 'root', group => 'root',
> source  => "puppet:///modules/d_services/vomsdir/${lsc}",
> require => Exec[ 'chk_vomsdir' ];
> }
> }
> }
> 
> 
> 
> And then, in this is in the init.pp:
> 
> # /etc/puppet/modules/d_services/manifests/init.pp:
> 
> class voms_cert {
> 
> include d_services::vomscert
> 
> d_services::vomscert::voms {
> 'camont.lsc':
> dir   => 'camont',
> lsc  => 'voms.gridpp.ac.uk.lsc';
> 
> 'atlas.lsc':
> dir   => 'gridpp',
> lsc  => 'voms.cern.ch.lsc';
> }
> }
> 
> 
> 
> On the agent, it fails, reporting:
> 
> err: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Duplicate definition: Exec[chk_vomsdir] is already defined in
> file /etc/puppet/modules/d_services/manifests/vomscert.pp at line 11;
> cannot redefine at /etc/puppet/modules/d_services/manifests/
> vomscert.pp:11
> 
> Any idea what am I missing?
> 
> Cheers,
> San
> 
> --
> 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] Error 400 on SERVER: Duplicate definition

2012-04-12 Thread Sans
Dear all,

I'm getting this "Duplicate definition" error but can't make sure
what's going wrong. I have this definition: voms in the vomscert.pp:


# /etc/puppet/modules/d_services/manifests/vomscert.pp

class d_services::vomscert {

define voms($dir, $lsc) {

$voms_dir = '/etc/grid-security/vomsdir'
exec { 'chk_vomsdir':
path  => [ '/bin', '/usr/bin' ],
command => "test -d ${voms_dir}/${dir}",
}

file { "${dir}":
name=> "${voms_dir}/${dir}/${lsc}",
mode=> '0644', owner => 'root', group => 'root',
source  => "puppet:///modules/d_services/vomsdir/${lsc}",
require => Exec[ 'chk_vomsdir' ];
}
}
}



And then, in this is in the init.pp:

# /etc/puppet/modules/d_services/manifests/init.pp:

class voms_cert {

include d_services::vomscert

d_services::vomscert::voms {
'camont.lsc':
dir   => 'camont',
lsc  => 'voms.gridpp.ac.uk.lsc';

'atlas.lsc':
dir   => 'gridpp',
lsc  => 'voms.cern.ch.lsc';
}
}



On the agent, it fails, reporting:

err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Duplicate definition: Exec[chk_vomsdir] is already defined in
file /etc/puppet/modules/d_services/manifests/vomscert.pp at line 11;
cannot redefine at /etc/puppet/modules/d_services/manifests/
vomscert.pp:11

Any idea what am I missing?

Cheers,
San

-- 
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] How to add Ubuntu PPA repository (with signing key)?

2012-04-12 Thread Bob
This is a very old thread, but I am a new puppet user and it still seems 
very relevant.

I am a SuSE user struggling to find  a tidy way of managing repository 
keys, but I think the principles are the same for all distributions.
As far as I can see, both yumrepo and zypprepo are of limited value because 
they don't provide a mechanism to import keys. I suspect most people bottle 
out of this by disabling the GPG checking, and that sounds to me like a bad 
idea.

So I think the way to go is
(1) new type packagerepo to supercede yumrepo and zypprepo
(2) the gpgkey parameter should do something useful, i.e. import the key 
from the puppet server

Then the administrator would install trusted keys on the Puppet server and 
they would be automatically distributed to clients.

I may well be missing something here, so I am happy to be corrected if i am 
wrong

Bob
 
On Tuesday, 8 December 2009 21:02:28 UTC, Julian Simpson wrote:
>
> > I meant implementing a new type like aptrepo there. Actually the best 
> > design decision would be: rename yumrepo as packagerepo, split some of 
> > the code as a provider yumrepo, add new code for a provider aptrepo. But 
> > that isn't easy as pie and it requires ruby knowledge, apt and puppet 
> > internals. This is the elegant, but complex solution. Now I'm 
> balabbering. 
>
> You're not blabbering.  A new type in Puppet seems like the right idea to 
> me. 
>
> J. 
>
> -- 
> Julian Simpson 
> Software Build and Deployment 
> http://www.build-doctor.com 
> http://twitter.com/builddoctor 
>

-- 
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/-/qGmj6SxAicUJ.
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: [Puppet-dev] Taking github noise away from puppet-dev list

2012-04-12 Thread R.I.Pienaar


- Original Message -
> From: "Dean Wilson" 
> To: puppet-...@googlegroups.com
> Cc: puppet-users@googlegroups.com
> Sent: Thursday, April 12, 2012 10:55:45 AM
> Subject: Re: [Puppet-dev] Taking github noise away from puppet-dev list
> 
> On 12 April 2012 08:48, Brice Figureau
>  wrote:
> 
> > Nowadays, I don't even read patches because they're either one
> > click
> > away or difficult to read in the e-mail. Worst: most of the time I
> > open
> > the "close" pull request e-mail by mistake (thinking it is the open
> > one)
> > and struggle to find the real "open" one to read the patch. (I
> > believe
> > we don't need this "close" e-mail, it just adds unnecessary noise).
> > One reason the patches are difficult to read is that all
> > sub-patches are
> > merged in one big chunk, so you're losing the author intent.
> 
> > Maybe nobody feels like me or that's because there are much more
> > patches
> > than there was before, but the dev list was a good way to stay
> > tuned on
> > what happens in the Puppet code. I just feel it isn't now anymore.
> 
> While I still read most of the patches I have to agree with what
> Brice
> has eloquently said throughout his mail. I think it has become harder
> to casually keep up as an interested observer and requires a bigger
> time investment than it used to, and that's not just because of the
> increased development output.
> 

What they said.

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

2012-04-12 Thread Javier Segura
On Thu, Apr 12, 2012 at 8:16 AM, niraj  wrote:
> Hi All,
>I am getting the following err while looking up for this command
>
>

You should take a look at http://projects.puppetlabs.com/issues/4847

There are some info about proxy connections.

Regards

-- 
Javier

-- 
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] Unable to access hash elements directly from templates

2012-04-12 Thread Josh
Eventually I worked this out (nothing like trying every possible 
combination eh), solution was to remove the $ at the start as you said and 
also quote the keys in single quotes like so:

TEST: <%= myhash['key']['subkey1'] %>

Thanks again for your help
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/-/QznbDyO5SDAJ.
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-12 Thread Josh
Sorry, that should be:

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

(i.e. it errors on the content => ... line)

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/-/VFGB1obBa8QJ.
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: [Puppet-dev] Taking github noise away from puppet-dev list

2012-04-12 Thread Ken Barber
>> 3.  More forethought and discussion on the dev list prior to making a
>> pull request/patch.
>
> That'd be really great. And I noticed some attempts lately in this
> direction, which is really good.

I've been moving more discussions onto puppet-dev in the last few
weeks, as I've been delving more into Puppet code (where normally I
just potter around facter). But mainly its because I miss these
community discussions - for me since the request volume increased I've
felt puppet-dev was harder to wade through so I probably started to
move discussions to private threads or internal lists instead. So I
think the noise is part of the problem tbh.

Personally I really really want the open discussion back, I'm a remote
employee so I can't have hall-way conversations with devs and my other
colleagues - but the silly dev questions I'm going to ask via email I
think are interesting to other community developers - so having them
open to the world I think benefits all.

ken.

-- 
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] Implementing hooks

2012-04-12 Thread Luke Bigum

Gabriel,

Could you get by with a wrapper? Say, a 'my_nagios' define that does 
it's own thing, then uses the third party 'nagios' definition?


You could add your own resources in your my_nagios that 'Subscribes' to 
resources in the 'nagios' define to insert your own resources into the 
dependency chain.


If you actually need to modify parameters of a resource in a definition 
though then the only way I know of would be to have that parameter 
controlled by an argument to the defined type.


On 12/04/12 07:10, Gabriel Filion wrote:

I'm currently using a "nagios" module that's developed by an opensource
community, and I'd like to hook some logic into a define to implement
some kind of notion that's really specific to the place I work.

For now, I've been obligated to keep a modified version of the module,
but that means I always need to rebase re-arrange my code around
upstream modifications.. and for maintenance, it really adds a bunch of
work.

Do you guys know if it would be possible to implement a way to "hook" my
extraneous logic into the define so that I don't need to modify the
module directly anymore?




--
Luke Bigum

Information Systems
Ph: +44 (0) 20 3192 2520
luke.bi...@lmax.com | http://www.lmax.com
LMAX, Yellow Building, 1A Nicholas Road, London W11 4AN


FX and CFDs are leveraged products that can result in losses exceeding
your deposit.  They are not suitable for everyone so please ensure you
fully understand the risks involved.  The information in this email is not
directed at residents of the United States of America or any other
jurisdiction where trading in CFDs and/or FX is restricted or prohibited
by local laws or regulations.

The information in this email and any attachment is confidential and is
intended only for the named recipient(s). The email may not be disclosed
or used by any person other than the addressee, nor may it be copied in
any way. If you are not the intended recipient please notify the sender
immediately and delete any copies of this message. Any unauthorised
copying, disclosure or distribution of the material in this e-mail is
strictly forbidden.

LMAX operates a multilateral trading facility.  Authorised and regulated 
by the Financial Services Authority (firm registration number 509778) and
is registered in England and Wales (number 06505809). 
Our registered address is Yellow Building, 1A Nicholas Road, London, W11

4AN.

--
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] Unable to access hash elements directly from templates

2012-04-12 Thread Josh
On Wednesday, 11 April 2012 17:14:10 UTC+1, Gary Larizza wrote:
>
> 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] %>
>


Ah, I did try that before. I get 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/config.pp:22 on node 
pc01.domain.com

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/-/pOIGkNnuEo4J.
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: [Puppet-dev] Taking github noise away from puppet-dev list

2012-04-12 Thread Brice Figureau
On Mon, 2012-04-09 at 14:09 -0700, Michael Stahnke wrote:
> Since our move to github for pull requests and patches, the usefulness
> of puppet-dev has declined significantly.  puppet-dev used to be a
> great list for development discussion of puppet and the ecosystem
> around it. With the information and pull request emails from github,
> unless everybody has finely-tuned their email clients, the puppet-dev
> list has turned into mostly noise.

IMHO, that's not the root cause of the problem. Back to the time we were
sending patches to the list, discussion could spark easily on a topic,
based on a comment on a patch.

Nowadays, I don't even read patches because they're either one click
away or difficult to read in the e-mail. Worst: most of the time I open
the "close" pull request e-mail by mistake (thinking it is the open one)
and struggle to find the real "open" one to read the patch. (I believe
we don't need this "close" e-mail, it just adds unnecessary noise).
One reason the patches are difficult to read is that all sub-patches are
merged in one big chunk, so you're losing the author intent.

More generally the move to github certainly increased the development
team velocity (which is good), it might also have increased the
community contributions, but I think it also decreased the community
involvement on the dev list. 

Maybe nobody feels like me or that's because there are much more patches
than there was before, but the dev list was a good way to stay tuned on
what happens in the Puppet code. I just feel it isn't now anymore.
Maybe I'm a dinosaur and I need to follow more carefully what happens on
github :)

Also, a lot of the discussion moved to the pull request in github, so it
disappeared from the dev-list. Now to be part of the discussion, you
need to follow the pull request discussion manually. If you weren't part
of the discussion at start, it now requires more involvement compared to
receiving all discussion in my mail client.

> We have a goal to foster development discussion from the community.
> Because of that, I am proposing we move the github notifications to a
> new list, puppet-commits.  I realize this may have a consequence of
> reducing patch/commit discussion.  This should be compensated by:

Since the move to github commit discussion happened on github, so that's
a non-issue.

> 1.  Still having a list where pull requests can be commented on
> 2.  Ability to comment on pull requests directly on github
> 3.  More forethought and discussion on the dev list prior to making a
> pull request/patch.

That'd be really great. And I noticed some attempts lately in this
direction, which is really good.

> 4.  You can also watch the RSS feed for the puppet projects you have
> the most interest in.

You mean the commit/pull request feed on github, or the redmine feed?

> This decision isn't final, but I would like to get opinions on the
> idea.  I welcome feedback until Friday, April 13.

What would be utterly awesome would be better pull request e-mails flow
on this commit (or on the dev) list:

* no close e-mail
* more readable inlined patches (syntax coloring?, broken in different
e-mails per commit?)
* send back to the thread on this list the internal discussion happening
on github

Thanks,
-- 
Brice Figureau
Follow the latest Puppet Community evolutions on www.planetpuppet.org!

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