[Puppet Users] Re: RFC: Default File Permissions

2013-09-18 Thread Klavs Klavsen
This would be a GREAT benefit, and I for one, would definetely make it my 
File default :)

source_permissions is a fine name for it.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] if/or regex entry

2013-09-18 Thread Mike Reed
Thank you very much Peter.

I also found that putting the regex entry in single quotes - as in my above 
examples - does not give me the expected results.  As per your example, the 
regex entries are properly parsed when entries start and end with a forward 
slash.

I hope this helps somebody else down the line.

Cheers and thanks again.

Mike

On Wednesday, September 18, 2013 9:43:22 AM UTC-7, pmbuko wrote:
>
> On Sep 18, 2013, at 12:33 PM, Mike Reed > 
> wrote: 
>
> > Hello all, 
> > 
> > I've been fighting a pesky regex issue and I was hoping somebody might 
> have a solution handy.  I'm trying to evaluate the hostname variable based 
> on a few regex entries and apply some configurations accordingly. 
> > 
> > Here's what I've got: 
> > 
> > if ($hostname == '/^([a-z]*[-]\d{2,})*$/') or ($hostname == 
> '/^([a-zA-Z0-9])*$/') { 
> > 
> > another variant: 
> > 
> > if ($hostname == '/^([a-z]*[-]\d{2,})*$/') || ($hostname == 
> '/^([a-zA-Z0-9])*$/') { 
> > 
> > I expect the second option to work as it seems - according to my reading 
> - to be more "ruby friendly". 
> > 
> > Has anybody used this syntax successfully in the past?  Additionally, I 
> suspect I could be bastardizing this as I'm not familiar with ruby. 
> > 
> > Thanks in advance for the help. 
> > 
> > Cheers, 
> > 
> > Mike 
>
> Since you're doing regex matching you need to use the '=~' operator 
> instead of '==', like so: 
>
> if ( $::hostname =~ /^foo/ ) or ( $::hostname =~ /^bar/ ) { 
>
> -- 
> Peter Bukowinski

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] b64_zlib_yaml errros after server upgrade to

2013-09-18 Thread Patrick Carlisle
Do either of you happen to have multiple versions of the puppet installed
on the master? One through rubygems and one through yum? I've only been
able to reproduce this so far when I accidentally ran a 3.3.0 master that
loaded some code from 3.2.4.

If not, can you run the master with --trace and --debug flags and track
down the stack trace in the master's log?

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] b64_zlib_yaml errros after server upgrade to

2013-09-18 Thread Patrick Carlisle
On Tue, Sep 17, 2013 at 1:14 AM, Andrei-Florian Staicu <
andrei.sta...@gmail.com> wrote:

> Any idea if this is a recognized bug?


I don't think it is. Please file a bug report at
projects.puppetlabs.comand we can investigate this further.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Puppet requires second run to execute some catalog items.

2013-09-18 Thread Sam Tresler
Hi, I've inherited a puppet setup for automating php installation and 
extension management.  We're on Debian and we've encountered a strange 
issue that I've traced down back to puppet I think. I've stripped back the 
configuration and made the problem reproducible, logs and config pasted 
below. 

1. php5-common, php5-memcache, and php5-mysql are all installed. 
2. php5-common and php5-mysql receive an update, say from 5.3.3-7+squeeze14 
to 5.3.3-7+squeeze17
3. Puppet runs and php5-common upgrade conflicts. Apt's first solution 
removes php5-mysql and php5-memcache. 
4. Puppet continues run and re-installs/upgrades php5-mysql. It skips 
php5-memcache.
5. On a subsequent run php5-memcache is installed again as expected. 

This appears to only happen to packages that don't share the php5 version 
naming schema, but that may be just a clue, not a cause. e.g. php5-memcache 
is 3.0.4-4+squeeze1. 

I have: 

   package { "php5-common": ensure => latest }
   php_module { "mysql":
  ensure => $php5_mysql ? {
 '1' => 'enable',
 '0' => 'absent',
  },
   }
   php_module { "memcache":
  ensure => $php5_memcache ? {
 '1' => 'enable',
 '0' => 'absent',
  },
   }
   define php_module ( $ensure = 'enable' ) {
  if $ensure == "enable" {
 package {
   "php5-${name}": ensure => latest,
   require => [ Package[ 'php5-common'],  Package[ 'php5-cgi' ], 
Package[ 'php5' ], Package[ 'libapache2-mod-php5' ] ],
   }

  } else {
 package { "php5-${name}": ensure => absent }
  }
   }

In the debug of a run, I see (relevant lines only): 

231 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[memcache]/Package[php5-memcache]/require: 
requires Package[php5-common]^[[0m
232 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[memcache]/Package[php5-memcache]/require: 
requires Package[php5-cgi]^[[0m
233 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[memcache]/Package[php5-memcache]/require: 
requires Package[php5]^[[0m
234 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[memcache]/Package[php5-memcache]/require: 
requires Package[libapache2-mod-php5]^[[0m

327 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/require: 
requires Package[php5-common]^[[0m
328 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/require: 
requires Package[php5-cgi]^[[0m
329 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/require: 
requires Package[php5]^[[0m
330 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/require: 
requires Package[libapache2-mod-php5]^[[0m

487 ^[[0;36mDebug: Executing '/usr/bin/apt-cache policy php5-common'^[[0m
488 ^[[0;36mDebug: /Stage[main]/Php/Package[php5-common]/ensure: 
php5-common "5.3.3-7+squeeze14" is installed, latest is "5.3.3-7+sque   
 eze17"^[[0m
489 ^[[0;36mDebug: Executing '/usr/bin/aptitude -y -o 
DPkg::Options::=--force-confold install php5-common'^[[0m
490 ^[[mNotice: /Stage[main]/Php/Package[php5-common]/ensure: ensure 
changed '5.3.3-7+squeeze14' to '5.3.3-7+squeeze17'^[[0m
491 ^[[0;36mDebug: /Stage[main]/Php/Package[php5-common]: The container 
Class[Php] will propagate my refresh event^[[0m

547 ^[[0;36mDebug: Executing '/usr/bin/apt-cache policy php5-memcache'^[[0m

615 ^[[0;36mDebug: Executing '/usr/bin/apt-cache policy php5-mysql'^[[0m
616 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/ensure: 
php5-mysql "5.3.3-7+squeeze14" is installed, latest is 
"5.3.3-7+squeeze17"^[[0m
617 ^[[0;36mDebug: Executing '/usr/bin/aptitude -y -o 
DPkg::Options::=--force-confold install php5-mysql'^[[0m
618 ^[[mNotice: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/ensure: ensure 
changed '5.3.3-7+squeeze14' to '5.3.3-7+squeeze17'^[[0m
619 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]: The container 
Php::Php_module[mysql] will propagate my refresh event^[[0m
620 ^[[0;36mDebug: Php::Php_module[mysql]: The container Class[Php] will 
propagate my refresh event^[[0m



So, why, on line 547, when memcache is definitely not installed does it not 
install it? I've been on this for 3 days and am officially stumped. Any 
help would be appreciated. 

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: /var/opt/lib/pe-puppet/reports/$hostname yaml files not recent

2013-09-18 Thread root
Thanks for the response.  Alas, the Master has only reports for itself, and 
even those are not up to date.  It looks like Puppet Enterprise sends all 
the reports to PuppetDB.  Not sure why I have any yaml files at all in the 
reportdir.  

On Tuesday, September 17, 2013 2:34:57 PM UTC-4, Ellison Marks wrote:

> By default, reports are not stored on the individual nodes, but sent to 
> the master. There are some situations where local files get created, mostly 
> involving the node running standalone. Not sure if PE has different 
> defaults, but normally you should find all reports on the master, in the 
> directory specified by reportdir.
>
> http://docs.puppetlabs.com/references/latest/configuration.html#reportsYou 
> should check all the report* parameters on that page for correctness in 
> your environment.
>
> Details on the report formats is on this page. 
> http://docs.puppetlabs.com/references/latest/report.html
>
> An option to 'reports' that is oddly not mentioned on that page is the 
> puppetdb option, which is to store reports in puppetdb, and is described on 
> this page. 
> http://docs.puppetlabs.com/puppetdb/1.4/connect_puppet_master.html
>
> On Monday, September 16, 2013 9:10:05 AM UTC-7, root wrote:
>>
>> Still cannot figure out why I have such a variety of dates for the yaml 
>> files that exist in /var/opt/lib/pe-puppet/reports/`hostname` on each node. 
>> Each node is configured with "report = true", and the reports are 
>> supposedly being sent to the Master. Not sure at all why sometimes I get a 
>> local yaml file, and sometimes I don't.
>>
>> Anyway, I'm using Puppet Enterprise, and my reading of the docs tells me 
>> the Master is storing the info from each run in PuppetDB. Anyone have any 
>> luck extracting info from PuppetDB? Again, what I'm looking for is what 
>> Puppet changed or wants to change on each node. Thanks. 
>>
>> On Saturday, September 14, 2013 3:16:35 PM UTC-4, root wrote:
>>
>>> Cross-posted from Puppet Enterprise Users:
>>>
>>> Is Puppet Enterprise (3.0) supposed to create a yaml file in 
>>> /var/opt/lib/pe-puppet/reports/$hostname every time it runs?  Because the 
>>> files in this directory on all my nodes are not very consistent and they 
>>> are not recent.  If I do a puppet run on the node either through 
>>> the Console or manually on the the node, it does not create a new yaml 
>>> report file.
>>>  
>>> My bigger need is to generate my own custom reports from Puppet runs.  I 
>>> thought these yaml files would be easier to parse than the log messages 
>>> sent to syslog.  The information I want to display is a summary of what 
>>> Puppet found to change for particular class/modules.  
>>>  
>>> Thanks.
>>>
>>>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] "puppet module install simondean/iis" gives error "Error: cert already in hash table"

2013-09-18 Thread Samuel Huang
Yeah I rebooted, and it still didn't work.

On Monday, September 16, 2013 1:40:34 PM UTC-7, Rob Reynolds wrote:
>
> Yes, that is the one that I meant. I know you hate hearing this question, 
> but did you reboot after you removed it (prior to module install) for full 
> effect?
>
>
> On Mon, Sep 16, 2013 at 1:24 PM, Samuel Huang 
> > wrote:
>
>> If what you mean by Machine store is the Local Computer, I just deleted 
>> it from both Machine and Current User stores and still puppet module 
>> install does not work. Here's a screenshot of it appearing in the Machine 
>> store.
>>
>>
>> On Sunday, September 15, 2013 8:42:24 PM UTC-7, Rob Reynolds wrote:
>>
>>> Can you determine if the cert is also under Machine certificate store 
>>> and not just the Current User certificate store?
>>>
>>>
>>> On Fri, Sep 13, 2013 at 1:27 AM, Samuel Huang wrote:
>>>
 I deleted the cert you mentioned *(thatwte-timestamping.png)*, but I 
 still have the same error everyone's been mentioning *
 (module-install-fails.png)*. Any help please?

 Sam


 On Sunday, August 18, 2013 7:59:04 PM UTC-7, Robert Redgwell wrote:
>
> For what it's worth, I had the same problem and figured out the 
> particular cert on Windows 7 (64bit) that was causing the issue:
>
> ----
> --
> [Subject]
>   CN=Thawte Timestamping CA, OU=Thawte Certification, O=Thawte, 
> L=Durbanville, S=Western Cape, C=ZA
>
> [Issuer]
>   CN=Thawte Timestamping CA, OU=Thawte Certification, O=Thawte, 
> L=Durbanville, S=Western Cape, C=ZA
>
> [Serial Number]
>   00
>
> [Not Before]
>   1/01/1997 1:00:00 p.m.
>
> [Not After]
>   1/01/2021 12:59:59 p.m.
>
> [Thumbprint]
>   BE36A4562FB2EE05DBB3D32323ADF445084ED656
> ----
> --
>
> I found it under Trusted Root Certification Authorities.
> After deleting that, I no longer had the module/cert issue.
>
> On Wednesday, 17 July 2013 07:54:02 UTC+12, Josh Cooper wrote:
>>
>>
>>
>>
>> On Tue, Jul 16, 2013 at 11:19 AM, Arno den Uijl 
>> wrote:
>>
>>> I thought i tried the debug and trace options but i this trace was 
>>> new for me. I looked through the code and I think that it was caused by 
>>> the 
>>> fact that there were some certificates installed with the same name. I 
>>> deleted some from my certificate store and now it runs correct. 
>>>
>>> Thanks for the help. I do think that this can be an issue for more 
>>> people.
>>>
>>
>> I didn't realize MS cert store could contain duplicates. We should be 
>> more defensive of this, in general, to ensure the failure to add one 
>> cert 
>> doesn't stop puppet from running:
>>
>> begin
>>   add_cert(x509)
>> rescue OpenSSL::X509::StoreError => detail
>>   Puppet.warning "Failed to add certificate '#{x509.subject}'"
>> end
>>
>> Josh
>>
>> -- 
>> Josh Cooper
>> Developer, Puppet Labs
>>
>> *Join us at PuppetConf 2013, August 22-23 in San Francisco - *
>> http://bit.ly/pupconf13*
>> **Register now and take advantage of the Early Bird discount - save 
>> 25%!*
>>  
>  -- 
 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...@**googlegroups.com.
 To post to this group, send email to puppet...@googlegroups.com.

 Visit this group at 
 http://groups.google.com/**group/puppet-users
 .
 For more options, visit 
 https://groups.google.com/**groups/opt_out
 .

>>>
>>>
>>>
>>> -- 
>>> Rob Reynolds
>>> Developer, Puppet Labs
>>>
>>> Join us at PuppetConf 2014, September 23-24 in San Francisco
>>>  
>>  -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to puppet...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/puppet-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Rob Reynolds
> Developer, Puppet Labs
>
> Join us at PuppetConf 2014, September 23-24 in San Francisco
>  

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

[Puppet Users] questions about verifying template paths and variables with rspec

2013-09-18 Thread Corey Osman
Hi,

How can I verify the template exists in the given path?  Example,

Given the following in my manifest:

if $somevar == 'true' {
$templatefile='mymodule/mytemplate.xml.erb'
}
else {
$templatefile='mymodule/mytemplate2.xml.erb'
}
file{"somefile.txt":
ensure => present,
content => template($templatefile)
}


How can I test that the template file exists in the given module path?

File.exists?("../../../#{templatefile}").should be_true ???

Additionally can I test if the variable $templatefile or $somevar is correct 
and my logic is sane.  Is there a way to retrieve the manifest variables within 
spec tests?

example:

$somevar.should eq('true') ???



Corey


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] if/or regex entry

2013-09-18 Thread Mike Reed
Hello all,

I've been fighting a pesky regex issue and I was hoping somebody might have 
a solution handy.  I'm trying to evaluate the hostname variable based on a 
few regex entries and apply some configurations accordingly.

Here's what I've got:

if ($hostname == '/^([a-z]*[-]\d{2,})*$/') or ($hostname == 
'/^([a-zA-Z0-9])*$/') {

another variant: 

if ($hostname == '/^([a-z]*[-]\d{2,})*$/') || ($hostname == 
'/^([a-zA-Z0-9])*$/') {

I expect the second option to work as it seems - according to my reading - 
to be more "ruby friendly".

Has anybody used this syntax successfully in the past?  Additionally, I 
suspect I could be bastardizing this as I'm not familiar with ruby.

Thanks in advance for the help.

Cheers,

Mike

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Unable to specify hierarchy for data-in-modules

2013-09-18 Thread Igor Berger
Any ideas?


On Monday, September 16, 2013 11:30:42 AM UTC-4, Igor Berger wrote:
>
> Hello,
>
> I'm running Puppet agent stand-alone on Windows.
>
> I got data-in-modules working. However, no matter what I put into the 
> module hiera.yaml,
> I can only override the defaults from common.yaml by osfamily (and not, 
> e.g., by environment).
>
> In the setup below the following command outputs:
>
> >puppet apply --binder -e "notice lookup ('my_key')" --environment=local
> Notice: Scope(Class[main]): windows-value
> Notice: Compiled catalog for myhostname in environment local in 1.40 
> seconds
>
> And if I delete the osfamily directory, the same command outputs 
> "common-value".
>
> So, even though osfamily is not part of the hierarchy, it's used to 
> override the common value.
> Conversely, environment is part of the hierarchy, but it's not used.
>
> Did I miss anything?
>
> Thanks,
> Igor.
>
>
> Module structure:
>
> my_module/
> hiera.yaml
> data/
> common.yaml
> environment/
> local.yaml
> osfamily/
> windows.yaml
>
>
> hiera.yaml contains:
>
> ---
> version: 2
> hierarchy:
>   [
>['environment', '${environment}', 'data/environment/${environment}'],
>['common', 'true', 'data/common']
>   ]
>
>
> data/common.yaml contains:
>
> ---
> my_key: 'common-value'
>
>
> data/osfamily/windows.yaml contains:
>
> ---
> my_key: 'windows-value'
>
>
> data/environment/local.yaml contains:
>
> ---
> my_key: 'local-value'
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] if/or regex entry

2013-09-18 Thread Peter Bukowinski
On Sep 18, 2013, at 12:33 PM, Mike Reed  wrote:

> Hello all,
> 
> I've been fighting a pesky regex issue and I was hoping somebody might have a 
> solution handy.  I'm trying to evaluate the hostname variable based on a few 
> regex entries and apply some configurations accordingly.
> 
> Here's what I've got:
> 
> if ($hostname == '/^([a-z]*[-]\d{2,})*$/') or ($hostname == 
> '/^([a-zA-Z0-9])*$/') {
> 
> another variant: 
> 
> if ($hostname == '/^([a-z]*[-]\d{2,})*$/') || ($hostname == 
> '/^([a-zA-Z0-9])*$/') {
> 
> I expect the second option to work as it seems - according to my reading - to 
> be more "ruby friendly".
> 
> Has anybody used this syntax successfully in the past?  Additionally, I 
> suspect I could be bastardizing this as I'm not familiar with ruby.
> 
> Thanks in advance for the help.
> 
> Cheers,
> 
> Mike

Since you're doing regex matching you need to use the '=~' operator instead of 
'==', like so:

if ( $::hostname =~ /^foo/ ) or ( $::hostname =~ /^bar/ ) {

--
Peter Bukowinski

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Some php5 extensions not installed until a second run

2013-09-18 Thread Sam Tresler
Hi, I've inherited a puppet setup for automating php installation and 
extension management.  We're on Debian and we've encountered a strange 
issue that I've traced down back to puppet I think. I've stripped back the 
configuration and made the problem reproducible, logs and config pasted 
below. 

1. php5-common, php5-memcache, and php5-mysql are all installed. 
2. php5-common and php5-mysql receive an update, say from 5.3.3-7+squeeze14 
to 5.3.3-7+squeeze17
3. Puppet runs and php5-common upgrade conflicts. Apt's first solution 
removes php5-mysql and php5-memcache. 
4. Puppet continues run and re-installs/upgrades php5-mysql. It skips 
php5-memcache.
5. On a subsequent run php5-memcache is installed again as expected. 

This appears to only happen to packages that don't share the php5 version 
naming schema, but that may be just a clue, not a cause. e.g. php5-memcache 
is 3.0.4-4+squeeze1. 

I have: 

   package { "php5-common": ensure => latest }
   php_module { "mysql":
  ensure => $php5_mysql ? {
 '1' => 'enable',
 '0' => 'absent',
  },
   }
   php_module { "memcache":
  ensure => $php5_memcache ? {
 '1' => 'enable',
 '0' => 'absent',
  },
   }
   define php_module ( $ensure = 'enable' ) {
  if $ensure == "enable" {
 package {
   "php5-${name}": ensure => latest,
   require => [ Package[ 'php5-common'],  Package[ 'php5-cgi' ], 
Package[ 'php5' ], Package[ 'libapache2-mod-php5' ] ],
   }

  } else {
 package { "php5-${name}": ensure => absent }
  }
   }

In the debug of a run, I see (relevant lines only): 

231 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[memcache]/Package[php5-memcache]/require: 
requires Package[php5-common]^[[0m
232 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[memcache]/Package[php5-memcache]/require: 
requires Package[php5-cgi]^[[0m
233 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[memcache]/Package[php5-memcache]/require: 
requires Package[php5]^[[0m
234 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[memcache]/Package[php5-memcache]/require: 
requires Package[libapache2-mod-php5]^[[0m

327 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/require: 
requires Package[php5-common]^[[0m
328 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/require: 
requires Package[php5-cgi]^[[0m
329 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/require: 
requires Package[php5]^[[0m
330 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/require: 
requires Package[libapache2-mod-php5]^[[0m

487 ^[[0;36mDebug: Executing '/usr/bin/apt-cache policy php5-common'^[[0m
488 ^[[0;36mDebug: /Stage[main]/Php/Package[php5-common]/ensure: 
php5-common "5.3.3-7+squeeze14" is installed, latest is "5.3.3-7+sque   
 eze17"^[[0m
489 ^[[0;36mDebug: Executing '/usr/bin/aptitude -y -o 
DPkg::Options::=--force-confold install php5-common'^[[0m
490 ^[[mNotice: /Stage[main]/Php/Package[php5-common]/ensure: ensure 
changed '5.3.3-7+squeeze14' to '5.3.3-7+squeeze17'^[[0m
491 ^[[0;36mDebug: /Stage[main]/Php/Package[php5-common]: The container 
Class[Php] will propagate my refresh event^[[0m

547 ^[[0;36mDebug: Executing '/usr/bin/apt-cache policy php5-memcache'^[[0m

615 ^[[0;36mDebug: Executing '/usr/bin/apt-cache policy php5-mysql'^[[0m
616 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/ensure: 
php5-mysql "5.3.3-7+squeeze14" is installed, latest is 
"5.3.3-7+squeeze17"^[[0m
617 ^[[0;36mDebug: Executing '/usr/bin/aptitude -y -o 
DPkg::Options::=--force-confold install php5-mysql'^[[0m
618 ^[[mNotice: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]/ensure: ensure 
changed '5.3.3-7+squeeze14' to '5.3.3-7+squeeze17'^[[0m
619 ^[[0;36mDebug: 
/Stage[main]/Php/Php::Php_module[mysql]/Package[php5-mysql]: The container 
Php::Php_module[mysql] will propagate my refresh event^[[0m
620 ^[[0;36mDebug: Php::Php_module[mysql]: The container Class[Php] will 
propagate my refresh event^[[0m



So, why, on line 547, when memcache is definitely not installed does it not 
install it? I've been on this for 3 days and am officially stumped. Any 
help would be appreciated. 

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Trouble using the dns_alt_names config option

2013-09-18 Thread Sven Milinski
Hello,

same problem here... anybody knows what todo ? Running Puppet 3.2.4...


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: b64_zlib_yaml errros after server upgrade to

2013-09-18 Thread Henrik Nicolaisen
I also have this error after upgrading my server to 3.3.0 on an ubuntu 12.04

Old clients with 3.2.4 says :

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Could not intern from b64_zlib_yaml: invalid code lengths set


Clients with the new 3.3.0 version says :

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Could not intern from pson: source '%7B%22values%22%3A%7' not in PSON!


And a trace looks like this :

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Could not intern from pson: source '%7B%22values%22%3A%7' not in PSON!
/usr/lib/ruby/vendor_ruby/puppet/indirector/rest.rb:185:in `is_http_200?'
/usr/lib/ruby/vendor_ruby/puppet/indirector/rest.rb:100:in `find'
/usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:197:in `find'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:260:in `retrieve_new_catalog'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:354:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:353:in `thinmark'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:259:in `retrieve_new_catalog'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:69:in `retrieve_catalog'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:109:in 
`prepare_and_retrieve_catalog'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:169:in `run'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:45
/usr/lib/ruby/vendor_ruby/puppet/agent/locker.rb:20:in `lock'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:45
/usr/lib/ruby/1.8/sync.rb:230:in `synchronize'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:45
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:119:in `with_client'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:42
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:84:in `run_in_fork'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:41
/usr/lib/ruby/vendor_ruby/puppet/application.rb:179:in `call'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:179:in `controlled_run'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:39:in `run'
/usr/lib/ruby/vendor_ruby/puppet/application/agent.rb:360:in `onetime'
/usr/lib/ruby/vendor_ruby/puppet/application/agent.rb:326:in `run_command'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:457:in `plugin_hook'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:511:in `exit_on_fail'
/usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
/usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:86:in `execute'
/usr/bin/puppet:4
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run


What other tests could I do to debug this further?

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Fail/stop after a step fails?

2013-09-18 Thread Chris McDermott
Try the fail() function. Something like this:

if ($continue != true) {
  fail('Condition not met, failing now.')
}


On Tue, Sep 17, 2013 at 1:36 PM, Robin Lee Powell <
rlpow...@digitalkingdom.org> wrote:

> On Tue, Sep 17, 2013 at 12:35:15PM -0700, Robin Lee Powell wrote:
> >
> > Is it possible to get puppet to just *give up* if a particular
> > step fails?  Thousands upon thousands of "Skipping because of
> > failed dependencies" gets really old.
>
> Or, indeed, have it stop after a particular step *succeeds* would be
> fine too.
>
> -Robin
>
> --
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Using a varaible from another virtual resource?

2013-09-18 Thread jcbollinger


On Wednesday, September 18, 2013 6:03:27 AM UTC-5, Roman wrote:
>
> Hi everyone,
>
> i am currently trying to reduce some redundancy in my puppet-setup. I have 
> setup user-account using virtual-resources like this:
>
> @users::account { 'xyz':
> uid => '1000',
> ...
> key => 'AAAsfhjujbh...'
> }
>
> Now i have written another simple module to setup mercurial-repositories 
> with hgssh3 access-protection which uses the same 'key' as above, but i 
> have to specify the key a 2nd time for the hgssh3-class:
>
> class hgssh3 ( $users=['',''] ) {
>   "/home/$name/.ssh/authorized_keys":
> ensure => file,
> replace => false,
> mode   => 600,
> content => template('hgssh3/authorized_keys.erb');
> ...
> }
>
> I was thinking i could somehow use the key-variable from the first class 
> in a the template of hgssh3 and just specify the user who should get 
> access? Is this at all possible?
>
> Thanks for every little hint or link ;)
>
> best regards,
> Roman
>
>
You cannot easily -- and anyway should not try to -- introspect declared 
resources.  It will cause you trouble, guaranteed.  You can, however, 
factor out data that are needed by multiple classes to some place where it 
is accessible to all of them.  In this case, for example, you can create a 
hash somewhere mapping usernames to their keys, and have the user::account 
declarations and the hgssh3 class both match keys to users by looking up 
the user names in the same hash.  The hash might live in a well-known class 
variable somewhere, or it could be loaded from external data at need (or 
both).


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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Creating multiple redis instances

2013-09-18 Thread jcbollinger


On Tuesday, September 17, 2013 6:36:54 PM UTC-5, Charles Mean wrote:
>
> My question is, why the "define" redisInstance cannot create multiple 
> instances when I use the "include" directive, but when I call the "file" 
> directive into the define it create as many instances as I want ? 
> For example, If I use the include directive and call de define as the 
> following:
> redis::params::redisInstance {
>   "redis_6379": redis_port=> "6379", redis_host=> 
> "192.168.100.97", slaveof   => "127.0.0.1", master_port   => "6872";
>   "redis_6380": redis_port=> "6380", redis_host=> 
> "192.168.100.98", slaveof   => "127.0.0.1", master_port   => "6880";
>   }
> It just creats a single instance(6379) and not the second one(6380).
>


It is a fundamental Puppet concept that classes are singletons.  That means 
assigning the same class to a node multiple times (e.g. via 'include') 
doesn't mean anything more than assigning it once.  This turns out to be 
very useful.

Defined types, on the other hand, are resource types, very much analogous 
to built-in types such as File.  Like any other resource type, you can 
declare multiple instances of a defined type, and each is distinct from the 
others.


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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Using a varaible from another virtual resource?

2013-09-18 Thread Nick Cammorato
The puppetlabs-stdlib module includes a getparam function that you can use
to retrieve a resource parameter if you know the resource type, name and
parameter you want to retrieve(which may fit your use case, I'm a little
unclear).  You can see it here:
https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/lib/puppet/parser/functions/getparam.rb

If you want more than that, you'd have to write a custom function.  I'm
actually working on a set of functions/types to bucket arbitrary data and
then retrieve it in array form for a couple of my own internal use cases -
I wouldn't use it yet:  but you can see what I have so far here -
https://github.com/TERC/puppet-databucket

Hope that helped,
--Nick



On Wed, Sep 18, 2013 at 7:03 AM, Roman  wrote:

> Hi everyone,
>
> i am currently trying to reduce some redundancy in my puppet-setup. I have
> setup user-account using virtual-resources like this:
>
> @users::account { 'xyz':
> uid => '1000',
> ...
> key => 'AAAsfhjujbh...'
> }
>
> Now i have written another simple module to setup mercurial-repositories
> with hgssh3 access-protection which uses the same 'key' as above, but i
> have to specify the key a 2nd time for the hgssh3-class:
>
> class hgssh3 ( $users=['',''] ) {
>   "/home/$name/.ssh/authorized_keys":
> ensure => file,
> replace => false,
> mode   => 600,
> content => template('hgssh3/authorized_keys.erb');
> ...
> }
>
> I was thinking i could somehow use the key-variable from the first class
> in a the template of hgssh3 and just specify the user who should get
> access? Is this at all possible?
>
> Thanks for every little hint or link ;)
>
> best regards,
> Roman
>
>
>
>  --
> 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Puppet ignores schedules

2013-09-18 Thread jcbollinger


On Tuesday, September 17, 2013 5:37:36 AM UTC-5, jamido wrote:
>
> Hello, 
>
> the following small code works, but the file /tmp/test will never be 
> created because the schedule is skipped because running on an host.
>


You are misinterpreting the output.  File['/tmp/test'] is not applied 
because the schedule assigned to it does not allow it to be applied during 
that run.  *As a separate issue*, the schedule resource itself is not 
applied to the target node, but that's meaningless because schedules have 
no physical manifestation on nodes.

You may also be misunderstanding schedules in general.  In particular, they 
do not schedule a resource to be applied at some later time; instead, they 
restrict whether resources can be applied during the current run.  The 
schedule you are using says that each resource it is attached to can be 
applied only between 02:00 and 04:00 local time, and at most once a day.  
For it to be applied at all, the agent must run during the specified time 
window.  If you are testing outside that window then you should always see 
the File skipped.


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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: hostname appears in classes.txt

2013-09-18 Thread mark bradley
Hi,

It was a problem with my script that updates the git repository.
Embarrassingly, Puppet was doing the right thing, which was "do nothing".


On Sat, Sep 14, 2013 at 6:22 AM, Rahul Khengare wrote:

> Hello Mark,
>can you post what is the problem you faced and how you solved, this
> will be helpful for community... :)
>
> Thanks and regards,
> Rahul Khengare
> NTT DATA OSS Center, pune, India.
>
> On 9/14/13, mark bradley  wrote:
> > Hello Rahul,
> >
> > I've found the problem -- error on my part :(
> >
> > Thanks for the suggestions anyway ..
> >
> > Mark
> >
> >
> > On Fri, Sep 13, 2013 at 9:31 AM, mark bradley 
> wrote:
> >
> >> Hi Rahul,
> >>
> >> Thanks for the reply!
> >>
> >> First of all, the problem is that the class that the node belongs to
> >> isn't
> >> being "realized" (that is, files that are installed on other nodes of
> >> that
> >> class aren't being installed on this problematic node).
> >>
> >> Also, I cannot find the --loadclasses option in
> >> http://docs.puppetlabs.com/man/agent.html and the binary also complains
> >> .. can you expand on this?
> >>
> >> Thanks,
> >> Mark
> >>
> >>
> >> On Fri, Sep 13, 2013 at 9:11 AM, Rahul Khengare
> >> wrote:
> >>
> >>> Hi Mark,
> >>>The classes.txt file contains all the classes which is to be
> executed
> >>> on agent. It also contains hostname. So the hostname in classes.txt
> file
> >>> is
> >>> not a problem.
> >>> Check out the classes present in your manifests which is to be apply on
> >>> agent are present in classes.txt. If not present then you can run
> puppet
> >>> agent as,
> >>>
> >>> # puppet agent --test --loadclasses
> >>>
> >>> Can you explain your problem in details like which file is not pick by
> >>> puppet. Also give your manifests code.
> >>>
> >>> Thanks and Regards,
> >>> Rahul Khengare,
> >>> NTT DATA OSS Center, Pune, India.
> >>>
> >>>
> >>> On Friday, September 13, 2013 6:02:26 AM UTC+5:30, Mark wrote:
> 
>  Although I have a node defined (puppet agent --test runs without
> error)
>  the agent does not pick up files that it should be accessing and I've
>  noticed that the hostname appears in classes.txt.
> 
>  Does anyone have a notion of what's happening? Could it be that my
> node
>  isn't being recognized as belonging to the class defined on the
> server?
> 
>  Mark
> 
> >>>  --
> >>> 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.
> >>> For more options, visit https://groups.google.com/groups/opt_out.
> >>>
> >>
> >>
> >
> > --
> > You received this message because you are subscribed to a topic in the
> > Google Groups "Puppet Users" group.
> > To unsubscribe from this topic, visit
> > https://groups.google.com/d/topic/puppet-users/2DbzVFVWAG8/unsubscribe.
> > To unsubscribe from this group and all its topics, 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.
> > 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.
> 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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] ENC paramater interpolation in ENC, and inline templates

2013-09-18 Thread Jason Antman
I'm in the process of rolling out a new homegrown ENC (we've decided on
using an ENC over hiera; I know it's not the way a lot of you are going,
but it's right for us) and am running into some issues with variable
interpolation in ENC data.

To give a concrete example, I'm using modules to configure puppetdb,
puppet master, and puppet clients. So, there's a bunch of shared data
within an environment (like the server name, port, etc.). What I'd like
to do is have my ENC set a top-level param hash like:
puppet_config:
server: puppet.example.com
port: 8140
puppetdb_host: puppetdb.example.com

and then interpolate that into my ENC-specified classes like:
classes:
puppet::client:
server: "${puppet_config[server]}"

So as far as I can tell, I'm running into two isses:
1) There's no real hash interpolation, only inline templates. And I
assume that I can't put an inline template as the value of a class
param. So it looks like that's not going to be solved any time soon.
2) Even if I ditch the hash and just use straight params, i.e.

classes:
interpolate_test:
ival: "${::my_ival}"
parameters:
my_ival: param_ival_value

and then in interpolate_test:
class interpolate_test($ival) {

  notice("interpolate_test - value of ival is ${ival}")
  notice("interpolate_test - value of ::my_ival is ${::my_ival}")
}

I end up seeing:

Notice: Scope(Class[Interpolate_test]): interpolate_test - value of ival
is ${::my_ival}
Notice: Scope(Class[Interpolate_test]): interpolate_test - value of
::my_ival is param_ival_value

Any ideas on how to get this to work? Is it even possible? Or do I just
need to throw up my hands, and decide that either:
a) I can't use ENC params that way, so I'm just going to have to define
these params over and over again and try to keep the same values in
every place,
or,
b) I need to (yuck) build pre-YAML-serialization variable interpolation
*into my ENC*...

Thanks for any advice,
Jason Antman

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] default data lookup w/ hiera2? "Data in Modules"

2013-09-18 Thread Henrik Lindberg


On 2013-16-09 20:34, robbyt wrote:

Henrik,

Thank you for your quick response. Sorry mine wasn't so quick- Google
ate my message, perhaps it contained too many curly braces. :)

Anyhow, adding a default argument option to lookup() would be great. But
adding the option to pass a hash with keyword arguments would be even
better!

Python solved the API UI for this quite well with **, and *.
http://docs.python.org/release/2.7.4/tutorial/controlflow.html#keyword-arguments
and
http://docs.python.org/release/2.7.4/tutorial/controlflow.html#unpacking-argument-lists

Imo, the 2nd positional argument of the lookup() function should accept
ONLY a hash. Otherwise, what would I do if I want to set a hash to BE
the default argument?

e.g.,

1st Positional argument as a hash?
Ambiguous positional argument (error!)
lookup('namespace::some_hash', {'my_key' => 'my_value'})

More explicit, better:
lookup('namespace::some_hash', { type => 'Hash', default => {'my_key' =>
'my_value'} })



Here are the possible alterantives:

arity 1: String key
arity 1: Hash options
arity 2: String key, String | Type type
arity 2: String key, Hash options
arity 3: String key, String | Type type, Object default_value

Regards
- henrik

--
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Sshkey[hostname]: Could not evaluate: Field 'type' is required

2013-09-18 Thread Steffen Flemming
On some hosts i get:
Notice: /Stage[main]/Trustedhosts/Sshkey[hostname]/key: key changed 
'quHqi6XkksBB3NzaC1yc2EBIwAAAQEAvVmR8qyRkOlHnblUHDh' to 
'CJp+NZwm0cx3UJY/dw+jYdWpWMQ8vHZr4IrDuKrN364+Necn9NzqdDnj40ji9j+qsBEUUBC06GlHFV6+6dH8zzboLPchyMOsU8Fu9ev/LgqE7+LW9fJ/uJjkobqs4MB3dH1B3NzaC1yc2EBIwAAAQEAquHqi6XkksBvVmR8qyRkOlHnblUHDhyrmAAJb6VD9O9PLM+PNQy+gWgoaeQlIKpZ59XLVvageKT+1bo5bWN5zjbC1YcxnMr56tSPGYtNfT6JM5+3s+SVakf5ojHl6hw5CkJhlY1iI9+qzVR9jP5GSsfmLQ=='
Error: /Stage[main]/Trustedhosts/Sshkey[hostname]: Could not evaluate: 
Field 'type' is required

modules/trustedhosts/manifests/init.pp :

 #add key from ssh-keyscan HOSTNAME
   class trustedhosts{
   sshkey { 'hostname':
   ensure=>present,
   type => 'rsa',
   name=>'hostname',
  
 key=>'quHqi6XkksBB3NzaC1yc2EBIwAAAQEAvVmR8qyRkOlHnblUHDh',
  }
...



-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Run a custom function through the ruby debugger

2013-09-18 Thread Henrik Lindberg

Here is how to invoke the function 'fqdn_rand(30)' in irb

irb > require 'puppet'
irb > scope => Puppet::Parser::Scope.new_for_test_harness('localhost')
irb>> scope.function_fqnrand([30])

=> "1"

That may not work if your function requires a fully configured system.
If you need that set the breakpoint inside your function, and then 
invoke with

puppet apply - i.e. puppet apply -e 'notice fqdn_rand(30)'

A good approach is to start with an rspec test for your function, then
you can invoke that when you want to debug. Look at 
spec/unit/parser/functions/fqdn_rand_spec.rb for an example how to test 
a function.


Hope that helps
- henrik

On 2013-17-09 14:19, Andrea Ieri wrote:

Hallo,
I'm developing a custom function that is exhibiting some odd behavior,
so I would like to debug it.
How do I load it in the ruby shell in a way that lets me execute it?
I have tried the steps on the documentation:

irb(main):001:0> require 'puppet'

=> true

irb(main):002:0> require 'phash2text.rb'

=> true

irb(main):003:0> Puppet::Parser::Functions.function(:hash2text)

=> "function_hash2text"

irb(main):004:0> function_hash2text

NameError: undefined local variable or method
`function_hash2text' for main:Object

from (irb):4

from :0


But how can I actually execute the function?


Thanks,
Andrea

--
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.
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Not able to capture node info via browser

2013-09-18 Thread Ken Barber
> If I run below command on puppet master. I am able to get output pasted
> here.
> But the same information, I am trying to capture via browser using
> http://puppetdb:8080/v2/facts/operatingsystembut not working

Well, a browser probably won't work trying to traverse that URL
anyway, since a browser will send Accept: text/html instead of
application/json, however I'm not quite sure what you are trying to
achieve. In short, this is an API end-point, not for browsers to
traverse.

> [root@puppetmaster ~]curl -X GET
> http://puppetdb:8080/v2/facts/operatingsystem
> curl: (6) Couldn't resolve host 'puppetdb'

The clue here is "Couldn't resolve host 'puppetdb'" ... this is a host
resolution issue occurs everywhere when resolution fails, nothing to
do with PuppetDB specifically. Check your Host entries to make sure
that the entry exists: http://en.wikipedia.org/wiki/Hosts_(file)

ken.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Not able to capture node info via browser

2013-09-18 Thread Raju Patil

On Wednesday, 18 September 2013 16:59:29 UTC+5:30, Raju Patil wrote: 
>
>  If I run below command on puppet master. I am able to get output pasted 
> here.
> But the same information, I am trying to capture via browser using 
> http://puppetserverip:8080/v2/facts/operatingsystem   but not working
>  
>  
>  
> [root@puppetmaster ~]# curl -X GET 
> http://localhost:8080/v2/facts/operatingsystem
> [ {
>   "certname" : "es-w2k8sql2k804.vshimslab.com",
>   "name" : "operatingsystem",
>   "value" : "windows"
> }, {
>   "certname" : "infafr00012.nmumarl.lntinfotech.com",
>   "name" : "operatingsystem",
>   "value" : "CentOS"
> }, {
>   "certname" : "puppetmaster",
>   "name" : "operatingsystem",
>   "value" : "CentOS"
>
 

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Not able to capture node info via browser

2013-09-18 Thread Raju Patil
If I run below command on puppet master. I am able to get output pasted 
here.
But the same information, I am trying to capture via browser using 
http://puppetdb:8080/v2/facts/operatingsystembut not working
 
 
 
[root@puppetmaster ~]curl -X GET 
http://puppetdb:8080/v2/facts/operatingsystem
curl: (6) Couldn't resolve host 'puppetdb'
[root@puppetmaster ~]# curl -X GET 
http://localhost:8080/v2/facts/operatingsystem
[ {
  "certname" : "es-w2k8sql2k804.vshimslab.com",
  "name" : "operatingsystem",
  "value" : "windows"
}, {
  "certname" : "infafr00012.nmumarl.lntinfotech.com",
  "name" : "operatingsystem",
  "value" : "CentOS"
}, {
  "certname" : "puppetmaster",
  "name" : "operatingsystem",
  "value" : "CentOS"

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Using a varaible from another virtual resource?

2013-09-18 Thread Roman
Hi everyone,

i am currently trying to reduce some redundancy in my puppet-setup. I have 
setup user-account using virtual-resources like this:

@users::account { 'xyz':
uid => '1000',
...
key => 'AAAsfhjujbh...'
}

Now i have written another simple module to setup mercurial-repositories 
with hgssh3 access-protection which uses the same 'key' as above, but i 
have to specify the key a 2nd time for the hgssh3-class:

class hgssh3 ( $users=['',''] ) {
  "/home/$name/.ssh/authorized_keys":
ensure => file,
replace => false,
mode   => 600,
content => template('hgssh3/authorized_keys.erb');
...
}

I was thinking i could somehow use the key-variable from the first class in 
a the template of hgssh3 and just specify the user who should get access? 
Is this at all possible?

Thanks for every little hint or link ;)

best regards,
Roman



-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] rake problem for dashboard

2013-09-18 Thread Thomas
I've setup a new puppet master and I'm having trouble with running 
dashboard rake commands. Any advise on why I may be getting this error 
would be appreciated!

Thanks, Thomas


sh-4.1# pwd
/usr/share/puppet-dashboard
sh-4.1# sudo -u puppet-dashboard rake RAILS_ENV=production jobs:work
/usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could 
not find rake (>= 0) amongst [] (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:256:in 
`to_spec'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1231:in `gem'
from /usr/bin/rake:22
sh-4.1# gem list

*** LOCAL GEMS ***

json (1.5.5)
rake (10.0.3)
stomp (1.2.2)
sh-4.1# which rake
/usr/bin/rake
sh-4.1# rake --version
rake, version 10.0.3


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Cloud provisionner on CentOS 6 issue

2013-09-18 Thread Vincent Nawrocki
Hi !

I am currently testing puppet on CentOS 6 and I wish to test the cloud 
provisioner tool.
The problem is the following : I can't use fog because of ruby version 
issue.

The system : CentOS 6.4 with Ruby 1.8.7 (last version for CentOS)

What I did to get the problem :
install puppet-server
install module puppetlabs-cloud_provisioner
Trying install Fog -v 0.7.2 (cloud service library in ruby) but a 
dependence of it need a newer version of ruby (at least 1.9.2).
So I installed RVM and then ruby 1.9.2 to be able to install fog and all 
its dependencies, it worked fine.
Install guid gem (required by cloud_provisioner)

Then I did : export RUBYLIB=/etc/puppet/modules/cloud_provisioner/lib:$RUBYLIB

After this, PuppetLabs suggests to test if the installation worked fine by 
executing :
# puppet help node_aws

Here is the result :
[root@poste403 ~]# puppet help node_aws
/usr/local/rvm/gems/ruby-1.9.2-p320/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.so:
 [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
Abandon (core dumped)

I really don't understand why this.
If anyone encountered this problem before, thanks for help.

Vincent

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet to install and rollback using single module.

2013-09-18 Thread David Schmitt

Hi,

Alessandro's modules at http://github.com/example42 do install/rollback 
all the time.


You might want to look at them how they do it.


Regards, David

On 2013-09-16 11:31, Chatchai Neanudorn wrote:

Hi all,

I would like to provide installation and rollback for any module. Here
are was I've tried but not work,

At modules/katie/manifests/init.pp

class katie::add {
tag 'add'
user {'katie':
ensure => present,
}
}
class katie::remove {
tag 'remove'
user {'katie':
ensure => absent,
}
}

class katie {
include katie::remove, katie::remove
}

test command,

[root@centos ~]# puppet agent --test --tags add
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/pip_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/python_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: Duplicate declaration: User[katie] is already declared in file
/etc/puppet/modules/katie/manifests/init.pp:5; cannot redeclare at
/etc/puppet/modules/katie/manifests/init.pp:12 on node centos.local
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
[root@centos ~]#

If this is not the way to go, is there any alternative to get the
install/rollback?

Thanks you,

--
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.
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.
For more options, visit https://groups.google.com/groups/opt_out.