Re: [Puppet Users] "puppet apply --noop -e" and overiding facter values for testing

2014-05-07 Thread Peter
Hi Brian,

Sorry about the delay in responding.  Unfortunately eval didn't work or at 
least fqdn does not output the value I set it to in test_values.

I am just going to rework my testing to dump a file into 
/etc/facter/facts.d and remove it after use.  Not ideal but it works with 
the least amount of fussing around.  I would have loved to get the 
commandline option working as I would not have to add and remove files when 
I am testing things out.

Thanks,

Peter.

On Tuesday, 6 May 2014 08:29:35 UTC+10, Brian Mathis wrote:
>
> The problem is that your variable names are being returned from the 
> $(cat...) after bash has already evaluated the environment, so it's taking 
> it as a literal string and trying to execute the command.
>
> To get bash to interpret it as a variable, use 'eval':
>eval $(cat test_values | tr '\n' ' ' ) puppet apply --noop -e 
> 'notice("${fqdn}")'
>
> Also, on modern versions of facter you can place facts in 
> /etc/facter/facts.d and they will override the detected versions.
>
>
> ❧ Brian Mathis
>
>
> On Sat, May 3, 2014 at 7:41 AM, Peter >wrote:
>
>> Hi Puppet Users,
>>
>> Firstly I already know that I can override facter variables by adding 
>> them to the commandline.  Eg:
>>
>> root@dna:~# FACTER_fqdn=foo.bar.info puppet apply --noop -e 
>> 'notice("${fqdn}")'
>> Notice: Scope(Class[main]): foo.bar.info
>> Notice: Compiled catalog for dna.local in environment production in 0.03 
>> seconds
>> Notice: Finished catalog run in 0.04 seconds
>>
>> I would like to use a number of different FACTER overrides, I can add 
>> them all to the command line but I want to test different values at 
>> different times.  I was hoping that I could have a file like:
>> root@dna:~# cat test_values
>> FACTER_hostname=bob
>> FACTER_domain=mgnt.local
>> FACTER_fqdn=bob.mgnt.local
>> FACTER_foo=foo
>>
>> Then like with the hiera command line tool use an option to tell puppet 
>> apply to use this file and override any facts with the same name.  However 
>> there isnt an option.
>>
>> I have found a bash command which will take the values from the file and 
>> concat them together to form one line:
>> root@dna:~# cat test_values | tr '\n' ' '
>> FACTER_hostname=bob FACTER_domain=mgnt.local FACTER_fqdn=bob.mgnt.local 
>> FACTER_foo=foo
>>
>> I was then hoping I could do something like:
>> root@dna:~# $(cat test_values | tr '\n' ' ' ) puppet apply --noop -e 
>> 'notice("${fqdn}")'
>> -bash: FACTER_hostname=bob: command not found
>>
>> However it doesn't work.
>>
>> My question is, does anyone know a puppet way pass a file to puppet apply 
>> which will override facts or if there are any bash experts out there how I 
>> can have the output of the command as plan text.
>>
>> Thanks,
>>
>> Peter
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/fc389ac2-c451-434e-804e-1bbaf9e00117%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/77d17835-f944-4256-93b6-82eeff86400a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Error on my puppet Agent

2014-05-07 Thread twm139


On Wednesday, May 7, 2014 1:31:03 PM UTC-7, twm...@gmail.com wrote:
>
> Hi, 
>
> I am very new to Puppet. I am running 3.5.1 via Foreman proxy. 
>
> I unfortunately getting the following error on my client when I attempt to 
> register its cert with the master.  
>
> #  puppet agent --server myserver.domain --waitforcert 60 --test
> Error: Could not request certificate: Error 400 on SERVER: no 
> 'environments' in 
> {:current_environment=># @name=:"*root*", @manifest="/etc/puppet/rack", @modulepath=[]>, 
> :root_environment=># @name=:"*root*", @manifest="/etc/puppet/rack", @modulepath=[]>} at top of []
>
> Clearly I have something I have not setup or configured, but it is not 
> clear based on the error what that might be. 
>
> Anyone have any suggestions on how I might proceed?
>
> Thanks,
>
> Terrence
>
>

So I think the issue may be some where in the Foreman proxy configuration. 
I am basing that assumption on the output of the following commands. 

[root@cabinet-4-4-0 puppet]#   curl -k -H "Content-Type:application/json" 
-H "Accept:application/json" 
https://t2gw03.t2.ucsd.edu:8443/puppet/environments
["development","production"]

[root@cabinet-4-4-0 puppet]#   curl -k -H "Content-Type:application/json" 
-H "Accept:application/json" 
https://t2gw03.t2.ucsd.edu:8140/puppet/environments
no 'environments' in 
{:current_environment=>#, 
:root_environment=>#} at top of []

Foreman version is 1.4.2. 



-- 
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/bf4497b0-6713-4f7f-a84f-1678b33a6ec8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: rspec testing and viewing the catalogue it is testing

2014-05-07 Thread Denmat
Hi,

You need to include the puppet logging in you rspec file.

I can't remember what that is off the top of my head but I'm pretty sure this 
will help you along the way.


http://www.ruempler.eu/2012/04/03/puppet-rspec-debugging/?mobile=1


> On 8 May 2014, at 0:42, choffee  wrote:
> 
> Am I doing this wrong?
> 
> I create a test that says "check for a file named foo", write some code that 
> should create the file. It fails for whatever reason and the test just says 
> no.
> 
> How do I get a clue what I am doing wrong? It seems obvious to me that having 
> the catalog that was tested against for that test would mean I could see my 
> error rather than having to guess and test again.
> 
> john
> 
>> On Wednesday, 7 May 2014 13:38:22 UTC+1, choffee wrote:
>> I am trying to debug why my test is failing and not producing a file that I 
>> thought it should be.
>> 
>> Is there a simple way to view the catalogue that rspec is testing against?
>> 
>> I tried --debug in the .rspec file with the debugger gem and it gives no 
>> extra errors is there something more I need to add to my test to turn it on?
>> 
>> Thanks 
>> 
>> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/e743953c-6175-4193-a620-1456d84ac84d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/DAFB2E08-C94A-46A4-83B2-5E4F049D6E42%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Error on my puppet Agent

2014-05-07 Thread twm139
Hi, 

I am very new to Puppet. I am running 3.5.1 via Foreman proxy. 

I unfortunately getting the following error on my client when I attempt to 
register its cert with the master.  

#  puppet agent --server myserver.domain --waitforcert 60 --test
Error: Could not request certificate: Error 400 on SERVER: no 
'environments' in 
{:current_environment=>#, 
:root_environment=>#} at top of []

Clearly I have something I have not setup or configured, but it is not 
clear based on the error what that might be. 

Anyone have any suggestions on how I might proceed?

Thanks,

Terrence

-- 
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/c8024bc1-4f19-42b0-9bc8-66bb287f7796%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] augeas for setting URIEncoding variable in tomcat, server.xml file.

2014-05-07 Thread Pradeep Reddy
Hi Team,

I am using below info in my manifest.  URIEncoding="UTF-8" is not present 
in server.xml.  Trying to inject URIEncoding using below augeas syntax.

 augeas { 'update_server.xml':
lens=> 'Xml.lns',
incl => "/opt/apphome/apache-tomcat-7.0.53/conf/server.xml",
context=> 
'/opt/apphome/apache-tomcat-7.0.53/conf/server.xml'/Connector port="8080"',
changes   => flatten([
  "set 
Server/Service/Connector[1][#attribute/redirectport='8443']/#attribute/URIEncoding
 
UTF-8",]),
  }

After executing getting below information.  URIEncoding="UTF-8" is not 
getting appended in server.xml.

Could someone please check and let me know, wehther i am using a wrong 
syntax.


Debug: Augeas[update_server.xml](provider=augeas): Opening augeas with root 
/, lens path , flags 64
Debug: Augeas[update_server.xml](provider=augeas): Augeas version 1.0.0 is 
installed
Debug: Augeas[update_server.xml](provider=augeas): Will attempt to save and 
only run if files changed
Debug: Augeas[update_server.xml](provider=augeas): sending command 'set' 
with params 
["\"${brand::tomcat_installdir}/${brand::tomcat_version}/conf/server.xml\"/Connector
 
port=\"8080\"/Server/Service/Connector[1][#attribute/redirectport='8443']/#attribute/URIEncoding",
 
"UTF-8"]
Debug: Augeas[update_server.xml](provider=augeas): Skipping because no 
files were changed
Debug: Augeas[update_server.xml](provider=augeas): Closed the augeas 
connection

Regards,
Pradeeo.

-- 
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/6a327ad9-347a-493a-b32a-89b46645e22b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Looking for a better way to use hiera hashes than create_resources

2014-05-07 Thread Alex Scoble
And this is aside from the significant resistance we've been getting from 
our traditional Windows admins over using Puppet, which is a problem that 
Puppet definitely can't solve. Their partnership with Microsoft is a very 
good thing, in my opinion though.

Oh, and Chocolatey. :D

--Alex

On Wednesday, May 7, 2014 10:04:23 AM UTC-7, Alex Scoble wrote:
>
> I'm sorry, I misspoke, I should have said that for us Puppet (PE actually) 
> has been a moving target in a number of ways.
>
> For instance, we started out heavily using the PE dashboard to define what 
> classes specific nodes would get and related variables, pretty quickly 
> realized that that wasn't very scalable or repeatable and found hiera and 
> environments.
>
> Puppet does a decent job of explaining environments, but their 
> documentation in regards to integrating with git and gitolite is 
> inadequate, particularly considering that they strongly recommend going 
> down that path. Oh and while you are researching how to make dynamic 
> environments work, you invariably run into R10k which sounds really 
> awesome, but then you wonder how do you use it?
>
> Dynamic environments are great, extremely useful, but centrally managing 
> what nodes are in what environment wasn't possible until we discovered the 
> console_env module, which unfortunately isn't working for us after we 
> upgraded to PE 3.2 (and to make a point about how the product is a moving 
> target, they are currently working on a new way of assigning roles to 
> systems). Hiera is also great as it's much faster to work with than the 
> dashboard, but it's a lot easier to make mistakes with hiera. Also, for 
> many situations, you need a hiera yaml file for individual nodes (like when 
> you want a group of systems to use a specific class). So now there's the 
> roles and profiles pattern, which Puppet recommends using along with hiera, 
> but they don't provide good documentation at all on how to use both 
> together.
>
> Plus if you pay attention to R.I. Pienaar (and you definitely should, in 
> my opinion), you see that he's proposed a new pattern where you use hiera 
> data within modules, but getting that to work requires using one of the 
> modules that aren't yet in a finished state...
>
> I've talked to people who don't think that Puppet has handled the way 
> they've added features and patterns and deprecated other features and 
> patterns, but we haven't personally run in to that.
>
> All in all, I love the product, don't get me wrong, and maybe it looks 
> pretty stable when you're at the guru level and figuring out new stuff is 
> fairly easy, but for me, it's just me and a coworker trying to mature our 
> linux and puppet infrastructure, processes and workflows. Neither of us are 
> developers, so are learning that side of things as best as we can while we 
> learn Puppet, git, hiera, Geppetto (which is the bee's knees, just be super 
> careful when you try to merge two significantly different branches together 
> using it), beaker, rspec, ruby and so on.
>
> I'm always questioning our choice in tools because that's how you stay 
> ahead in this game and when I go looking for why people are using Salt 
> Stack and Ansible instead of Puppet or Chef, the number one reason I've 
> seen is complexity of the code needed to do something.
>
> Having said that, now that I've figured out a number of things and can 
> pretty much do anything I want with Puppet, albeit crudely (you can see my 
> kvm/webvirtmgr module as evidence of this), I don't see a reason to switch, 
> but I can certainly understand why some people may look at the DevOps space 
> and gravitate towards Salt Stack and Ansible over Puppet.
>
> Thanks,
>
> Alex
>
> On Wednesday, May 7, 2014 1:18:49 AM UTC-7, Felix.Frank wrote:
>>
>> On 05/07/2014 12:52 AM, Ramin K wrote: 
>> > 
>> > I find it best not to change my workflow or methodology until it 
>> > makes sense on my system regardless of what the community or even 
>> Puppet 
>> > Labs has said. 
>>
>> Ramin, I could hardly agree more. Even your ignored practices resemble 
>> my own personal choices very closely (those perhaps come rather natural 
>> to old schoolers). 
>>
>> If I understood Alex right though, he also feels that the apparent flux 
>> might be hindering broader acceptance of Puppet. If that is indeed the 
>> case, we have a problem that we should talk about. (Note that apparent 
>> stability is more important than the technicalities.) 
>>
>> However, it has been my feeling that general adoption is not one of 
>> Puppet's problems. On the contrary, Puppet users usually form the 
>> largest crowd in any kind of forum concerned with the configuration 
>> management problem. The user base keeps growing and the community is 
>> literally buzzing with activity. 
>>
>> Alex, are there concrete issues that you have faced concerning the ease 
>> of adoption? 
>>
>> Thanks, 
>> Felix 
>>
>

-- 
You received this message because you are subscribed 

Re: [Puppet Users] Re: Looking for a better way to use hiera hashes than create_resources

2014-05-07 Thread Alex Scoble
I'm sorry, I misspoke, I should have said that for us Puppet (PE actually) 
has been a moving target in a number of ways.

For instance, we started out heavily using the PE dashboard to define what 
classes specific nodes would get and related variables, pretty quickly 
realized that that wasn't very scalable or repeatable and found hiera and 
environments.

Puppet does a decent job of explaining environments, but their 
documentation in regards to integrating with git and gitolite is 
inadequate, particularly considering that they strongly recommend going 
down that path. Oh and while you are researching how to make dynamic 
environments work, you invariably run into R10k which sounds really 
awesome, but then you wonder how do you use it?

Dynamic environments are great, extremely useful, but centrally managing 
what nodes are in what environment wasn't possible until we discovered the 
console_env module, which unfortunately isn't working for us after we 
upgraded to PE 3.2 (and to make a point about how the product is a moving 
target, they are currently working on a new way of assigning roles to 
systems). Hiera is also great as it's much faster to work with than the 
dashboard, but it's a lot easier to make mistakes with hiera. Also, for 
many situations, you need a hiera yaml file for individual nodes (like when 
you want a group of systems to use a specific class). So now there's the 
roles and profiles pattern, which Puppet recommends using along with hiera, 
but they don't provide good documentation at all on how to use both 
together.

Plus if you pay attention to R.I. Pienaar (and you definitely should, in my 
opinion), you see that he's proposed a new pattern where you use hiera data 
within modules, but getting that to work requires using one of the modules 
that aren't yet in a finished state...

I've talked to people who don't think that Puppet has handled the way 
they've added features and patterns and deprecated other features and 
patterns, but we haven't personally run in to that.

All in all, I love the product, don't get me wrong, and maybe it looks 
pretty stable when you're at the guru level and figuring out new stuff is 
fairly easy, but for me, it's just me and a coworker trying to mature our 
linux and puppet infrastructure, processes and workflows. Neither of us are 
developers, so are learning that side of things as best as we can while we 
learn Puppet, git, hiera, Geppetto (which is the bee's knees, just be super 
careful when you try to merge two significantly different branches together 
using it), beaker, rspec, ruby and so on.

I'm always questioning our choice in tools because that's how you stay 
ahead in this game and when I go looking for why people are using Salt 
Stack and Ansible instead of Puppet or Chef, the number one reason I've 
seen is complexity of the code needed to do something.

Having said that, now that I've figured out a number of things and can 
pretty much do anything I want with Puppet, albeit crudely (you can see my 
kvm/webvirtmgr module as evidence of this), I don't see a reason to switch, 
but I can certainly understand why some people may look at the DevOps space 
and gravitate towards Salt Stack and Ansible over Puppet.

Thanks,

Alex

On Wednesday, May 7, 2014 1:18:49 AM UTC-7, Felix.Frank wrote:
>
> On 05/07/2014 12:52 AM, Ramin K wrote: 
> > 
> > I find it best not to change my workflow or methodology until it 
> > makes sense on my system regardless of what the community or even Puppet 
> > Labs has said. 
>
> Ramin, I could hardly agree more. Even your ignored practices resemble 
> my own personal choices very closely (those perhaps come rather natural 
> to old schoolers). 
>
> If I understood Alex right though, he also feels that the apparent flux 
> might be hindering broader acceptance of Puppet. If that is indeed the 
> case, we have a problem that we should talk about. (Note that apparent 
> stability is more important than the technicalities.) 
>
> However, it has been my feeling that general adoption is not one of 
> Puppet's problems. On the contrary, Puppet users usually form the 
> largest crowd in any kind of forum concerned with the configuration 
> management problem. The user base keeps growing and the community is 
> literally buzzing with activity. 
>
> Alex, are there concrete issues that you have faced concerning the ease 
> of adoption? 
>
> Thanks, 
> Felix 
>

-- 
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/f7a80605-ed1e-4e45-a5c0-188d58767339%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Ignore resource in provider if not defined?

2014-05-07 Thread Gavin Williams
Right, after dropping into #Puppet-dev and hashing the issue out with Andy 
(zaphod42), have managed to find a fix... 

The failures I was seeing on 1.9.3 were due to a difference in how 
asadmin.rb:6 was being interpreted between Ruby 1.8.7 and 1.9.3, as Andy 
outlined: 
17:11 <+zaphod42> fatmcgav: figured it out
17:12 <+zaphod42> 1.8.7 and 1.9.3 deal with that line differently
17:12 <+zaphod42> on 1.8.7 defined?@resource[:dashost] && 
!@resource[:dashost].nil? turns into nil
17:12 <+zaphod42> on 1.9.3 defined?@resource[:dashost] && 
!@resource[:dashost].nil? turns into "expression"

He also suggested a more elegant way of handling this scenario, by using 
'@resource.parameters.include?' [1] to check if the param is present. 
So a quick tweak, and it appears to be working as expected : D

So again, a massive thanks to Andy for persisting. 

Regards
Gavin 

[1] 
https://github.com/fatmcgav/puppet-glassfish/commit/ea702df4ec111c81b55a4b927191673faddbe270

On Wednesday, 7 May 2014 14:47:48 UTC+1, Gavin Williams wrote:
>
> Further to the below, it looks like I appear to be getting differing 
> behaviour in various environments :( 
>
> TravisCI passes on Ruby 1.8.7 [1] but fails on Ruby 1.9.3 [2]. 
> Running the tests on a local CentOS 6 box with RVM, I get failures with 
> both versions of Ruby... So not sure why TravisCI can pass 1.8.7, but 
> locally I cant :'(
>
> Adding in some additional debug logging, I can see that 
> 'defined?(@resource[:dashost]' returns true with a 'method' response. 
> However whenever I try and evaluate the value of 'resource[:dashost]', I 
> get the 'Invalid parameter dashost(:dashost)' error.
>
> Any ideas if it's possible to have 'optional' params that aren't defined 
> on all types that use a provider?
>
> Cheers
> Gavin 
>
> [1] https://travis-ci.org/fatmcgav/puppet-glassfish/jobs/24564901
> [2] https://travis-ci.org/fatmcgav/puppet-glassfish/jobs/24564908
>
> On Tuesday, 6 May 2014 17:40:09 UTC+1, Gavin Williams wrote:
>>
>> Afternoon all, 
>>
>> I'm trying to update my Glassfish module [1] to support some additional 
>> functionality, such as clustering. 
>>
>> I've done most of the code changes, and they all seem to work fine from a 
>> usage POV. However several of my tests [2] are failing with the following 
>> error:
>>   1) Puppet::Type::Application::ProviderAsadmin when asking exists? 
>> should return true if resource is present
>>  Failure/Error: application.provider.should be_exists
>>  Puppet::Error:
>>Invalid parameter dashost(:dashost)
>>  # ./lib/puppet/provider/asadmin.rb:6:in `asadmin_exec'
>>  # ./lib/puppet/provider/application/asadmin.rb:22:in `exists?'
>>  # ./spec/unit/puppet/provider/application/asadmin_spec.rb:34:in 
>> `block (3 levels) in '
>>
>> I suspect this is related to some changes I made to 
>> Puppet::Provider::Asadmin [3] in order to support running asadmin commands 
>> against a host other than localhost. 
>> Effectively, I'm just trying to only use the 'dashost' resource value if 
>> it's defined and not null. 
>> This works fine for actual usage, but seems to fail horribly for RSpec 
>> testing :( 
>>
>> Cheers in advance for any replies. 
>>
>> Regards
>> Gavin 
>>
>> [1] https://github.com/fatmcgav/puppet-glassfish/tree/develop
>> [2] 
>> https://travis-ci.org/fatmcgav/puppet-glassfish/jobs/24549377#L505-L511
>> [3] 
>> https://github.com/fatmcgav/puppet-glassfish/blob/develop/lib/puppet/provider/asadmin.rb#L6-L8
>>
>

-- 
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/3157c546-9d88-46bb-8303-9c48ec29e9ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Serious performance issues with Puppet 3.5.x when using Directory Environments

2014-05-07 Thread Joshua Partlow
On Wed, May 7, 2014 at 6:24 AM, Antoine Cotten wrote:

> Thanks Josh,
>
> This seems to work better indeed, although I can still observe a decrease
> in performances. The config retrieval time is higher than with config-based
> environments (9 sec -> 26 sec on average), and CPU-wise I can also notice
> an increase but this is hard to quantify without prolonged monitoring, I'll
> let it run for 24 extra hours before giving any conclusion. But, well,
> nothing compared to v3.5.1 fortunately, so I believe this RC1 is promising!
>
> Feel free to ask if you need any data or extra feedback from me.
>

Thanks for testing this, Antoine!  There is a time to live setting for the
new environment cache which defaults to 5 seconds.  It's
'environment_timeout' and you can set it in your puppet.conf, or per
directory environment in it's environment.conf.  I'm curious what, if any,
change you see setting it to say '30s', and what change if you set it
'unlimited'.

Would you have time to test that?

thanks,
Josh


> --
> Toni
>
>
>
>
> On Tuesday, May 6, 2014 10:55:24 PM UTC+2, Josh Partlow wrote:
>>
>> Hi Antoine,
>>
>> There is a Puppet 3.6.0-rc1 available in the pre-release repos which has
>> environment cacheing that we think will take care of the slowdown you are
>> seeing with directory environments.  Would you be able to test that?  (See
>> Eric's 3.6.0-rc1 announcement for details on obtaining the packages)
>>
>> thanks,
>> Josh
>>
>> On Tuesday, April 22, 2014 11:26:47 AM UTC-7, Eric Sorenson wrote:
>>>
>>>
>>>
>>> On Tuesday, April 22, 2014 5:25:55 AM UTC-7, Antoine Cotten wrote:

 Hi Eric,
 thank you for pointing me to this feature, and sorry for the answer
 time.

 I managed to outline the problematic parts in the Puppet run: the final
 POST method takes forever when Directory Environments is enabled (1) and
 the catalog compilation is overall much slower (1.3./4|5|6/)

 I triggered a run on the same node, with and without the feature
 enabled. Here are the corresponding profiling logs:


>>> Thanks, this is great information.
>>>
>>> The reason the POST looks slow is because it's an aggregate of all the
>>> steps that came before it, as you see the profile step numbers pop out a
>>> level, that line aggregates the times of everything inside it.  So the POST
>>> is the aggregate of all the steps to compilation.
>>>
>>> I am looking at this more closely and I have opened https://tickets.
>>> puppetlabs.com/browse/PUP-2337 to track it.
>>>
>>> --eric0
>>>
>>  --
> 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/wzy8NPWauu4/unsubscribe.
> To unsubscribe from this group and all its topics, 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/0008dd5d-fab6-4d01-b206-6a1994236b42%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Josh Partlow
jpart...@puppetlabs.com
Developer, Puppet Labs

Join us at PuppetConf 2014, September 22-24 in San Francisco -
http://puppetconf.com
Register by May 30th to take advantage of the Early Adopter discount —save
$349!

-- 
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/CADxAQ5pxLHOSC9n6m3UTVGDX9HGY2KTXYnG1p1-qN9qcULLsnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: rspec testing and viewing the catalogue it is testing

2014-05-07 Thread choffee
Am I doing this wrong?

I create a test that says "check for a file named foo", write some code 
that should create the file. It fails for whatever reason and the test just 
says no.

How do I get a clue what I am doing wrong? It seems obvious to me that 
having the catalog that was tested against for that test would mean I could 
see my error rather than having to guess and test again.

john

On Wednesday, 7 May 2014 13:38:22 UTC+1, choffee wrote:
>
> I am trying to debug why my test is failing and not producing a file that 
> I thought it should be.
>
> Is there a simple way to view the catalogue that rspec is testing against?
>
> I tried --debug in the .rspec file with the debugger gem and it gives no 
> extra errors is there something more I need to add to my test to turn it on?
>
> Thanks 
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e743953c-6175-4193-a620-1456d84ac84d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Ignore resource in provider if not defined?

2014-05-07 Thread Gavin Williams
Further to the below, it looks like I appear to be getting differing 
behaviour in various environments :( 

TravisCI passes on Ruby 1.8.7 [1] but fails on Ruby 1.9.3 [2]. 
Running the tests on a local CentOS 6 box with RVM, I get failures with 
both versions of Ruby... So not sure why TravisCI can pass 1.8.7, but 
locally I cant :'(

Adding in some additional debug logging, I can see that 
'defined?(@resource[:dashost]' returns true with a 'method' response. 
However whenever I try and evaluate the value of 'resource[:dashost]', I 
get the 'Invalid parameter dashost(:dashost)' error.

Any ideas if it's possible to have 'optional' params that aren't defined on 
all types that use a provider?

Cheers
Gavin 

[1] https://travis-ci.org/fatmcgav/puppet-glassfish/jobs/24564901
[2] https://travis-ci.org/fatmcgav/puppet-glassfish/jobs/24564908

On Tuesday, 6 May 2014 17:40:09 UTC+1, Gavin Williams wrote:
>
> Afternoon all, 
>
> I'm trying to update my Glassfish module [1] to support some additional 
> functionality, such as clustering. 
>
> I've done most of the code changes, and they all seem to work fine from a 
> usage POV. However several of my tests [2] are failing with the following 
> error:
>   1) Puppet::Type::Application::ProviderAsadmin when asking exists? should 
> return true if resource is present
>  Failure/Error: application.provider.should be_exists
>  Puppet::Error:
>Invalid parameter dashost(:dashost)
>  # ./lib/puppet/provider/asadmin.rb:6:in `asadmin_exec'
>  # ./lib/puppet/provider/application/asadmin.rb:22:in `exists?'
>  # ./spec/unit/puppet/provider/application/asadmin_spec.rb:34:in 
> `block (3 levels) in '
>
> I suspect this is related to some changes I made to 
> Puppet::Provider::Asadmin [3] in order to support running asadmin commands 
> against a host other than localhost. 
> Effectively, I'm just trying to only use the 'dashost' resource value if 
> it's defined and not null. 
> This works fine for actual usage, but seems to fail horribly for RSpec 
> testing :( 
>
> Cheers in advance for any replies. 
>
> Regards
> Gavin 
>
> [1] https://github.com/fatmcgav/puppet-glassfish/tree/develop
> [2] 
> https://travis-ci.org/fatmcgav/puppet-glassfish/jobs/24549377#L505-L511
> [3] 
> https://github.com/fatmcgav/puppet-glassfish/blob/develop/lib/puppet/provider/asadmin.rb#L6-L8
>

-- 
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/51501d5b-65ea-49bb-9f8c-5879afdb4abf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Announcement: Puppet meetup in Austin - kicking off here soon. Join up and we will get some dates set!

2014-05-07 Thread Byron Miller
Working with the excellent Austin DevOps meetup, we're setting up a Puppet 
Meetup and starting to plan out events.  Please join us and let us know 
what you hope to get out of a meetup/user group and what times may work 
best for you.  

Meetup: http://www.meetup.com/austin-devops/events/181672382/

I look forward to meeting more Austin (or nearby Austin, yes, Cedar Park, 
Round Rock et all are welcome hehe) puppet users/admins/developers and 
seeing if we can get together to talk puppet, hack on code and pick the 
brains of local PuppetLabs folks to keep everyone up to date on the latest 
and greatest.

Feel free to contact me directly as well:

Email: byronm at gmail dot com

Thanks!
-byron

-- 
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/d80d35a6-d3a8-4c11-9358-658f67ed9602%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Assigning dynamic values to each node

2014-05-07 Thread jcbollinger


On Tuesday, May 6, 2014 7:24:53 PM UTC-5, Phani wrote:
>
> How to dynamically assign variable to each node. If I had a 30 nodes and I 
> had a file which is managed by puppet and I need to assign different values 
> for each nodes from a array of values. How to do it other than making it 
> static. 
>


It depends.  Does each node need a specific value?  Do you need to avoid 
repetition or ensure that all possible values are used?  What particular 
approaches are you disfavoring as "static"?  Does it need to be scalable?  
Does the value assigned to each node need to remain constant?

If you have exactly 30 values that you must assign to 30 nodes, with a 
different value for each node, then you probably have no choice but an 
approach relying on a static mapping from nodes to values.  That mapping 
could be expressed via a separate node block per host, or in a hash in some 
class, or as a custom function, or in one of at least two different ways in 
hiera.  Or it could be managed via an ENC, or in some cases it could be 
directly derived from hostnames alone.

On the other hand, if the values don't need to be distributed uniformly to 
nodes, but do need to be stable on each node over time, then you should 
look into using Puppet's standard 
fqdn_rand()function.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/09891d6f-9545-45e2-ac4d-5acb6d81d16e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Serious performance issues with Puppet 3.5.x when using Directory Environments

2014-05-07 Thread Antoine Cotten
Thanks Josh,

This seems to work better indeed, although I can still observe a decrease 
in performances. The config retrieval time is higher than with config-based 
environments (9 sec -> 26 sec on average), and CPU-wise I can also notice 
an increase but this is hard to quantify without prolonged monitoring, I'll 
let it run for 24 extra hours before giving any conclusion. But, well, 
nothing compared to v3.5.1 fortunately, so I believe this RC1 is promising!

Feel free to ask if you need any data or extra feedback from me.

--
Toni



On Tuesday, May 6, 2014 10:55:24 PM UTC+2, Josh Partlow wrote:
>
> Hi Antoine,
>
> There is a Puppet 3.6.0-rc1 available in the pre-release repos which has 
> environment cacheing that we think will take care of the slowdown you are 
> seeing with directory environments.  Would you be able to test that?  (See 
> Eric's 3.6.0-rc1 announcement for details on obtaining the packages)
>
> thanks,
> Josh
>
> On Tuesday, April 22, 2014 11:26:47 AM UTC-7, Eric Sorenson wrote:
>>
>>
>>
>> On Tuesday, April 22, 2014 5:25:55 AM UTC-7, Antoine Cotten wrote:
>>>
>>> Hi Eric,
>>> thank you for pointing me to this feature, and sorry for the answer 
>>> time. 
>>>
>>> I managed to outline the problematic parts in the Puppet run: the final 
>>> POST method takes forever when Directory Environments is enabled (1) and 
>>> the catalog compilation is overall much slower (1.3./4|5|6/)
>>>
>>> I triggered a run on the same node, with and without the feature 
>>> enabled. Here are the corresponding profiling logs:
>>>
>>>
>> Thanks, this is great information.
>>
>> The reason the POST looks slow is because it's an aggregate of all the 
>> steps that came before it, as you see the profile step numbers pop out a 
>> level, that line aggregates the times of everything inside it.  So the POST 
>> is the aggregate of all the steps to compilation.
>>
>> I am looking at this more closely and I have opened 
>> https://tickets.puppetlabs.com/browse/PUP-2337 to track it.
>>
>> --eric0
>>
>

-- 
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/0008dd5d-fab6-4d01-b206-6a1994236b42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] rspec testing and viewing the catalogue it is testing

2014-05-07 Thread choffee
I am trying to debug why my test is failing and not producing a file that I 
thought it should be.

Is there a simple way to view the catalogue that rspec is testing against?

I tried --debug in the .rspec file with the debugger gem and it gives no 
extra errors is there something more I need to add to my test to turn it on?

Thanks 

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7f7d228e-4f07-489c-9dcc-97184206bdad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Hiera support for Aggregate Fact Resolution?

2014-05-07 Thread Garrett McGrath
Is there a known way to do this or anything on the horizon that would make 
this functionality easier?

I am attempting to use facts.d to establish a list of 'roles' that resolve 
to locations in my hiera hierarchy (- roles/%{::roles}). Unfortunately it 
doesn't actually work as expected right now because hiera is restricted to 
interpolating values as strings instead of arrays or hashes, features added 
to facter in 2.0.  It will work one time but then puts the puppetmaster / 
passenger server in a weird state that requires touching a file in the 
manifest structure or restarting the server in order to continue working. 
 Further it only appears to access the first role when doing this which is 
an additional problem.

Having fully formed and functional support for this would allow me to 
eliminate huge amounts of repeated data in my current hiera structure so 
hopefully there is a way to get this doing what I want.
-Garrett

-- 
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/95e1a51c-f639-4b11-b2cc-9f6cd0eb4b9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Assigning dynamic values to each node

2014-05-07 Thread Phani
How to dynamically assign variable to each node. If I had a 30 nodes and I 
had a file which is managed by puppet and I need to assign different values 
for each nodes from a array of values. How to do it other than making it 
static. 

-- 
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/e2e34bf4-bd2a-45fb-a917-467ab3820115%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Looking for a better way to use hiera hashes than create_resources

2014-05-07 Thread Felix Frank
On 05/07/2014 12:52 AM, Ramin K wrote:
> 
> I find it best not to change my workflow or methodology until it
> makes sense on my system regardless of what the community or even Puppet
> Labs has said.

Ramin, I could hardly agree more. Even your ignored practices resemble
my own personal choices very closely (those perhaps come rather natural
to old schoolers).

If I understood Alex right though, he also feels that the apparent flux
might be hindering broader acceptance of Puppet. If that is indeed the
case, we have a problem that we should talk about. (Note that apparent
stability is more important than the technicalities.)

However, it has been my feeling that general adoption is not one of
Puppet's problems. On the contrary, Puppet users usually form the
largest crowd in any kind of forum concerned with the configuration
management problem. The user base keeps growing and the community is
literally buzzing with activity.

Alex, are there concrete issues that you have faced concerning the ease
of adoption?

Thanks,
Felix

-- 
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/5369EC69.3010304%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.