[Puppet Users] Multi-master with SRV records

2015-05-05 Thread Justin Lambert
 

I need to build a new puppet environment and was looking at using SRV 
records for a multi-master setup.  Having a single master and SRV records 
works great, but I haven’t successfully been able to build a second master.

https://docs.puppetlabs.com/guides/scaling_multiple_masters.html#option-4-dns-srv-records
 makes 
it sound like magic, just additional nodes to the record set for 
_x-puppet._tcp.  

Option 1B (
https://docs.puppetlabs.com/guides/scaling_multiple_masters.html#option-1-direct-agent-nodes-to-the-ca-master)
 for 
centralizing the CA is a bit more vague.  Setting the _x-puppet-ca._tcp 
record is easy enough, but do I also need to set the dns_alt_names on the 
certificate to all of the servers that would be added to the _x-puppet._tcp 
record?

I have been trying to find a more detailed tutorial online, but so far have 
been unsuccessful.

Thanks,

jl

-- 
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/4dcf2cea-48fb-4dc3-a2ac-b57e7976e038%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Title on file resources

2014-01-14 Thread Justin Lambert
Thanks for the response Joseph - that does help that you had the same 
situation.  That was the only solution I could think of, I was just hoping 
there was some other way.  I’m going to guess it is something to do with 
scoping of how the catalog is compiled, but I don’t know enough about the 
puppet internals to say that with authority.

On Jan 14, 2014, at 3:33 PM, Joseph Swick  wrote:

> On 01/14/2014 05:12 PM, Justin Lambert wrote:
>> I’m attempting to create a bunch of symlinks based on an array of filenames 
>> but I can’t figure out how to use the title of the resource within the 
>> resource itself.
>> 
>> class app::config {
>>  file { [ 'a.conf', 'b.conf' ]:
>>ensure => 'link',
>>path   => "/etc/app/${name}",
>>target => "/usr/app/${name}
>>  }
>> }
>> $name and $title both equal app::config in this example.  Is what I’m trying 
>> to do possible?
>> 
>> I’m running puppet 3.4.0.
>> 
>> Thanks,
>> Justin
>> 
> 
> It is, but you have to use a define (or at least how I'm doing it uses a
> define), here's an example based on something thing I'm doing:
> 
> common.pp:
> class my_module::common () {
> ...
> 
> my_module::common::my_symlinks { ['file1', 'file2', 'file3']: }
> 
> ...
> }
> 
> common/my_symlinks.pp:
> define my_module::common::my_symlinks: {
>file { "symlink_${name}":
>  ensure  => link,
>  path=> "/some/path/${name}",
>  target  => "/some/other/path/${name}",
>}
> }
> 
> I wasn't the first to figure that out, I think I remember who I got it
> from, but I'm not sure if it's something they came up with or if they
> got it from somewhere else.  Hope that helps.
> 
> -- 
> Joseph Swick 
> Operations Engineer
> Meltwater Group
> 

-- 
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/855CDE79-A6B1-48A2-A7E2-E7A2A21E2BFB%40infiniteviewtech.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Title on file resources

2014-01-14 Thread Justin Lambert
I’m attempting to create a bunch of symlinks based on an array of filenames but 
I can’t figure out how to use the title of the resource within the resource 
itself.

class app::config {
  file { [ 'a.conf', 'b.conf' ]:
ensure => 'link',
path   => "/etc/app/${name}",
target => "/usr/app/${name}
  }
}
$name and $title both equal app::config in this example.  Is what I’m trying to 
do possible?

I’m running puppet 3.4.0.

Thanks,
Justin

-- 
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/8001F027-CAFA-440C-AF44-008153E7599E%40infiniteviewtech.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] PuppetDB "Failed to submit 'replace facts' command"

2013-05-16 Thread Justin Lambert
Thanks for this Ken, I checked the mailing list but not the bug tracker - 
should have done that.

Do you know if there is an anticipated 1.3.1 release for puppetdb?  I haven't 
seen any mention of what the next release is going to be. 

On May 15, 2013, at 7:06 AM, Ken Barber  wrote:

> Justin,
> 
> Take a look at this: http://projects.puppetlabs.com/issues/19884
> 
> My colleague Deepak produced a patch for this problem and it has been
> merged in, but its not yet released. In the meantime you can
> work-around the problem by downgrading to JDK 1.6, which seems to do
> the trick.
> 
> ken.
> 
> On Tue, May 14, 2013 at 11:55 PM, Justin Lambert
>  wrote:
>> I have a small environment with a single puppetmaster and puppetdb on the
>> same node that I get sporadic  "Failed to submit 'replace facts' command"
>> errors from nodes.  It isn't consistent about which nodes are causing the
>> error and I can't find anything else going on at the same time on either the
>> master or the agent that these errors happen.
>> 
>> Here are the logs from a previous event
>> 
>> The puppet client log:
>> Retrieving plugin
>> Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
>> Loading facts in /var/lib/puppet/lib/facter/root_home.rb
>> Loading facts in /var/lib/puppet/lib/facter/classes.rb
>> Loading facts in /var/lib/puppet/lib/facter/puppet_enabled.rb
>> Loading facts in /var/lib/puppet/lib/facter/puppetdb_keystore_pw.rb
>> Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
>> Loading facts in /var/lib/puppet/lib/facter/disposition.rb
>> Loading facts in /var/lib/puppet/lib/facter/ec2_security_groups_cached.rb
>> Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
>> Loading facts in /var/lib/puppet/lib/facter/iptables_version.rb
>> Loading facts in /var/lib/puppet/lib/facter/jenkins_plugver.rb
>> Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
>> Loading facts in /var/lib/puppet/lib/facter/ip6tables_version.rb
>> Loading facts in /var/lib/puppet/lib/facter/ec2_instance_id_cached.rb
>> Could not retrieve catalog from remote server: Error 400 on SERVER: Failed
>> to submit 'replace facts' command for ue1a-devweb02.mycompany.com to
>> PuppetDB atpuppet.mycompany.com:8081: SSL_connect SYSCALL returned=5 errno=0
>> state=SSLv3 read finished A
>> Not using cache on failed catalog
>> Could not retrieve catalog; skipping run
>> 
>> The puppet master:
>> May 13 21:46:24 ue1a-util01 puppet-master[28860]: Compiled catalog for
>> ue1a-devweb02.mycompany.com in environment production in 2.36 seconds
>> 
>> PuppetDB:
>> 2013-05-13 21:46:22,424 INFO  [command-proc-46] [puppetdb.command]
>> [e393b600-02c6-4b60-886e-7056516afef7] [replace facts]
>> ue1a-devweb02.mycompany.com
>> 2013-05-13 21:46:31,497 INFO  [command-proc-46] [puppetdb.command]
>> [b6f94e37-6732-44fa-b369-1bc36ed2ef54] [replace catalog]
>> ue1a-devweb02.mycompany.com
>> 
>> 
>> I turned on debug logging for puppetdb and looked through the logs when an
>> event happened and saw this in the logs:
>> 2013-05-14 20:19:19,237 WARN  [qtp874952411-436] [io.nio]
>> javax.net.ssl.SSLHandshakeException: Invalid Padding length: 41
>> 
>> I'm not sure if that's the actual issue or not, but it's what jumped out at
>> me.  Anyone else having this issue or know of what to fix?  I can provide
>> more logs if needed - I'm just not sure what all is relevant out of the
>> puppetdb debug logs.
>> 
>> Puppet 3.1.1, PuppetDB 1.3.0, CentOS 6.4.
>> 
>> Thanks,
>> Justin
>> 
>> --
>> 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.
>> 
>> 
> 
> -- 
> 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.
> 
> 

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




[Puppet Users] PuppetDB "Failed to submit 'replace facts' command"

2013-05-14 Thread Justin Lambert
I have a small environment with a single puppetmaster and puppetdb on the same 
node that I get sporadic  "Failed to submit 'replace facts' command" errors 
from nodes.  It isn't consistent about which nodes are causing the error and I 
can't find anything else going on at the same time on either the master or the 
agent that these errors happen.  

Here are the logs from a previous event

The puppet client log:
Retrieving plugin
Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Loading facts in /var/lib/puppet/lib/facter/classes.rb
Loading facts in /var/lib/puppet/lib/facter/puppet_enabled.rb
Loading facts in /var/lib/puppet/lib/facter/puppetdb_keystore_pw.rb
Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
Loading facts in /var/lib/puppet/lib/facter/disposition.rb
Loading facts in /var/lib/puppet/lib/facter/ec2_security_groups_cached.rb
Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
Loading facts in /var/lib/puppet/lib/facter/iptables_version.rb
Loading facts in /var/lib/puppet/lib/facter/jenkins_plugver.rb
Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Loading facts in /var/lib/puppet/lib/facter/ip6tables_version.rb
Loading facts in /var/lib/puppet/lib/facter/ec2_instance_id_cached.rb
Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to 
submit 'replace facts' command for ue1a-devweb02.mycompany.com to PuppetDB 
atpuppet.mycompany.com:8081: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 
read finished A
Not using cache on failed catalog
Could not retrieve catalog; skipping run

The puppet master:
May 13 21:46:24 ue1a-util01 puppet-master[28860]: Compiled catalog for 
ue1a-devweb02.mycompany.com in environment production in 2.36 seconds

PuppetDB:
2013-05-13 21:46:22,424 INFO  [command-proc-46] [puppetdb.command] 
[e393b600-02c6-4b60-886e-7056516afef7] [replace facts] 
ue1a-devweb02.mycompany.com
2013-05-13 21:46:31,497 INFO  [command-proc-46] [puppetdb.command] 
[b6f94e37-6732-44fa-b369-1bc36ed2ef54] [replace catalog] 
ue1a-devweb02.mycompany.com


I turned on debug logging for puppetdb and looked through the logs when an 
event happened and saw this in the logs:
2013-05-14 20:19:19,237 WARN  [qtp874952411-436] [io.nio] 
javax.net.ssl.SSLHandshakeException: Invalid Padding length: 41

I'm not sure if that's the actual issue or not, but it's what jumped out at me. 
 Anyone else having this issue or know of what to fix?  I can provide more logs 
if needed - I'm just not sure what all is relevant out of the puppetdb debug 
logs.

Puppet 3.1.1, PuppetDB 1.3.0, CentOS 6.4.

Thanks,
Justin

-- 
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] PuppetDB issues

2013-05-09 Thread Justin Lambert
I seem to get this off and on, but not consistently.  Is yours every run?

puppet-master[7020]: Failed to submit 'replace facts' command for 
ue1a-devdb01.ineu.us to PuppetDB at puppet.example.com:8081: SSL_connect 
SYSCALL returned=5 errno=0 state=SSLv3 read finished A

I am also on puppetdb 1.3.0, upgraded from 1.1.


On May 8, 2013, at 8:13 AM, kl.puppetu...@gmail.com wrote:

> Hi all,
> 
> I'm setting up puppetdb to for storing facts et cetera. I installed 
> puppetdb-1.3.0-1.el6.noarch.rpm on my puppetdb.local host (which is 
> puppetized). This seems to work, service starts :).
> 
> When I edit the settings on my puppetmaster (puppet.local), something goes 
> wrong. I am following the guide [1]. I put the settings (storeconfigs = true, 
> storeconfigs_backend=puppetdb) on my puppetmaster and restart the 
> puppetmaster. When I do a --onetime on a node, I get the following error:
> 
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Failed to submit 'replace facts' command for gaia.local
> to PuppetDB at puppetdb.local:8081: SSL_connect SYSCALL returned=5 errno=0 
> state=SSLv3 read finished A
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
> 
> 
> I'm thinking the problem is that I'm using gaia.local as the host name. 
> Puppet.local is an alias for gaia.local.
> 
> 
> Extra info:
> For completeness, the error on the puppetdb is:
> WARN [qtp788652058-42] [io.nio] javax.net.ssl.SSLHandshakeException: null 
> cert chain
> 
> keystore.jks on the puppetdb has puppetdb.local with print 
> 8C:E6:D1:02:89:9E:25:D3:E8:8F:63:75:8F:85:59:B5:17:BE:F8:47
> truststore.jks on puppetdb has 'puppetdb ca' with print 
> 62:8F:76:CE:5C:9D:23:B0:1D:9D:7A:2F:39:5A:74:43:1D:BB:D9:1E
> 
> $ openssl verify -CAfile /etc/puppet/ssl/ca/ca_crt.pem `puppet master 
> --configprint hostcert`
> /etc/puppet/ssl/certs/puppetdb.kahuna.local.pem: OK
> 
> (yes, I have the SSL certs in /etc/puppet)
> 
> If someone could help, that would be great. I'm running in circles here.
> Thanks!
> kl
> 
> [1] http://docs.puppetlabs.com/puppetdb/1.3/connect_puppet_master.html
> 
> -- 
> 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.
>  
>  

-- 
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] Puppet in EC2

2013-03-11 Thread Justin Lambert
I've been using R.I's ec2-boot-init to set the hostname (based of instance ID 
and AZ) and his mcollective-server-provisioner to securely sign certificates.  
Roles are assigned based on what security group the instance is in so I can use 
auto-scaling (with a few exceptions that are hostname based).

On Mar 8, 2013, at 11:41 PM, sylvainkalache  wrote:

> Hello!
> 
> I'm looking for the best way to integrate Puppet with EC2, I read
> posts on that group but they are all old, I wanted to know if things
> have changed since then.
> 
> So far here are the possibilities I found to tight EC2 with Puppet:
> 
> -Use the instance name as reference like  --
>  - http://bit.ly/YitdC3
> -Use the instance security group as reference - http://bit.ly/YitdC3
> -Use the user-data, populate with JSON and parse on the puppet master
> side - http://bit.ly/13MsfGe
> -Use the user-data, but parse on client side with facter - 
> http://bit.ly/XZlVXD
> 
> I don't like to use the name or security as reference at these data
> has not been designed for this.
> I don't like user-data because you can't change them after the
> instance is launched.
> 
> Finally I found all the approach kind of dirty for something which is
> widely used. Are they other possibilities?
> 
> -- 
> 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.
> 
> 

-- 
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] Classes and resources in Hiera

2013-02-28 Thread Justin Lambert
John,

Thanks for your response.  I wasn't meaning to complain about the lack of 
documentation, was just using it as a data point.  I was trying to determine if 
there was something I wasn't aware of that was available for me to use now or 
something planned in the future.  I know hiera is a relatively new major 
enhancement to puppet and it is still being determined in some cases how to 
best utilize it.

I (attempted) to add this functionality this morning, we'll see where it goes 
(https://projects.puppetlabs.com/issues/19516).  This is my first PR to puppet 
directly, hopefully it is something others feel would be of value also.

jl

On Feb 28, 2013, at 7:24 AM, jcbollinger  wrote:

> 
> 
> On Wednesday, February 27, 2013 8:34:47 AM UTC-6, Justin Lambert wrote:
> I've had this blog post [1] bookmarked for a while to pull the remaining node 
> specific config I have out of my site.pp, but wasn't sure if there was a 
> better method at this point.  
> 
> 
> The custom 'hiera_resources()' function described in that blog post appears 
> to be equivalent to a combination of the standard hiera() and 
> create_resources() functions.  Whether that general approach is best is an 
> entirely separate question, however, and the answer probably depends on the 
> circumstances.
> 
>  
> I've been using hiera_include for a while for classes, but it appears 
> functionality is something that may go away based on this feature [2] and the 
> fact that it is still undocumented [3].  The bug report points out include 
> now takes an array [4] (yeah!), but to get the correct array built from hiera 
> (multiple levels) I have to use hiera_array which is also still undocumented 
> [5].
> 
> 
> Although hiera_include() may eventually go away, as it is indeed redundant, I 
> don't think there is any reason to fear that hiera_array() or hiera_hash() 
> will be removed.  PL has limited resources at its disposal, and one of the 
> things that has historically been a problem for it is the thoroughness (or 
> lack thereof) of its documentation.  It does devote effort to documentation, 
> to be sure, but not to such an extent that you can take lack of detailed 
> documentation of hiera_array() to be an indication that it is at risk of 
> removal.
> 
> If the lack of documentation bothers you then file a ticket against it 
> (supposing there isn't one already).  If you're really motivated, then Puppet 
> is an open-source project: you can write the documentation and contribute it 
> if you are so inclined.
> 
>  
> 
> What is the current recommended way of including classes to be included in 
> your hiera data and is there a recommended method for including resources?  
> Obviously I can implement the stuff Robin and Hunter did if I'm not 
> implementing something that's going to go away shortly because it is a 
> terrible idea.
> 
> 
> Use either
> 
> $classes = hiera('classes_key') 
> include $classes
> 
> or
> 
> $classes = hiera_array('classes_key') 
> include $classes
> 
> or a similar approach based on 'include' instead of 'hiera_include'.
> 
> If you can, derive resource parameters from class data and/or general hiera 
> data, but if you must model whole resource declarations in hiera then use
> 
> $resources_hash = hiera('resource_key')
> create_resources('resource_name', $resources_hash)
> 
> to handle them.
> 
> 
> John
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To 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.
>  
>  

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




[Puppet Users] Classes and resources in Hiera

2013-02-27 Thread Justin Lambert
I've had this blog post [1] bookmarked for a while to pull the remaining node 
specific config I have out of my site.pp, but wasn't sure if there was a better 
method at this point.  

I've been using hiera_include for a while for classes, but it appears 
functionality is something that may go away based on this feature [2] and the 
fact that it is still undocumented [3].  The bug report points out include now 
takes an array [4] (yeah!), but to get the correct array built from hiera 
(multiple levels) I have to use hiera_array which is also still undocumented 
[5].

What is the current recommended way of including classes to be included in your 
hiera data and is there a recommended method for including resources?  
Obviously I can implement the stuff Robin and Hunter did if I'm not 
implementing something that's going to go away shortly because it is a terrible 
idea.

Thanks,
jl

[1] http://yo61.com/assigning-resources-to-nodes-with-hiera-in-puppet.html
[2] http://projects.puppetlabs.com/issues/11608
[3] http://docs.puppetlabs.com/references/3.1.latest/function.html#hierainclude
[4] http://projects.puppetlabs.com/issues/7801
[5] http://docs.puppetlabs.com/references/3.1.latest/function.html#hieraarray

-- 
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] Rspec with rspec-hiera-puppet

2013-02-20 Thread Justin Lambert
I have been revisiting this again lately and still haven't been able to get any 
spec tests working with hiera.  Has anyone else had any luck in the last few 
months?  It is easy to make hiera lookups work if there is a default, but I 
can't seem to write a spec test that provides data to a hiera lookup without a 
default or to override a default.

Thanks,
jl

On Dec 17, 2012, at 10:24 AM, Justin Lambert  
wrote:

> I've been working on getting spec tests on all of my modules and am down to 
> ones that use hiera and don't have any reasonable defaults.  It looks like 
> there is a project on GH (https://github.com/amfranz/rspec-hiera-puppet) that 
> is designed to fill this need, but for the life of me I cannot make it work.  
> FriedBob helped out on the IRC channel some with his solution of including a 
> patch to puppetlabs_spec_helper that was pulled pending further discussion 
> (https://github.com/puppetlabs/puppetlabs_spec_helper/pull/16).
> 
> I've attempted to make a working example using both the basic and advanced 
> methods of rspec-hiera-puppet (I can live with either one) but cannot get 
> them to work.  Does anyone have any experience with this they can lend me a 
> hand?  This doesn't seem like it should be this hard - I have to be missing 
> something easy.
> 
> https://github.com/jlambert121/rspec-hiera-puppet-basic
> https://github.com/jlambert121/rspec-hiera-puppet-advanced
> 
> Thanks,
> jl
> 
> 
> 
> 
> -- 
> 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 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] Spec test failure

2013-01-14 Thread Justin Lambert
Jeff,

You haven't by chance had a chance to look at this have you?  I'd be curious if 
I'm just doing something wrong.

Thanks,
jl

On Dec 16, 2012, at 7:24 PM, Justin Lambert  
wrote:

> Jeff,
> 
> I finally got a few simple modules together to recreate this issue.  A 'rake 
> spec' will fail for the 'test' module.
> 
> https://github.com/jlambert121/puppet-rspec-test
> 
> Let me know if I did something incorrect.  It seems to be the spec for a 
> function will fail if the function depends on pluginsync to install the 
> function.
> 
> Thanks,
> Justin
> 
> On Nov 2, 2012, at 3:46 PM, Jeff McCune  wrote:
> 
>> On Friday, November 2, 2012, Justin Lambert wrote:
>> Jeff,
>> 
>> Thanks for your response.  It is possible, but I'm not sure.  Would 
>> uploading some sample modules that show the breakage help?
>> 
>> Yes, if you publish modules that trigger the issue I'll definitely make an 
>> effort to reproduce the problem you're running into and offer more 
>> suggestions to resolve it.
>> 
>> -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.
> 
> 
> -- 
> 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] Rspec with rspec-hiera-puppet

2012-12-17 Thread Justin Lambert
I've been working on getting spec tests on all of my modules and am down to 
ones that use hiera and don't have any reasonable defaults.  It looks like 
there is a project on GH (https://github.com/amfranz/rspec-hiera-puppet) that 
is designed to fill this need, but for the life of me I cannot make it work.  
FriedBob helped out on the IRC channel some with his solution of including a 
patch to puppetlabs_spec_helper that was pulled pending further discussion 
(https://github.com/puppetlabs/puppetlabs_spec_helper/pull/16).

I've attempted to make a working example using both the basic and advanced 
methods of rspec-hiera-puppet (I can live with either one) but cannot get them 
to work.  Does anyone have any experience with this they can lend me a hand?  
This doesn't seem like it should be this hard - I have to be missing something 
easy.

https://github.com/jlambert121/rspec-hiera-puppet-basic
https://github.com/jlambert121/rspec-hiera-puppet-advanced

Thanks,
jl



-- 
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] Spec test failure

2012-12-16 Thread Justin Lambert
Jeff,

I finally got a few simple modules together to recreate this issue.  A 'rake 
spec' will fail for the 'test' module.

https://github.com/jlambert121/puppet-rspec-test

Let me know if I did something incorrect.  It seems to be the spec for a 
function will fail if the function depends on pluginsync to install the 
function.

Thanks,
Justin

On Nov 2, 2012, at 3:46 PM, Jeff McCune  wrote:

> On Friday, November 2, 2012, Justin Lambert wrote:
> Jeff,
> 
> Thanks for your response.  It is possible, but I'm not sure.  Would uploading 
> some sample modules that show the breakage help?
> 
> Yes, if you publish modules that trigger the issue I'll definitely make an 
> effort to reproduce the problem you're running into and offer more 
> suggestions to resolve it.
> 
> -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.

-- 
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] Spec test failure

2012-11-02 Thread Justin Lambert
Jeff,

Thanks for your response.  It is possible, but I'm not sure.  Would uploading 
some sample modules that show the breakage help?

Thanks,
jl


On Oct 31, 2012, at 3:37 PM, Jeff McCune  wrote:

> I'm not entirely certain, but do you think this could be a variant of this 
> bug:
> 
> http://projects.puppetlabs.com/issues/show/15529
> 
> If so, could you please upvote the bug, watch it, and update it with 
> information about how it's impacting you?
> 
> Thanks,
> -Jeff
> 
> 
> On Wed, Oct 31, 2012 at 9:52 AM, Justin Lambert 
>  wrote:
> One other issue I have I can't figure out (that is potentially related), I 
> have a module backups which passes all tests and uses the concat module.  
> Anything else that uses a backups define fails with the error:
> 
> Failure/Error: it { should create_exec('initialize repo') }
>  Puppet::Error:
>Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid 
> resource type concat at 
> /Users/jlambert/Documents/puppet/gitolite/spec/fixtures/modules/backups/manifests/archive.pp:16
>  on node jlambertmbp.local
> 
> Concat is included in the .fixtures for both the backups module and 
> everything using it.  
> 
> 
> 
> On Oct 30, 2012, at 11:54 AM, Justin Lambert  
> wrote:
> 
>> I am adding  spec tests to my modules and have run into an issue I can't 
>> seem to figure out.
>> 
>> I have a simple class: (ruby/manifests/init.pp)
>> class ruby {
>>   include common
>>   $blah = dirname('/tmp/test/file.txt')
>>   file { $blah: ensure => director }
>> }
>> 
>> And a spec file: (spec/classes/ruby_init_spec.rb)
>> require 'spec_helper'
>> describe 'ruby', :type => :class do
>>   it { should contain_file('/tmp/test') }
>> end
>> 
>> I have a simple define: (ruby/manifests/thin.pp)
>> define ruby::thin {
>>   include common
>>   $blah = dirname('/tmp/test/file.txt')
>>   file { $blah: ensure => director }
>> }
>> 
>> And a spec file: (spec/defines/ruby_thin_spec.rb)
>> require 'spec_helper'
>> describe 'ruby::thin', :type => :define do
>>   let(:title) { 'test_site' }
>>   it { should contain_file('/tmp/test') }  
>> end
>> 
>> My .fixtures.yml contains:
>> fixtures:
>>   repositories:
>> common: gitol...@git.mycompany.com:puppet/mycompany-common.git
>>   symlinks:
>> ruby: "#{source_dir}"
>> 
>> common/lib/puppet/parser/functions/dirname.rb exists and is based off of 
>> https://github.com/camptocamp/puppet-common/blob/master/lib/puppet/parser/functions/dirname.rb.
>>   I've been using it for a very long time without issue.
>> 
>> 
>> Any thoughts as to what I'm missing?  I think I've narrowed it down to a 
>> class works and the define does not.
>> 
>> -- 
>> 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.
> 
> 
> -- 
> 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] librarian-puppet

2012-11-01 Thread Justin Lambert
Did you install puppet via an RPM?  If so, this patch will likely fix your 
issue.  https://github.com/rodjek/librarian-puppet/issues/38

On Oct 31, 2012, at 2:52 PM, Worker Bee  wrote:

> Unless I install puppet vis gems, I get the following error when attempting 
> to use librarian-puppet.
> 
>  librarian-puppet
> /usr/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error': Could 
> not find RubyGem puppet (>= 0) (Gem::LoadError)
> from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate'
> from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:249:in `activate'
> from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `each'
> from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `activate'
> from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in `gem'
> from /usr/bin/librarian-puppet:18
> 
> 
> Has anyone created a workaround for this?
> 
> Thanks!
> bee
> 
> -- 
> 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] Spec test failure

2012-10-31 Thread Justin Lambert
One other issue I have I can't figure out (that is potentially related), I have 
a module backups which passes all tests and uses the concat module.  Anything 
else that uses a backups define fails with the error:

Failure/Error: it { should create_exec('initialize repo') }
 Puppet::Error:
   Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid 
resource type concat at 
/Users/jlambert/Documents/puppet/gitolite/spec/fixtures/modules/backups/manifests/archive.pp:16
 on node jlambertmbp.local

Concat is included in the .fixtures for both the backups module and everything 
using it.  



On Oct 30, 2012, at 11:54 AM, Justin Lambert  
wrote:

> I am adding  spec tests to my modules and have run into an issue I can't seem 
> to figure out.
> 
> I have a simple class: (ruby/manifests/init.pp)
> class ruby {
>   include common
>   $blah = dirname('/tmp/test/file.txt')
>   file { $blah: ensure => director }
> }
> 
> And a spec file: (spec/classes/ruby_init_spec.rb)
> require 'spec_helper'
> describe 'ruby', :type => :class do
>   it { should contain_file('/tmp/test') }
> end
> 
> I have a simple define: (ruby/manifests/thin.pp)
> define ruby::thin {
>   include common
>   $blah = dirname('/tmp/test/file.txt')
>   file { $blah: ensure => director }
> }
> 
> And a spec file: (spec/defines/ruby_thin_spec.rb)
> require 'spec_helper'
> describe 'ruby::thin', :type => :define do
>   let(:title) { 'test_site' }
>   it { should contain_file('/tmp/test') }  
> end
> 
> My .fixtures.yml contains:
> fixtures:
>   repositories:
> common: gitol...@git.mycompany.com:puppet/mycompany-common.git
>   symlinks:
> ruby: "#{source_dir}"
> 
> common/lib/puppet/parser/functions/dirname.rb exists and is based off of 
> https://github.com/camptocamp/puppet-common/blob/master/lib/puppet/parser/functions/dirname.rb.
>   I've been using it for a very long time without issue.
> 
> 
> Any thoughts as to what I'm missing?  I think I've narrowed it down to a 
> class works and the define does not.
> 
> -- 
> 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] Spec test failure

2012-10-30 Thread Justin Lambert
I am adding  spec tests to my modules and have run into an issue I can't seem 
to figure out.

I have a simple class: (ruby/manifests/init.pp)
class ruby {
  include common
  $blah = dirname('/tmp/test/file.txt')
  file { $blah: ensure => director }
}

And a spec file: (spec/classes/ruby_init_spec.rb)
require 'spec_helper'
describe 'ruby', :type => :class do
  it { should contain_file('/tmp/test') }
end

I have a simple define: (ruby/manifests/thin.pp)
define ruby::thin {
  include common
  $blah = dirname('/tmp/test/file.txt')
  file { $blah: ensure => director }
}

And a spec file: (spec/defines/ruby_thin_spec.rb)
require 'spec_helper'
describe 'ruby::thin', :type => :define do
  let(:title) { 'test_site' }
  it { should contain_file('/tmp/test') }  
end

My .fixtures.yml contains:
fixtures:
  repositories:
common: gitol...@git.mycompany.com:puppet/mycompany-common.git
  symlinks:
ruby: "#{source_dir}"

common/lib/puppet/parser/functions/dirname.rb exists and is based off of 
https://github.com/camptocamp/puppet-common/blob/master/lib/puppet/parser/functions/dirname.rb.
  I've been using it for a very long time without issue.


Any thoughts as to what I'm missing?  I think I've narrowed it down to a class 
works and the define does not.

-- 
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] Autoscaling Secure Signing Options

2012-09-29 Thread Justin Lambert
Puppet certificate signing is the one item that (I think) has caused issues for 
everyone at one point or another.  I think the security provided is a 
requirement for tools such as this given the amount of access to both hosts and 
sensitive data they have.

There were a few presentations at PuppetConf where presenters went through 
semi-detailed explanations on how they handled this issue, but none that I was 
so excited about I implemented last night.  I'm curious how other people deal 
with securely signing certificates in an auto-scaling environment (getting up 
at 3AM to sign a cert when a node is automatically provisioned is not an 
option).  I have a working solution right now, but I find myself wondering if 
there is a better way. 

Current:
I'm using R.I. Pienaar's ec2-boot-init scripts combined with his 
mcollective-server-provisioner tool which works pretty well.  The biggest 
concern I have with it is the fact my collective information is accessible to 
anyone who has access to the machine through the Amazon APIs.  One possible 
solution is have a provisioning collective and a production collective and have 
puppet switch the machine as it is provisioning it.

Other options I have seen:
Auto-signing - Is someone using this outside of POC/dev?

Cron entry on the puppet master that checks for pending certificates to 
sign, verifies them against a known truth, and signs.  How are old certificates 
cleaned up to allow for reuse of hostname?  (We use standard naming to allow 
regex provisioning of nodes) Could be another cron.

Cloud provisioner - I haven't used this, but it looks like it might 
work for us.  I don't see a way to specify the hostname with it, but depending 
on the guts of how it works I might still be able to do that with the 
ec2-boot-init scripts or extend cloud provisioner with that feature.  I need to 
dig into the code on this more.

Custom app - You can easily integrate into both the puppet REST 
certificate service and your cloud provider's APIs and roll your own.  You know 
what you launched therefore it is good.



How are you doing it I didn't touch on?  What issues have you run into?

jl

-- 
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 Inventory Service - class search

2011-12-07 Thread Justin Lambert
I am looking to rewrite some modules that currently use storeconfigs (nagios 
being the big one) to instead pull from the inventory service the required 
information instead.  Some of the checks are as easy as a monitoring check that 
gets put into place whenever a specific class is included.  I know I can have 
my class install a fact I can then query for, but to remove the service i then 
need to also clean up that fact so it disappears from the monitoring service as 
well.

I have looked at the mailing list, API reference, and inventory service page 
without success hoping to see a class_search (or something like it) to go along 
with the fact_search.  Does this exist?

Another idea I thought of is to have a fact that pulled in the classes.txt into 
one value (which would solve my removal issue), but there isn't a textual 
operator for substr or in.

Assuming that none of the above exist (and nobody has a different head smack 
easy solution), where is the inventory service in the puppet code and I will 
see if I can add a substr/in pattern match.  

Thanks,
jl

-- 
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: Storeconfigs seem slow

2011-09-13 Thread Justin Lambert
Thanks for everyone's comments - I finally found where the large chunk of
client time was going.  Client runs are still slow, but 5 mins is a lot
better than 20 minutes.  The issue in our case was having the directory that
contained the nagios config files managed by puppet (purge => true, recurse
=> true, force => true), but also had a source set pushing some real files
as well as the files in the stored config.  The process of merging those
together seems to have taken about 12 minutes in our case.

Thanks again,
jl

-- 
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] Storeconfigs seem slow

2011-09-12 Thread Justin Lambert
>
> > We're at about the 100 hosts, but have closer to 1500 services - maybe
> > we have exceeded what storeconfigs can do then.
>
> hmm.. so yeah, you've hit the same kind of very bad scaling from the
> nagios config native resources than I've experienced. Seeing how bad it
> becomes with that number of services is now convincing me that I want to
> change method.


I'm just not convinced yet that the issue is on the stored config side.  The
config retrieval/catalog build is 2-3 mins (long, I agree), but that's
nothing compared to the other 17 minutes the client is busy with no output
in debug mode and 100% on one core on the CPU used by puppet.  What is it
doing then?


> >  If that is the case, is
> > there a recommended alternative that isn't manually maintaining config
> > files?
>
> One alternative would be to use file templates, combined with
> concatenated_file resources (from David Schmidt's 'puppet-common' module).
> That way, for every host and service definition (and other nagios config
> items), you can export a file and its contents will be verified by md5
> sum. Every file that you export to the nagios server should notify a
> concatenation exec that binds everything together.
>
> The good thing with this method is that you can manage the module
> directory (where the different config file excerpts are stored) with
> 'purge => true' so that only exported resources are present in the final
> nagios configuration (something that native types don't handle very well
> -- or actually handle very badly).
>

We actually wrote our own nagios module rather than using the built-in ones.
 We are exporting one cfg file per host for the host config, one subdir per
host which contains all of the checks for that host (one file per check) and
then can use purge on it as well to clean removed hosts/services.  I know
puppet does an md5sum on each of the files, but since the md5sum binary runs
on all of /etc (with the binary being invoked once per file using find
-exec) in less than 3 seconds it seems like something else is going on.  I
assume puppet is using a ruby md5 method and I haven't tested it, but I
can't believe there is that significant of a difference over a binary
invocation.


>
> > It seems like most of the processing time is spent client side
> > and I haven't been able to figure out why.  Even doing an md5sum on all
> > of the files from the CLI takes less than 2 seconds.
>
> I haven't traced the thing, but from what I could understand, the most
> time is spent in resolving relationships between exported nagios
> resources and ensuring that all the exported resources are unique. To
> verify this, you could setup postgres to log SQL requests and check out
> what gets requested during one run.


This is going to be another issue as this scales, but right now if I could
get puppet runs to <5 mins on the nagios server I would be happy enough to
move on and come back later.  I should probably do this though so I
understand how the queries are structured to see if there is any way I can
add more dependency information to the data we are feeding the DB to make
the queries more efficient.

I appreciate the thoughts and feedback.  Let me know if there is any other
way to get more debug info that might help figure out what is going on or if
there is a doNothing() method somewhere deep in the puppet magic.

-- 
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] Storeconfigs seem slow

2011-09-12 Thread Justin Lambert
Thanks for the response.  We're using Posrgres, and the catalog build seems
a bit slow, but nothing compared to the client runtime which is where I've
been focusing.  Your assessment is correct, it is just the nagios server
that is extremely slow (~20 mins), there is minimal/no impact to the client
machines.

We're at about the 100 hosts, but have closer to 1500 services - maybe we
have exceeded what storeconfigs can do then.  If that is the case, is there
a recommended alternative that isn't manually maintaining config files?  It
seems like most of the processing time is spent client side and I haven't
been able to figure out why.  Even doing an md5sum on all of the files from
the CLI takes less than 2 seconds.

On Mon, Sep 12, 2011 at 3:30 PM, Gabriel Filion  wrote:

> Hi,
>
> On 11-09-12 04:43 PM, Justin Lambert wrote:
> > We are moving to have our nagios servers generate their nagios configs
> > based on what services are installed on specific hosts (as well as the
> > hosts registering themselves).  What we have found is that our runtimes
> > have gone through the roof on this and I'm trying to figure out why
> > (summary below from a puppet run).  The config pull takes a while, but
> > the majority of the time is spent on the client side.  Running puppet
> > with -d has a large chunk of this time with nothing being updated on the
> > screen and one processor core being pegged.  We're running 2.6.9 on
> > SL6.0 x86_64.
>
> What db backend are you using for stored configs?
>
> If you're using the sqlite3 backend, I'd recommend switching to mysql or
> postgresql. The sqlite3 backend is mainly there for easing puppet dev,
> but it's way too slow for production use..
>
> > I'm not sure if I have an unreasonable number of resources and I need to
> > do things differently or if I have a problem on my client I need to
> > address.  Any insight or direction to go down to continue debugging?
>
> Normally the client run time shouldn't change much with or without
> exporting nagios resources, except on the Nagios server (the one
> extracting the puppet resources).
>
> In my experience, exporting native Nagios resources on Nagios clients
> and collecting them on the Nagios server doesn't seem to be scaling very
> well. But still, it's usable with around 100 hosts and 500 services..
>
> --
> 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] Storeconfigs seem slow

2011-09-12 Thread Justin Lambert
We are moving to have our nagios servers generate their nagios configs based
on what services are installed on specific hosts (as well as the hosts
registering themselves).  What we have found is that our runtimes have gone
through the roof on this and I'm trying to figure out why (summary below
from a puppet run).  The config pull takes a while, but the majority of the
time is spent on the client side.  Running puppet with -d has a large chunk
of this time with nothing being updated on the screen and one processor core
being pegged.  We're running 2.6.9 on SL6.0 x86_64.

I'm not sure if I have an unreasonable number of resources and I need to do
things differently or if I have a problem on my client I need to address.
 Any insight or direction to go down to continue debugging?

(Ignore the errors, side effect of this being a test build on a test
machine)
# time puppets -td
…..
debug: file_metadata supports formats: b64_zlib_yaml marshal pson raw yaml;
using pson
[stall for a long time]
debug: file_metadata supports formats: b64_zlib_yaml marshal pson raw yaml;
using pson
….
notice: Finished catalog run in 1094.09 seconds
Changes:
Total: 2
Events:
  Success: 2
  Failure: 3
Total: 5
Resources:
  Skipped: 1
Total: 1566
  Changed: 2
   Failed: 3
  Out of sync: 5
Time:
 User: 0.00
   Filebucket: 0.00
 Host: 0.00
Mount: 0.01
   Ssh authorized key: 0.01
 Schedule: 0.01
Class: 0.01
  Yumrepo: 0.03
  Package: 0.23
Total: 108.87
 Last run: 1315860016
 File: 19.57
 Exec: 29.27
   Config retrieval: 52.20
  Service: 7.53

real 20m47.707s
user 18m12.793s
sys 0m39.436s
#

Thanks,
jl

-- 
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] Destroy nodes in dashboard

2011-09-08 Thread Justin Lambert
1.1.0

On Thu, Sep 8, 2011 at 9:31 AM, Craig White  wrote:

> version?
>
> On Sep 8, 2011, at 8:22 AM, Justin Lambert wrote:
>
> > Destroying nodes in puppet dashboard seems to kill dashboard after about
> 5 minutes requiring a restart.  I took at look at the DB schema and was just
> going to remove nodes via SQL directly instead of using the dashboard and
> wanted to see if anyone sees anything wrong with this.  I know the queries
> could be improved not doing my subselects, but I just wanted to make sure
> I'm not either forgetting some data or doing something terrible.
> >
> >
> > select id from nodes where name like 'myname%';
> > delete from resource_events where resource_status_id in ( select id from
> resource_statuses where report_id in ( select id from reports where node_id
> = 71 ));
> > delete from resource_statuses where report_id in (select id from reports
> where node_id=71);
> > delete from metrics where report_id in (select id from reports where
> node_id=71);
> > delete from report_logs where report_id in (select id from reports where
> node_id=71);
> > delete from resource_events where resource_status_id in ( select id from
> resource_statuses where report_id in ( select id from old_reports where
> node_id = 71 ));
> > delete from resource_statuses where report_id in (select id from
> old_reports where node_id=71);
> > delete from metrics where report_id in (select id from old_reports where
> node_id=71);
> > delete from report_logs where report_id in (select id from old_reports
> where node_id=71);
> > delete from reports where node_id=71;
> > delete from node_group_memberships where node_id=71;
> > delete from node_class_memberships where node_id=71;
>
> --
> 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] Destroy nodes in dashboard

2011-09-08 Thread Justin Lambert
Destroying nodes in puppet dashboard seems to kill dashboard after about 5
minutes requiring a restart.  I took at look at the DB schema and was just
going to remove nodes via SQL directly instead of using the dashboard and
wanted to see if anyone sees anything wrong with this.  I know the queries
could be improved not doing my subselects, but I just wanted to make sure
I'm not either forgetting some data or doing something terrible.


select id from nodes where name like 'myname%';
delete from resource_events where resource_status_id in ( select id from
resource_statuses where report_id in ( select id from reports where node_id
= 71 ));
delete from resource_statuses where report_id in (select id from reports
where node_id=71);
delete from metrics where report_id in (select id from reports where
node_id=71);
delete from report_logs where report_id in (select id from reports where
node_id=71);
delete from resource_events where resource_status_id in ( select id from
resource_statuses where report_id in ( select id from old_reports where
node_id = 71 ));
delete from resource_statuses where report_id in (select id from old_reports
where node_id=71);
delete from metrics where report_id in (select id from old_reports where
node_id=71);
delete from report_logs where report_id in (select id from old_reports where
node_id=71);
delete from reports where node_id=71;
delete from node_group_memberships where node_id=71;
delete from node_class_memberships where node_id=71;


jl

-- 
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] prep for 2.8: default values and overrides

2011-08-03 Thread Justin Lambert
Thanks for these - this is very helpful.

On Tue, Aug 2, 2011 at 1:26 AM, vagn scott  wrote:

> **
> prep for 2.8: default values and overrides
>
> I was very happy, some months ago,
> when I worked out how to separate
> configuration from code in puppet.
>
> The scheme even allowed for specialization.
>
> The style was something like this:
>
> cat 04_default.pp
> #! /usr/bin/puppet apply
>
> node default {
>
> class myfoo1 inherits foo::default {
> $foo_param1 = "something else"  # call 1
> specialization
> $foo_param3 = "dull and dreary" # change the
> default
> foo { "call 1": }
> }
> include myfoo1
>
> class myfoo2 inherits foo::default {
> $foo_param2 = "anything else"   # call 2
> specialization
> $foo_param3 = "dull and dreary" # change the
> default again!
> foo { "call 2": }
> }
> include myfoo2
>
>
> }
>
> class foo::default {
> $foo_param1 = "something"
> $foo_param2 = "anything"
> $foo_param3 = "dull"
> $foo_param4 = "duller"
> }
>
> define foo() {
> notice("foo_param1 = ${foo_param1}")
> notice("foo_param2 = ${foo_param2}")
> notice("foo_param3 = ${foo_param3}")
> notice("foo_param4 = ${foo_param4}")
> }
>
> and the output with 2.6.2:
>
>  ./04_default.pp
> notice: Scope(Foo[call 1]): foo_param1 = something else
> notice: Scope(Foo[call 1]): foo_param2 = anything
> notice: Scope(Foo[call 1]): foo_param3 = dull and dreary
> notice: Scope(Foo[call 1]): foo_param4 = duller
> notice: Scope(Foo[call 2]): foo_param1 = something
> notice: Scope(Foo[call 2]): foo_param2 = anything else
> notice: Scope(Foo[call 2]): foo_param3 = dull and dreary
> notice: Scope(Foo[call 2]): foo_param4 = duller
>
>
> But, with 2.7.2rc2  it doesn't work.
>
>  ./04_default.pp
> Could not parse for environment production: Classes, definitions,
> and nodes may only appear at toplevel or inside other classes
> at /u0/home/vagn/puppet-nika/patterns/04_default.pp:5 on node
> nika.agawamtech.com
>
> Even if I moved the classes out of the node the
> scheme would still fail in 2.8 and later because it
> relies on dynamic scoping.
>
> The following works in both 2.6.2 and 2.7.2.
> It is both a shorter and a cleaner
> expression of the idea.
>
> cat 05_default.pp
> #! /usr/bin/puppet apply
>
> node default {
>
> class { "foo::default": foo_param3 => "dull and dreary", }
> foo { "call 1": foo_param1 => "something else", }
> foo { "call 2": foo_param2 => "anything else", }
>
> }
>
> class foo::default (
> $foo_param3 = "dull",
> $foo_param4 = "duller"
> ) {
> # conditionals and composites would go here ...
> }
>
> define foo(
> $foo_param1 = "something",
> $foo_param2 = "anything"
> ) {
> notice("foo_param1 = ${foo_param1}")
> notice("foo_param2 = ${foo_param2}")
> notice("foo_param3 = ${foo::default::foo_param3}")
> notice("foo_param4 = ${foo::default::foo_param4}")
> }
>
> Note that foo::default MUST be instantiated for there to be
> any values for foo() to reference.  Even if no overrides
> are provided you have to explicitly put
>
> class { "foo::default": } # required
>
> somewhere in your manifests.
>
> Three observations
> - most of the work is done in the argument lists
> - arguments can have defaults
> - we only have to express the specializations
>
> As always, comments and corrections welcome.
>
> --
> vagn
>
>
>   --
> 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] Ensuring specific yum repos

2011-07-18 Thread Justin Lambert
I know I am not the first to run into this problem, but I cannot seem to
find an elegant way to solve it - either through Google or on my own.

I want to ensure that the yum repos I define through Yumrepo are the only
repos on the machine (removing any that might be on there for other
reasons).  I have come up with a few ways to do it, none that I really like.

1 - sync the yum.repos.d/*.repo files from puppet using the recurse => true,
purge => true.  While this accomplishes the goal, I remove the "feature" of
being able to define a repo like "
http://yum/shared/corp/${::lsbmajdistrelease}/${::architecture}/"; and have
it "magically" work for future versions of OS without having to copy/paste
new repo files.

2 - Keep the above directory purge options, but sync an empty directory and
then have puppet push out all relevant repos.  This makes sure nothing else
is there, but will force all repos to be pushed out every puppet run.  Not
the end of the world, it just doesn't seem as clean as it should be.

3 - Delete the contents of the directory before any repos are pushed unless
my special dotfile exists saying I at one point purged the cruft.  This will
work to make sure things are as I want them at a given point in time, but
will not enforce it automatically in the future unless the dotfile is
removed.

How have others dealt with this?

Thanks,
jl

-- 
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] new variable scoping in templates

2011-07-15 Thread Justin Lambert
I've been using:

scope.lookupvar('puppet::params::certdnsnames')

On Thu, Jul 14, 2011 at 8:45 PM, lurdan  wrote:

> hi,
>
> What's the best way to refer variables which pass as defined resource
> parameter
> from template erbs?
>
> I've been made many modules which has resource definitions containing
> file templating.
> After I upgrade my puppet version to 2.7.0rc (debian experimental),
> I'm getting many
> warnings "Dynamic lookup is deprecated.  Support will be removed in
> Puppet 2.8.".
>
> I can surpress this warnings with rewriting from:
> <%= some_arg %>
> to:
> <%= scope.to_hash.fetch('some_arg') %>, but this should be bad way
> because
> it seems ugly and meaningless.
> (It's not an explicit scope declaration, simply variable-syntax
> longed...)
>
> regards,
> --
> KURASHIKI Satoru
>
> --
> 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] Moving config to an ENC

2011-07-13 Thread Justin Lambert
Thanks for the response Dan, that was an easy fix.


Here is a trace:
# puppet agent -t --trace
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/rest.rb:56:in `deserialize'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/rest.rb:75:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:188:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector.rb:50:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:240:in
`retrieve_new_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:429:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:428:in `thinmark'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:239:in
`retrieve_new_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:86:in `retrieve_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:111:in
`retrieve_and_apply_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/configurer.rb:150:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent/locker.rb:21:in `lock'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/1.8/sync.rb:230:in `synchronize'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:39:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:103:in `with_client'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:37:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:172:in `call'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:172:in `controlled_run'
/usr/lib/ruby/site_ruby/1.8/puppet/agent.rb:35:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:114:in `onetime'
/usr/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:88:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:420:in `hook'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:411:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:305:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:62:in `execute'
/usr/bin/puppet:4
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Invalid parameter yumreposerver::locations on node
kinks.corp.localmatters.com
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

On Tue, Jul 12, 2011 at 11:35 PM, Dan Bode  wrote:

>
>
> On Tue, Jul 12, 2011 at 10:43 AM, Justin Lambert <
> jlamb...@localmatters.com> wrote:
>
>> I have just gotten to playing with this and am doing something wrong,
>> probably very basic.
>>
>> On the puppetmaster (which for my testing is also the client) I have
>> create_resources.rb in /var/lib/puppet/lib/puppet/parser/functions.
>>
>> I wrote a new ENC that will just output a very basic YAML to test this,
>> the output is:
>> classes:
>>  yumreposerver:
>>   yumreposerver::locations:
>>
>>
>centos5:
>> distro: centos
>> version: 5.6
>>
>
> it should be something like:
>
> yumreposerver:
>   instances:
> centos5:
>   distro:
> ...
>
> there is no yumreposerver parameter in the yum server class, only an
> instances parameter
>
>
>>
>> In my modules directory I have yumreposerver/manifests/locations.pp:
>> class yumreposerver::locations ( $instances = {} )
>> {
>>   create_resources('yumreposerver::location', $instances)
>> }
>>
>> yumreposerver/manifests/location.pp:
>> define yumreposerver::location( $distro, $version ) {
>> .
>> }
>>
>> puppet agent -t --noop returns:
>> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
>> Invalid parameter yumreposerver::locations on node 
>>
>
> I agree that this is not a very clear error message, can you run with
> --trace?
>
>
>
>>  Puppet version 2.6.9 on SL6.
>>
>> Any insight as to where I have gone wrong?
>>
>> Thanks,
>> jl
>>
>> On Wed, Jul 6, 2011 at 7:22 AM, Justin Lambert > > wrote:
>>
>>> This looks exactly like what I was looking for, thank you.  This might be
>>> worth mentioning on the ENC page so people like myself can find it easier.
>>>
>>>
>>> On Tue, Jul 5, 2011 at 10:42 PM, Dan Bode  wrote:
>>>
>>>> Hi J,
>>>>
>>>> The create resources function was created to serve this exact use case
>>>> (the README actually mentions your exact use case :) )
>>>>
>>>> https://github.com/puppetlabs/puppetlabs-create_resources
>>>>
>>>> This will

Re: [Puppet Users] Moving config to an ENC

2011-07-12 Thread Justin Lambert
I am using the create_resource module backported from 2.7 to 2.6 to make
this possible.  The module I am using was recommeded by Dan Bode and can be
found at https://github.com/puppetlabs/puppetlabs-create_resources.

I'm sure it is just something in the way I am implementing it.

On Tue, Jul 12, 2011 at 2:33 PM, Denmat  wrote:

> Hi, is 'something::other' valid in yaml?
> Cheers
> Den
>
>
> On 13/07/2011, at 3:43, Justin Lambert  wrote:
>
> I have just gotten to playing with this and am doing something wrong,
> probably very basic.
>
> On the puppetmaster (which for my testing is also the client) I have
> create_resources.rb in /var/lib/puppet/lib/puppet/parser/functions.
>
> I wrote a new ENC that will just output a very basic YAML to test this, the
> output is:
> classes:
>  yumreposerver:
>   yumreposerver::locations:
>centos5:
> distro: centos
> version: 5.6
>
> In my modules directory I have yumreposerver/manifests/locations.pp:
> class yumreposerver::locations ( $instances = {} )
> {
>   create_resources('yumreposerver::location', $instances)
> }
>
> yumreposerver/manifests/location.pp:
> define yumreposerver::location( $distro, $version ) {
> .
> }
>
> puppet agent -t --noop returns:
> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Invalid parameter yumreposerver::locations on node 
>
>  Puppet version 2.6.9 on SL6.
>
> Any insight as to where I have gone wrong?
>
> Thanks,
> jl
>
> On Wed, Jul 6, 2011 at 7:22 AM, Justin Lambert <
> jlamb...@localmatters.com> wrote:
>
>> This looks exactly like what I was looking for, thank you.  This might be
>> worth mentioning on the ENC page so people like myself can find it easier.
>>
>>
>> On Tue, Jul 5, 2011 at 10:42 PM, Dan Bode < 
>> d...@puppetlabs.com> wrote:
>>
>>> Hi J,
>>>
>>> The create resources function was created to serve this exact use case
>>> (the README actually mentions your exact use case :) )
>>>
>>> <https://github.com/puppetlabs/puppetlabs-create_resources>
>>> https://github.com/puppetlabs/puppetlabs-create_resources
>>>
>>> This will require 2.6.5 or higher to work (That is the first version
>>> where ENC's support param classes)
>>>
>>> The function was also merged into core in 2.7.0
>>>
>>> -Dan
>>>
>>> On Tue, Jul 5, 2011 at 1:40 PM, Justin Lambert <
>>> jlamb...@localmatters.com> wrote:
>>>
>>>> I have recently started moving the config of our puppet hosts out of the
>>>> nodes files and into an ENC so they can be managed through a web UI by
>>>> someone with less technical experience without the fear of a typo causing a
>>>> failure of all catalogs to compile.  As a result, I have been looking at
>>>> which modules need to be rewritten to support this.  The problem I have run
>>>> into is, how do you do something such as add multiple virtual hosts using
>>>> the YAML output of an ENC?
>>>>
>>>> I currently have something like:
>>>>
>>>> node ' <http://web01.company.com>web01.company.com' {
>>>>   apache::virtualhost { 'site1': location => '/hosted/site1', url => 
>>>> '<http://site1.com>
>>>> http://site1.com' }
>>>>   apache::virtualhost { 'site2': location => '/hosted/site2', url => 
>>>> '<http://site2.com>
>>>> http://site2.com' }
>>>> }
>>>>
>>>> This uses 'define apache::virtualhost' in order to create multiple
>>>> sites, works fine.  The YAML from an ENC (referencing 
>>>> <http://docs.puppetlabs.com/guides/external_nodes.html>
>>>> http://docs.puppetlabs.com/guides/external_nodes.html) doesn't look to
>>>> support this kind of definition so I need to find an alternative.  My next
>>>> thought was that I can pass parameters to a parameterized class.  No love
>>>> there as you can't instantiate a class multiple times with different
>>>> parameters.  How are others solving this issue?
>>>>
>>>> Thanks,
>>>> jl
>>>>
>>>> --
>>>> 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 unsu

Re: [Puppet Users] Moving config to an ENC

2011-07-12 Thread Justin Lambert
I have just gotten to playing with this and am doing something wrong,
probably very basic.

On the puppetmaster (which for my testing is also the client) I have
create_resources.rb in /var/lib/puppet/lib/puppet/parser/functions.

I wrote a new ENC that will just output a very basic YAML to test this, the
output is:
classes:
 yumreposerver:
  yumreposerver::locations:
   centos5:
distro: centos
version: 5.6

In my modules directory I have yumreposerver/manifests/locations.pp:
class yumreposerver::locations ( $instances = {} )
{
  create_resources('yumreposerver::location', $instances)
}

yumreposerver/manifests/location.pp:
define yumreposerver::location( $distro, $version ) {
.
}

puppet agent -t --noop returns:
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Invalid parameter yumreposerver::locations on node 

 Puppet version 2.6.9 on SL6.

Any insight as to where I have gone wrong?

Thanks,
jl

On Wed, Jul 6, 2011 at 7:22 AM, Justin Lambert wrote:

> This looks exactly like what I was looking for, thank you.  This might be
> worth mentioning on the ENC page so people like myself can find it easier.
>
>
> On Tue, Jul 5, 2011 at 10:42 PM, Dan Bode  wrote:
>
>> Hi J,
>>
>> The create resources function was created to serve this exact use case
>> (the README actually mentions your exact use case :) )
>>
>> https://github.com/puppetlabs/puppetlabs-create_resources
>>
>> This will require 2.6.5 or higher to work (That is the first version where
>> ENC's support param classes)
>>
>> The function was also merged into core in 2.7.0
>>
>> -Dan
>>
>> On Tue, Jul 5, 2011 at 1:40 PM, Justin Lambert > > wrote:
>>
>>> I have recently started moving the config of our puppet hosts out of the
>>> nodes files and into an ENC so they can be managed through a web UI by
>>> someone with less technical experience without the fear of a typo causing a
>>> failure of all catalogs to compile.  As a result, I have been looking at
>>> which modules need to be rewritten to support this.  The problem I have run
>>> into is, how do you do something such as add multiple virtual hosts using
>>> the YAML output of an ENC?
>>>
>>> I currently have something like:
>>>
>>> node 'web01.company.com' {
>>>   apache::virtualhost { 'site1': location => '/hosted/site1', url => '
>>> http://site1.com' }
>>>   apache::virtualhost { 'site2': location => '/hosted/site2', url => '
>>> http://site2.com' }
>>> }
>>>
>>> This uses 'define apache::virtualhost' in order to create multiple sites,
>>> works fine.  The YAML from an ENC (referencing
>>> http://docs.puppetlabs.com/guides/external_nodes.html) doesn't look to
>>> support this kind of definition so I need to find an alternative.  My next
>>> thought was that I can pass parameters to a parameterized class.  No love
>>> there as you can't instantiate a class multiple times with different
>>> parameters.  How are others solving this issue?
>>>
>>> Thanks,
>>> jl
>>>
>>> --
>>> 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.
>>
>
>

-- 
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] Moving config to an ENC

2011-07-06 Thread Justin Lambert
This looks exactly like what I was looking for, thank you.  This might be
worth mentioning on the ENC page so people like myself can find it easier.

On Tue, Jul 5, 2011 at 10:42 PM, Dan Bode  wrote:

> Hi J,
>
> The create resources function was created to serve this exact use case (the
> README actually mentions your exact use case :) )
>
> https://github.com/puppetlabs/puppetlabs-create_resources
>
> This will require 2.6.5 or higher to work (That is the first version where
> ENC's support param classes)
>
> The function was also merged into core in 2.7.0
>
> -Dan
>
> On Tue, Jul 5, 2011 at 1:40 PM, Justin Lambert 
> wrote:
>
>> I have recently started moving the config of our puppet hosts out of the
>> nodes files and into an ENC so they can be managed through a web UI by
>> someone with less technical experience without the fear of a typo causing a
>> failure of all catalogs to compile.  As a result, I have been looking at
>> which modules need to be rewritten to support this.  The problem I have run
>> into is, how do you do something such as add multiple virtual hosts using
>> the YAML output of an ENC?
>>
>> I currently have something like:
>>
>> node 'web01.company.com' {
>>   apache::virtualhost { 'site1': location => '/hosted/site1', url => '
>> http://site1.com' }
>>   apache::virtualhost { 'site2': location => '/hosted/site2', url => '
>> http://site2.com' }
>> }
>>
>> This uses 'define apache::virtualhost' in order to create multiple sites,
>> works fine.  The YAML from an ENC (referencing
>> http://docs.puppetlabs.com/guides/external_nodes.html) doesn't look to
>> support this kind of definition so I need to find an alternative.  My next
>> thought was that I can pass parameters to a parameterized class.  No love
>> there as you can't instantiate a class multiple times with different
>> parameters.  How are others solving this issue?
>>
>> Thanks,
>> jl
>>
>> --
>> 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.
>

-- 
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] Moving config to an ENC

2011-07-05 Thread Justin Lambert
I have recently started moving the config of our puppet hosts out of the
nodes files and into an ENC so they can be managed through a web UI by
someone with less technical experience without the fear of a typo causing a
failure of all catalogs to compile.  As a result, I have been looking at
which modules need to be rewritten to support this.  The problem I have run
into is, how do you do something such as add multiple virtual hosts using
the YAML output of an ENC?

I currently have something like:

node 'web01.company.com' {
  apache::virtualhost { 'site1': location => '/hosted/site1', url => '
http://site1.com' }
  apache::virtualhost { 'site2': location => '/hosted/site2', url => '
http://site2.com' }
}

This uses 'define apache::virtualhost' in order to create multiple sites,
works fine.  The YAML from an ENC (referencing
http://docs.puppetlabs.com/guides/external_nodes.html) doesn't look to
support this kind of definition so I need to find an alternative.  My next
thought was that I can pass parameters to a parameterized class.  No love
there as you can't instantiate a class multiple times with different
parameters.  How are others solving this issue?

Thanks,
jl

-- 
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] Dashboard - Could not retrieve facts from inventory service

2011-07-05 Thread Justin Lambert
I actually set this up today, if you set it up like:

path /facts
method find
auth any
allow *

does that fix your issue?  If it does, it looks like it is something with
the way your reverse DNS is working on the allow line.

On Tue, Jul 5, 2011 at 4:24 PM, Craig White  wrote:

> puppet 2.6.8
> puppet-dashboard v1.1.1
>
> auth.conf has:
> path /facts
> auth no
> method find
> allow dashboard, ubuntu.ttinet
>
> path /inventory
> auth no
> method search, find
> allow dashboard, ubuntu.ttinet
>
> # grep fact puppet.conf
>  factpath=$vardir/lib/facter
>  factsysnc=true
>
> The error (and I've tracked a lot of these down w/ Google but not getting
> to the heart of my problem - I'm relatively up to date):
>
> Could not retrieve facts from inventory service: 403 "Forbidden request:
> dashboard(10.1.0.253) access to /facts/ubuntu2.ttinet [find] authenticated
> at line 103 "
>
> How do I fix this?
>
> --
> Craig White ~~  craig.wh...@ttiltd.com
> 1.800.869.6908 ~~~ www.ttiassessments.com
>
> Need help communicating between generations at work to achieve your desired
> success? Let us help!
>
> --
> 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: Default Schedule

2009-04-10 Thread Justin Lambert
I have finally figured out a way to do this, posting in case anyone else has 
the same question.  I defined my 'default' schedule and just included it in the 
class everything else inherits from.  This may not be the best way, but it 
works for me.

schedule { normal:
range=> "17:00 - 04:00",
}

class general {
$schedule = "normal"
}

jl

From: puppet-users@googlegroups.com [mailto:puppet-us...@googlegroups.com] On 
Behalf Of Justin Lambert
Sent: Tuesday, April 07, 2009 8:00 AM
To: puppet-users@googlegroups.com
Subject: [Puppet Users] RE: Default Schedule

I can set schedules, and those work fine. What I am trying to prevent is (my) 
stupidity of accidently scheduling something that runs during the day.  I will 
then over-ride the default with anything that should be checked during the day. 
 I found where the default schedule is defined, and could modify that code, but 
I would assume there is a more 'correct' way of doing this.  My ruby is also 
very poor (non-existent).

What I was looking at was this thread: 
http://groups.google.com/group/puppet-users/browse_thread/thread/3b77a239a1d77d5/516d24762429bf35
 that mentioned Schedule.  I have put:

Schedule {
range=> "12 - 14",
}

As the first item in my site.pp, just to be sure the parser found it.  Any help 
on the correct way to over-ride the default schedule would be great.  The type 
reference doesn't seem to have anything that helps me out either.

Thanks,
jl

From: puppet-users@googlegroups.com [mailto:puppet-us...@googlegroups.com] On 
Behalf Of Justin Lambert
Sent: Wednesday, April 01, 2009 12:31 PM
To: puppet-users@googlegroups.com
Subject: [Puppet Users] Default Schedule

I am trying to set a default schedule and not having a lot of luck.  It doesn't 
look like they are used a whole lot and I've had a hard time finding 
documentation.  What I would ultimately like is for the default schedule to be 
daily from "17:00 - 03:00."  I'm not sure if it'll work past midnight, if it 
doesn't I can work around that.  I found in a previous post to set the default 
schedule define:

/etc/puppet/manifests/site.pp
Schedule{
period   => hourly,
range=> "17:00 - 23:00",
}

(I set it so it wouldn't cross midnight first, after I get this working I can 
extend it and see if it still works)

The problem is that it looks like puppetd still processes everything even 
though it is outside the scheduled window.  What am I missing?

Thanks,
jl






--~--~-~--~~~---~--~~
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: Default Schedule

2009-04-07 Thread Justin Lambert
I can set schedules, and those work fine. What I am trying to prevent is (my) 
stupidity of accidently scheduling something that runs during the day.  I will 
then over-ride the default with anything that should be checked during the day. 
 I found where the default schedule is defined, and could modify that code, but 
I would assume there is a more 'correct' way of doing this.  My ruby is also 
very poor (non-existent).

What I was looking at was this thread: 
http://groups.google.com/group/puppet-users/browse_thread/thread/3b77a239a1d77d5/516d24762429bf35
 that mentioned Schedule.  I have put:

Schedule {
range=> "12 - 14",
}

As the first item in my site.pp, just to be sure the parser found it.  Any help 
on the correct way to over-ride the default schedule would be great.  The type 
reference doesn't seem to have anything that helps me out either.

Thanks,
jl

From: puppet-users@googlegroups.com [mailto:puppet-us...@googlegroups.com] On 
Behalf Of Justin Lambert
Sent: Wednesday, April 01, 2009 12:31 PM
To: puppet-users@googlegroups.com
Subject: [Puppet Users] Default Schedule

I am trying to set a default schedule and not having a lot of luck.  It doesn't 
look like they are used a whole lot and I've had a hard time finding 
documentation.  What I would ultimately like is for the default schedule to be 
daily from "17:00 - 03:00."  I'm not sure if it'll work past midnight, if it 
doesn't I can work around that.  I found in a previous post to set the default 
schedule define:

/etc/puppet/manifests/site.pp
Schedule{
period   => hourly,
range=> "17:00 - 23:00",
}

(I set it so it wouldn't cross midnight first, after I get this working I can 
extend it and see if it still works)

The problem is that it looks like puppetd still processes everything even 
though it is outside the scheduled window.  What am I missing?

Thanks,
jl




--~--~-~--~~~---~--~~
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: Default Schedule

2009-04-05 Thread Justin Lambert
Nobody has used a default schedule?

Thanks,
jl

From: puppet-users@googlegroups.com [mailto:puppet-us...@googlegroups.com] On 
Behalf Of Justin Lambert
Sent: Wednesday, April 01, 2009 12:31 PM
To: puppet-users@googlegroups.com
Subject: [Puppet Users] Default Schedule

I am trying to set a default schedule and not having a lot of luck.  It doesn't 
look like they are used a whole lot and I've had a hard time finding 
documentation.  What I would ultimately like is for the default schedule to be 
daily from "17:00 - 03:00."  I'm not sure if it'll work past midnight, if it 
doesn't I can work around that.  I found in a previous post to set the default 
schedule define:

/etc/puppet/manifests/site.pp
Schedule{
period   => hourly,
range=> "17:00 - 23:00",
}

(I set it so it wouldn't cross midnight first, after I get this working I can 
extend it and see if it still works)

The problem is that it looks like puppetd still processes everything even 
though it is outside the scheduled window.  What am I missing?

Thanks,
jl




--~--~-~--~~~---~--~~
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] Default Schedule

2009-04-01 Thread Justin Lambert
I am trying to set a default schedule and not having a lot of luck.  It doesn't 
look like they are used a whole lot and I've had a hard time finding 
documentation.  What I would ultimately like is for the default schedule to be 
daily from "17:00 - 03:00."  I'm not sure if it'll work past midnight, if it 
doesn't I can work around that.  I found in a previous post to set the default 
schedule define:

/etc/puppet/manifests/site.pp
Schedule{
period   => hourly,
range=> "17:00 - 23:00",
}

(I set it so it wouldn't cross midnight first, after I get this working I can 
extend it and see if it still works)

The problem is that it looks like puppetd still processes everything even 
though it is outside the scheduled window.  What am I missing?

Thanks,
jl


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