Re: [Puppet Users] Style - hiera/params/puppet/template

2014-09-01 Thread Sirtaj Singh Kang


On Monday 01 September 2014 05:39 AM, Atom Powers wrote:
Poli, that doesn't really solve the problem since the variable values 
could still come from many places. (Puppet also does some of that 
lookup automatically, although not as deep.)


Yes, though my primary goal is simply to reduce unnecessary duplication. 
A single added configurable template parameter currently ends up being 
in three places even before bringing in hiera, which is

pretty bad.

This whole thing was brought about by my writing parameterized classes 
for some of our
internal custom services that have dozens of options in their config 
templates, and the manifest file is just

a sea of parameter names.

I think I'm just going to start putting defaults in the class 
declaration param list unless they explicitly

require logic to compute, in which case they'll come from the params.



This may be relevant:
https://github.com/ripienaar/puppet-module-data/


This looks really cool! Thanks for the reference.

-Taj.

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


[Puppet Users] Style - hiera/params/puppet/template

2014-08-30 Thread Sirtaj Singh Kang

Greetings all,

In the pre-hiera days, it was commonly recommended to write classes with 
params like this:


class my_class::params {
$config_param = 'default value'
}

class my_class (
$config_param = $myclass:params::config_param
) inherits myclass::params {
...
}

However, now that much overriding, customising etc has moved into Hiera, 
this ends up being very verbose, redundant and error-prone, especially 
if there are a lot of parameters (to go into a config template, for 
example). The same parameter name may end up in four different places in 
common cases: hiera, params, class decl and the config template.


So I would like to know if people are still doing this as much as 
possible. What is the remaining benefit in declaring defaults in params 
rather than in the class declaration directly? Is there a more up to 
date style guide that does away with the verbosity and duplication, or 
is the old params class style still widely recommended?


Thanks for any suggestions,

-Taj.

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


Re: [Puppet Users] python virtualenv module

2013-11-01 Thread Sirtaj Singh Kang


On 11/2/2013 3:31 AM, Jason Antman wrote:
[snip]

package installation - but the module (or at least our version of it)
doesn't handle requirements files, and uses a define to pip install
packages, so a given package can only be installed in one venv on a node.


I have a hacked-up python virtualenv module, since I hadn't seen any 
when I started out. I got around the singleton define problem you've 
outlined by adding an optional package name parameter, which defaults to 
the name of the define. This way you can keep the old behaviour for 
simple cases:


python::virtualenv::package {
'packagename':
venv = 'destination env'
}

but in the case where you want the same package in two environments, you 
use a globally unique resource name and use the optional param:


python::virtualenv::package {
'env-packagename':
venv = 'destination env',
package_name = 'packagename'
}

When these defines are called internally (as a side effect of installing 
dependencies for an app, for example), I always use the latter format.


That doesn't fix the requirements.txt problem, of course. I've been 
looking at that too, but I don't feel that a pure puppet DSL solution is 
necessarily the right way to approach it. A custom ruby plugin might be 
a better solution.


-Taj.

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


Re: [Puppet Users] autometically create nagios_hostgroup only when a member of a group comes up

2013-02-20 Thread Sirtaj Singh Kang

On 2/20/2013 5:09 PM, Sans wrote:
[snip]

Yes you can (overlooked that point, really) until a service
(nagios_service type) is defined. I think, my actual question would be,
how can I query if a host with certain name (property) is up and only
include that service if the node count is at least one or more.


I use a very bad hack to do this. I have a define that looks like this 
(simplified):


define nagios::server::plugin ($inject_class) {
include $inject_class
}


The nagios server listens for exported resources of this type:

Nagios::Server::Plugin| |


If a class needs to be defined on the nagios server by a node, it simply
calls

@@nagios::server::plugin { ...:
inject_class = some plugin class
}

and the server will pick it up and realize it. As long as the plugin is 
a class and not a define (and requires no params), there will be no harm 
with multiple nodes broadcasting the same plugin; it will still be 
realized only once.


-Taj.

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




Re: [Puppet Users] Installation from the scratch

2013-02-19 Thread Sirtaj Singh Kang

On 2/19/2013 3:39 PM, Calero wrote:
[snip]


Warning: SSL_connect returned=1 errno=0 state=SSLv3 read server
certificate B: certificate verify failed: [certificate signature failure
for /CN=puppetmaster.domain.name]


Are you using passenger? If so, check whether the SSL cert+key files in 
the webserver host config are the same as the ones expected by puppet. I 
had a similar problem when I bootstrapped a puppet master without 
running the puppetmaster directly (without passenger) first to generate 
the correct certificates.


Just something to check.

-Taj.

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




Re: [Puppet Users] Re: Virtual resources and hashes

2011-06-09 Thread Sirtaj Singh Kang


On 08-Jun-11, at 9:31 PM, Brian Gallew wrote:
[snip]


See, there's the crux of the issue: arrays are *not* a method of  
looping.  Puppet's DSL is declarative, not procedural (imperative).


This isn't precisely true - every pure functional language I've seen  
has some sort of list map and filter, otherwise nothing useful could  
get done.


IMHO there is a mismatch somewhere between the actual domain and the  
DSL, but it's hard to identify precisely what it is.


-Taj.

--
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: Virtual resources and hashes

2011-06-09 Thread Sirtaj Singh Kang


(apologies for the derail)

On 09-Jun-11, at 7:51 PM, jcbollinger wrote:
[snip]

On Jun 9, 1:33 am, Sirtaj Singh Kang sirtaj.k...@gmail.com wrote:

On 08-Jun-11, at 9:31 PM, Brian Gallew wrote:
[snip]

See, there's the crux of the issue: arrays are *not* a method of
looping.  Puppet's DSL is declarative, not procedural (imperative).


This isn't precisely true - every pure functional language I've seen
has some sort of list map and filter, otherwise nothing useful could
get done.



What do functional languages have to do with it?  Puppet is not a
functional language either.


Pure functional languages are the first class of pure declarative  
languages that came to my mind. Perhaps a better example would have  
been RDF or Prolog.



XML doesn't have a looping construct either, and its productive uses
are legion.


I don't see the language as similar to XML, since few people like to  
write XML by hand.



I can't rule out so vague an assertion, but Puppet DSL's domain model
and overall architecture have always seemed on target to me.


Fair enough, I agree it was a nebulous statement. I see a shortcoming  
in dealing with parameterized collections of resources, but I am  
having trouble articulating what a better system would look like.


-Taj.

--
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] High CPU usage puppet 2.6.6

2011-06-03 Thread Sirtaj Singh Kang


On 31-May-11, at 10:33 PM, Marek Dohojda wrote:


Hi

I recently upgrade my puppet from .25 to 2.6.6.  The actual upgrade  
process was trivial, but now I am seeing issues.  Puppetmaster is  
running at very high CPU usage.  Prior to the upgrade my load  
average was at around 2 ( this server is doing more stuff than just  
puppet ), but now I am hitting 12!!!


Is there a known issue with this puppet version that I haven't seen?


Perhaps you are running into this problem - 
http://projects.puppetlabs.com/issues/4487

-Taj.

--
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] Client vs server storeconfigs

2011-06-03 Thread Sirtaj Singh Kang

Hi all,

As I understand it, storeconfigs needs to be enabled on both the agent  
and the master to function ideally. I have a couple of questions:


- Can the various agents and the master safely share the same  
storeconfigs db (say, a postgresql server)? Is there any benefit to  
setting things up

this way?

- Is there any benefit for an _agent_ to use an RDBMS vs sqlite for  
its storeconfigs, since there is no db contention problem on an agent?


Thanks for any guidance,

-Taj.

--
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] Client vs server storeconfigs

2011-06-03 Thread Sirtaj Singh Kang

Thanks for the reply Ohad,

On 04-Jun-11, at 9:43 AM, Ohad Levy wrote:
[snip]

the database exists only on the server side


Okay. I am seeing /var/lib/puppet/state/clientconfigs.sqlite3 even on  
machines running only the agent. I have


[main]
...
storeconfigs = true
thin_storeconfigs = true
dbadapter = sqlite3

on all machines, with the master overriding with dbadapter = postgresql.

Is the clientconfigs.sqlite3 file related to storeconfigs? If so, is  
it simply being created and ignored by the agent?


Apologies if I'm asking silly questions, I'd appreciate a pointer to  
an RTFM, it's possible I have missed something.


-Taj.

--
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] Definitive documentation for define?

2011-05-01 Thread Sirtaj Singh Kang


On 30-Apr-11, at 5:34 PM, Denmat wrote:
[snip]

I guess you would look here:
http://docs.puppetlabs.com/guides/language_guide.html#resource-collections



Thank you! I am both grateful and mortified - not sure how I missed  
that.


-Taj.

--
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] Definitive documentation for define?

2011-04-30 Thread Sirtaj Singh Kang

Hi all,

Is there definitive documentation for using define-based resources?  
I've read lots of third-party docs and blogs, but I can't find  
anything in the official puppet docs website. Apologies if I've missed  
something really basic, but I'd appreciate a pointer.


Thanks,

-Taj.

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