Re: [Puppet Users] [ANN] puppet-cleaner: makes puppet DSL code comply with a subset of the style guide

2013-04-20 Thread Tim Sharpe
Hi Dan,

Could you please file a bug report at https://github.com/rodjek/puppet-lint 
including the manifest you used below?

Thanks,
Tim

On 19/04/2013, at 3:33 AM, Dan White  wrote:

> I just tried it and the "fix" option does not.
> 
> [root manifests]# puppet-lint -v
> Puppet-lint 0.4.0.pre1
> 
> [root manifests]# puppet-lint --fix init.pp 
> WARNING: double quoted string containing no variables on line 21
> 
> The example clearly shows this warning cause getting corrected
> 
> “Sometimes I think the surest sign that intelligent life exists elsewhere in 
> the universe is that none of it has tried to contact us.” 
> Bill Waterson (Calvin & Hobbes) 
> 
> - Original Message - 
> From: "Mohit Chawla"  
> To: puppet-users@googlegroups.com 
> Sent: Thursday, April 18, 2013 1:08:25 PM 
> Subject: Re: [Puppet Users] Re: [ANN] puppet-cleaner: makes puppet DSL code 
> comply with a subset of the style guide 
> 
> Hello, 
> 
> 
> On Thu, Apr 18, 2013 at 10:22 PM, Gerardo Santana Gómez Garrido < 
> gerardo.sant...@gmail.com > wrote: 
> 
> 
> A small follow up: the gem has just been pushed to rubygems, and you can read 
> more about the motivation for this at 
> http://santanatechnotes.blogspot.mx/2013/04/puppet-cleaner-010-released.html 
> 
> 
> 
> This is nice, gotta check it out, thanks for writing it. Just a note though, 
> there was some recent work in puppet-lint ( 
> http://bombasticmonkey.com/2013/01/28/fix-simple-problems-with-puppet-lint ) 
> to autofix simple issues too. 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group. 
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com. 
> To post to this group, send email to puppet-users@googlegroups.com. 
> Visit this group at http://groups.google.com/group/puppet-users?hl=en . 
> For more options, visit https://groups.google.com/groups/opt_out . 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

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




Re: [Puppet Users] [ANN] puppet-cleaner: makes puppet DSL code comply with a subset of the style guide

2013-04-20 Thread Tim Sharpe
Hi Gerardo,

Nice project!

A couple of things though, from someone who's been down this path before:

Developing against a moving target (i.e. the Puppet tokeniser) will end up 
causing you a non-trivial amount of pain. The point where I decided to roll my 
own tokeniser rather than use Puppet's (puppet-lint 0.2.x) was when variables 
containing dashes was "fixed", requiring me to add yet another monkeypatch to 
Puppet's tokeniser to reimplement the old behaviour, so that it could be 
detected. If you test puppet-cleaner against Puppet 0.25.x through 3.1.x, 
you'll see what I mean :)

Puppet's tokeniser and puppet-lint's tokeniser are actually very similar and 
work in much the same way (both are regex based and tokenise the entire file). 
Puppet-lint's adds some additional tokens that Puppet's does not need to 
concern itself with (formatting related whitespace mostly).

Cheers,
Tim

On 19/04/2013, at 3:45 AM, Gerardo Santana Gómez Garrido 
 wrote:

> Hi Alcy,
> 
> that's nice! I used puppet-lint before writing puppet-cleaner and was very 
> useful at the time. Thanks to the author for writing it.
> 
> puppet-lint has an issue though that may make it more difficult to implement 
> those corrections: it uses regular expressions to tokenize the source code. 
> This was my first approach too, but it's limiting.
> 
> Having puppet's own tokenizer on your side is not just more helpful but 
> exact, there's no chance for errors at tokenizing the code, it's faster, and 
> you gain more introspection because you have the whole source code tokenized.
> 
> El jueves, 18 de abril de 2013 12:08:25 UTC-5, alcy escribió:
> Hello, 
> 
> On Thu, Apr 18, 2013 at 10:22 PM, Gerardo Santana Gómez Garrido 
>  wrote:
> A small follow up: the gem has just been pushed to rubygems, and you can read 
> more about the motivation for this at 
> http://santanatechnotes.blogspot.mx/2013/04/puppet-cleaner-010-released.html
> 
> 
> 
> This is nice, gotta check it out, thanks for writing it. Just a note though, 
> there was some recent work in puppet-lint 
> (http://bombasticmonkey.com/2013/01/28/fix-simple-problems-with-puppet-lint) 
> to autofix simple issues too. 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

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




Re: [Puppet Users] Windows Puppet waits for , then warns "Facter::Util::Resolution.exec with a shell built-in is deprecated"

2013-04-20 Thread Stefan Schulte
On Fri, 19 Apr 2013 13:50:59 +0200
Dirk Heinrichs  wrote:
> I'm facing a similar problem, on one single Windows machine out of
> more than 100. If I run any puppet command, I get above warning.

We'll first try to get a clearer error message. Please go to your facter
installation directory on your agent and modify the file
`util/resolution.rb`. Change

Facter.warnonce 'Using Facter::Util::Resolution.exec with a shell built-in is 
deprecated. Most built-ins can be replaced with native ruby commands. If you 
really have to run a built-in, pass "cmd /c your_builtin" as a command' unless 
expanded_code

to

Facter.warnonce "Using Facter::Util::Resolution.exec with a shell built-in 
(here: #{code}) is deprecated. Most built-ins can be replaced with native ruby 
commands. If you really have to run a built-in, pass \"cmd /c your_builtin\" as 
a command" unless expanded_code

Then run your agent again. This way you should see the command that
puppet complains about.

> Additionally, it can't execute the following simple class to update
> the puppet.conf file:
> 
> class puppetconf {
>   service { 'PuppetAgent':
> name => 'puppet',
> ensure => 'running',
> enable => 'true',
> subscribe => File['puppet.conf'],
>   }
> 
>   file { 'puppet.conf':
> path => 'C:/ProgramData/PuppetLabs/puppet/etc/puppet.conf',
> ensure => file,
> source => 'puppet:///modules/puppetconf/puppet.conf',
>   }
> }
> 
> It fails with the following error:
> 
> Error: /Service[PuppetAgent]: Could not evaluate: Could not find init
> script for 'puppet'

Can you provide the output of your agent when you run with `--debug`?
This way we should be able to see the actual provider the agent picks
for the service resource.

Also the output of the following command would be helpful

facter operatingsystem

the above command should return "windows"

net.exe

the above command should be found. If not please check your path
(try running `facter path`)

-Stefan

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




Re: [Puppet Users] Windows Puppet waits for , then warns "Facter::Util::Resolution.exec with a shell built-in is deprecated"

2013-04-20 Thread Stefan Schulte
On Tue, 16 Apr 2013 22:46:53 -0700 (PDT)
Larry Fast  wrote:
> 
> Side issue: diagnostics could have been better.  The error did not
> indicate a source file. And Pluginsync does not indicate the source
> module for any of the files it loads.  Not even in debug mode.
> 

FYI: I created a feature request for a better deprecation message:
http://projects.puppetlabs.com/issues/20321

-Stefan

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




Re: [Puppet Users] Configuring REST API in standalone Puppet

2013-04-20 Thread Javier Dehesa
Well, of course it was totally my fault. The namespace.conf file was not a 
problem, as I am using puppet 3.1.1 and that seemed to be a bug in puppet 
2.6.x, but auth.conf was actually wrong after playing with several 
configurations. Shame on me, it was pretty clear in the docs.
REST API works now my standalone configuration. Sorry to bother you and 
thanks for your answer, Felix.

El viernes, 19 de abril de 2013 23:21:53 UTC+2, Felix.Frank escribió:
>
> Hi, 
>
> the docs seem to indicate that there are a few caveats to consider. 
>
> http://docs.puppetlabs.com/guides/rest_api.html#the-agent-rest-api 
>
> Do you have both namespaceauth.conf and proper rest_authconfig settings? 
>
> HTH, 
> Felix 
>
> On 04/17/2013 11:01 AM, Javier Dehesa wrote: 
> > Is there any possibility to use the REST API in a standalone 
> > configuration of Puppet? 
> > I'm still no expert in Puppet, but in the REST API guide 
> >  says I only have to 
> > add 'listen = true' in puppet.conf, or run 'puppet agent --listen'; 
> > however, I have not been able to get anything related to Puppet 
> > listening on any port (I've checked netstat). Is the REST API only 
> > available on master/agent configurations? 
> > Also, any kind of additional information anyone could provide about the 
> > REST API would be really appreciated. I don't know if it's a very used 
> > feature, but I didn't find much information about it around. 
> > Thanks a lot! 
>

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




[Puppet Users] PuppetDB / inventory service configuration problem

2013-04-20 Thread David Gordon
Hi,

I've just been configuring my new Puppet 3.1.1 / Dashboard setup with 
Passenger to use PuppetDB for the inventory service.  I configured it via 
the puppetdb forge module, and it all seems to be configured correctly as 
far as the docs describe.

When I look at a node in the dashboard, under the inventory section, I just 
see:

Could not retrieve facts from inventory service: 404 "Could not find facts 
myhost.domain.com "


I've quoted the log excerpts from puppetdb.log and masterhttp.log below. 
 It sounds ssl-related, or that it's using http instead of https - but 
don't really know how to work out what's wrong. Anyone got any pointers for 
trying to debug this?

Thanks,
Dave

---

/var/log/puppetdb/puppetdb log:

2013-04-20 18:11:32,909 WARN  [qtp1655388819-40] [io.nio] 
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

2013-04-20 18:11:55,089 WARN  [qtp1655388819-39] [http.server] Use of 
unversioned APIs is deprecated; please use 
/v1/metrics/mbean/java.lang:type=Memory

2013-04-20 18:35:43,518 INFO  [command-proc-45] [puppetdb.command] 
[db173bb5-a2ea-486e-8dd2-46abf737f975] [replace facts] 
puppetmaster.domain.com

2013-04-20 18:35:48,999 INFO  [command-proc-45] [puppetdb.command] 
[b8cc3c17-7812-45f1-b833-452ff7bf9cf5] [replace catalog] 
puppetmaster.domain.com

2013-04-20 18:35:53,944 WARN  [qtp1655388819-39] [http.server] Use of 
unversioned APIs is deprecated; please use 
/v1/metrics/mbean/java.lang:type=Memory

 

/var/log/puppet/masterhttp.log

[2013-04-20 18:54:52] puppetmaster.domain.com - - [20/Apr/2013:18:54:51 
MEST] "GET /production/facts/myhost.domain.com? HTTP/1.1" 404 51

[2013-04-20 18:54:52] - -> /production/facts/myhost.domain.com?

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




[Puppet Users] Puppet defined types and defaults parameters

2013-04-20 Thread Ole Morten Grodås
How can I use a variable for setting a default parameter in a defined type? 
The example below illustrates my problem, the $config parameter ends 
up being "undef" while I was expecting it to have the "asdf" value. Any 
comments or suggestions would be appreciated


/etc/puppet/modules/sensor/manifests/listner.pp
$myvar="asdf"
define sensor::listner ( $config = $myvar ) {
notify { $config : }
}


/etc/puppet/manifests/site.pp
node 'dev' {
   sensor::listner {"test_sensor":}
}


root@dev:/home/ole# puppet agent --test
Info: Retrieving plugin
Info: Caching catalog for dev
Info: Applying configuration version '1366464824'
Notice: undef
Notice: 
/Stage[main]//Node[dev]/Sensor::Listner[test_sensor]/Notify[undef]/message: 
defined 'message' as 'undef'
Notice: Finished catalog run in 0.02 seconds


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




[Puppet Users] Setting certname with cloud provisioning

2013-04-20 Thread max . bridgewater
Hi,

Another newbie. Please indulge. I am using cloud provisioning module to 
setup Puppet agents in EC2. As far as I understand, the following command 
should create the Amazon instance, install Puppet and set its certname to 
1.zookeeper. It is working pretty much; but ther certname is still randomly 
generated:

puppet node_aws bootstrap --server=$HOST --image $AMI_ID --keyname 
$KEY_NAME --type $INSTANCE_TYPE  --keyfile=$KEY_FILE_LOCATION --login=root 
--certname=1.zookeeper

The generated certname is: 
ec2-54-234-214-173.compute-1.amazonaws.com-fd8443f6-69d8-9eb2-aaac-fafe464706ad

I am using Puppet master version 3.1.1 and cloud provisioning from git: 
https://github.com/puppetlabs/puppetlabs-cloud_provisioner/archive/master.zip.

What am I missing? How else can I set the certname automatically?

Thanks,
Max

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




[Puppet Users] Help me with overriding define resource

2013-04-20 Thread Mark
We are trying to override a resource that was created with 'define' but we are 
receiving the following error: Only subclasses can override parameters at 
/etc/puppet/manifests/...

Here is a specific example:  https://gist.github.com/anonymous/5428129

Is this even possible? If not, how would you work around this?

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




Re: [Puppet Users] Puppet defined types and defaults parameters

2013-04-20 Thread Matthias Saou
Hi,

You shouldn't be trying with a variable. Here's what you should
probably be doing instead :

/etc/puppet/modules/sensor/manifests/listner.pp
define sensor::listner ( $config = 'this is the generic default' ) {
notify { $config : }
}

/etc/puppet/manifests/site.pp
Sensor::Listener { config => 'asdf' }
node 'dev' {
   sensor::listner {"test_sensor":}
}

This would show 'asdf' for all of your nodes, since the default would
be set inside site.pp, thus inherited globally.

Matthias

Ole Morten Grodås  wrote:

> How can I use a variable for setting a default parameter in a defined
> type? The example below illustrates my problem, the $config parameter
> ends up being "undef" while I was expecting it to have the "asdf"
> value. Any comments or suggestions would be appreciated
> 
> 
> /etc/puppet/modules/sensor/manifests/listner.pp
> $myvar="asdf"
> define sensor::listner ( $config = $myvar ) {
> notify { $config : }
> }
> 
> 
> /etc/puppet/manifests/site.pp
> node 'dev' {
>sensor::listner {"test_sensor":}
> }
> 
> 
> root@dev:/home/ole# puppet agent --test
> Info: Retrieving plugin
> Info: Caching catalog for dev
> Info: Applying configuration version '1366464824'
> Notice: undef
> Notice: 
> /Stage[main]//Node[dev]/Sensor::Listner[test_sensor]/Notify[undef]/message: 
> defined 'message' as 'undef'
> Notice: Finished catalog run in 0.02 seconds
> 
> 

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