[Puppet Users] Using different puppet manifests running from master..

2013-01-21 Thread DreamBig
Hi,

 I am new to puppet. I have a requirement of having to install
different applications on different instances on the same machine. I
want to run it from puppet master instead of running puppet agent -t.
How can this be done?
Can someone help me with a pseudo code?

Regards,
Rajeev

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



RE: [Puppet Users] Re: exceptions, error, traces

2013-01-21 Thread GRANIER Bernard (MORPHO)
Hi,

First, thanks for your answer.

I am not still aware of a deep understanding of differences between resources 
and functions, but some tests confirmed what you said.

A point, with my tests, notify messages are displayed in the reverse order they 
are written in manifest ...

I understood that alert, crit, debug, emerg, err, info, notice are functions 
executed on server during parsing step; the documentation explains that, by 
default, messages are sent to syslog even if I did not find them.

Thanks for your details on fail function,  I did not understand clearly which 
effects this function has.

I found ErrorLog in learning puppet documentation, (Generated on October 24, 
2012, from git revision 38e9e6c36310cb4895f51e180890cd3fa28e) page 53/67 : 
this is a sample of an erb file.

Sincerly,

Bernard Granier
CE Plateforme Système
bernard.gran...@morpho.com
01 58 11 32 51

From: puppet-users@googlegroups.com [mailto:puppet-users@googlegroups.com] On 
Behalf Of Ellison Marks
Sent: Friday, January 18, 2013 7:07 PM
To: puppet-users@googlegroups.com
Subject: [Puppet Users] Re: exceptions, error, traces

Notify is not a function. It is a resource type. It essentially logs on the 
client by putting a message in the client's catalog.

alert, crit, debug, emerg, err, info, notice and warning are functions. They 
will record a message to the server's log at the specified level. Parsing and 
execution will continue. I did not list the levels in any particular order.

fail is also a function. It is a way to programatically cause a parse failure. 
The error will be logged and execution on the current node will stop.

I'm not sure what you mean about ErrorLog. Where did you see it?

On Friday, January 18, 2013 5:13:35 AM UTC-8, 
bernard...@morpho.com wrote:
Hi,
Is there a tutorial on exceptions and error management in puppet script ?

I read the manual  and found information which is confusing for me.

There is the notify function which seems to be executed on agent.

There are functions like notice, alert, fail and so on which are executed on 
server.

And I read the ErrorLog word.

So how to put all things together, what is the right policy ?

Cordialement,

Bernard Granier
CE Plateforme Système
bernard.gran...@morpho.com
01 58 11 32 51


#
" This e-mail and any attached documents may contain confidential or 
proprietary information. If you are not the intended recipient, you are 
notified that any dissemination, copying of this e-mail and any attachments 
thereto or use of their contents by any means whatsoever is strictly 
prohibited. If you have received this e-mail in error, please advise the sender 
immediately and delete this e-mail and all attached documents from your 
computer system."
#
--
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/BwmVPXNfxcgJ.
To post to this group, send email to 
puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.
#
" This e-mail and any attached documents may contain confidential or 
proprietary information. If you are not the intended recipient, you are 
notified that any dissemination, copying of this e-mail and any attachments 
thereto or use of their contents by any means whatsoever is strictly 
prohibited. If you have received this e-mail in error, please advise the sender 
immediately and delete this e-mail and all attached documents from your 
computer system."
#

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



Re: [Puppet Users] How do I add multiple new services to /etc/services using augeas/augtool?

2013-01-21 Thread Dominic Cleal
On 20/01/13 17:53, Stephen Sollar wrote:
> I am trying to add multiple new services to /etc/services file. I was
> able to get one entry placed as the last service, but have been unable
> to insert additional entries. 
> 
> augtool> set /files/etc/services/service-name[last()] "DB2_db2inst1_1"

last() in this case is going to overwrite the last entry you already
have in the file, you want to use last()+1 instead.

> augtool> set /files/etc/services/service-name[. = 'DB2_db2inst1_1']/port
> 60001
> augtool> set /files/etc/services/service-name[. =
> 'DB2_db2inst1_1']/protocol tcp
> augtool> save
> Saved 1 file(s)
> 
> cat /etc/services | grep DB_db2inst1_1
> DB2_db2inst1_1   60001/tcp
> 
> I tried using the service-name[last()+1] to add a service after that
> last one but it errors and will not save using augtool. 
> 
> set /files/etc/services/service-name[last()+1] "DB2_db2inst1_2"
> set /files/etc/services/service-name[. = 'DB2_db2inst1_2']/port 60002"
> set /files/etc/services/service-name[. = 'DB2_db2inst1_2']/protocol tcp"

There's a trailing quote on these two lines.

> I would like the output to look like this;
> DB2_db2inst1_1   60001/tcp
> DB2_db2inst1_2   60002/tcp
> 
> Im sure there is a way with Xpath to write to the next line, but I have
> not been successful with it yet. Any thoughts?

The example here works fine for me.  You say it errors - what error does
it give?  You might need to run "print /augeas//error" to get detailed
output.  If you're using Puppet 3, --debug gives the same information.

A slightly better way than using last()+1 is to do this, which has the
bonus of being entirely idempotent - so if the line already exists, it
won't add a second.

set /files/etc/services/service-name[. = 'DB2_db2inst1_2'] "DB2_db2inst1_2"
set /files/etc/services/service-name[. = 'DB2_db2inst1_2']/port 60002
set /files/etc/services/service-name[. = 'DB2_db2inst1_2']/protocol tcp

-- 
Dominic Cleal
Red Hat Engineering

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



[Puppet Users] puppet allow regex issue in file server

2013-01-21 Thread Anadi Misra
hi! all,

the following regex fails for a mount point definition

[palms]
path /apps/puppet/projects/palms/%h
allow /^bangvmplmpalm([0-1][0-4,9]).example.com$/

here's the logs

./puppet.log-20130120:Thu Jan 17 19:17:21 +0530 2013 
/Stage[main]//Node[bangvmplmpalm11.example.com]/File[/etc/httpd/dispatcher/dispatcher.any]
 
(err): Could not evaluate: Error 400 on SERVER: Not authorized to call find 
on /file_metadata/palms/dispatcher.any Could not retrieve file metadata for 
puppet:///palms/dispatcher.any: Error 400 on SERVER: Not authorized to call 
find on /file_metadata/palms/dispatcher.any
./puppet.log-20130120:Thu Jan 17 19:17:21 +0530 2013 
/Stage[main]//Node[bangvmplmpalm11.example.com]/File[/etc/httpd/dispatcher-vhost/dispatcher-vhost.conf]
 
(err): Could not evaluate: Error 400 on SERVER: Not authorized to call find 
on /file_metadata/palms/dispatcher-vhost.conf Could not retrieve file 
metadata for puppet:///palms/dispatcher-vhost.conf: Error 400 on SERVER: 
Not authorized to call find on /file_metadata/palms/dispatcher-vhost.conf

when I test it on rubular or any other ruby based regex test with the 
string bangvmplmplam09 to bangvmplmpalm14 it shows mathces, nopt sure if it 
is a regex problem or puppet. Please advice on what might be going wrong.


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/yhuQ8RvM6GIJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Using different puppet manifests running from master..

2013-01-21 Thread Anadi Misra
what do you exactly mean by "different applications on different instances 
on the same machine"? elaborate .

BR/
Anadi Misra.

On Monday, 21 January 2013 13:51:19 UTC+5:30, Rajeev Iyer wrote:
>
> Hi, 
>
>  I am new to puppet. I have a requirement of having to install 
> different applications on different instances on the same machine. I 
> want to run it from puppet master instead of running puppet agent -t. 
> How can this be done? 
> Can someone help me with a pseudo code? 
>
> Regards, 
> Rajeev 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/OywGdfs3qzMJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Cloud Provisioner on Centos

2013-01-21 Thread PuppetUser
Hi,
 
I am using Amazon Linux 3.2 ec2 instance to install puppet master.
I used puppet-server install command.
Installation is done.
When i use sudo vim /etc/puppet/puppet.conf.. I see only [main] and [agent] 
blocks. I dont see [master] block. 
My doubt is whether master get installed or not ??
 
I have installed cloud-provisioner using puppet module tool. I should move 
the lib directory of cloud-provisioner to :$RUBYLIB manually because export 
RUBYLIB=/etc/puppet/modules/cloud_provisioner/lib:$RUBYLIB did not work for 
me. Please give me the steps of exporting manually because i am new to unix 
environment.
 
Thanks and Regards 
 
Srinivas.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/dwIbAQS1-d8J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Access variables defined in defined type

2013-01-21 Thread Vladimir Rutsky
John, thank you for providing such complete example! I definitely will use
ideas from it in my scripts.


--
Vladimir Rutsky


On Tue, Jan 15, 2013 at 9:43 PM, jcbollinger wrote:

>
>
> On Tuesday, January 15, 2013 4:56:13 AM UTC-6, Vladimir Rutsky wrote:
>>
>>
>> On Fri, Jan 11, 2013 at 6:14 PM, jcbollinger wrote:
>>
>>>
>>>
>>> On Friday, January 11, 2013 4:45:49 AM UTC-6, Vladimir Rutsky wrote:
>>>
 Can you suggest solution to my problem?


>>>
>>> Generally speaking, the Puppet way of approaching such problems is to
>>> have all the relevant resources draw on the same data, instead of some
>>> resources getting it indirectly from others.  The data may reside in an
>>> external source and be accessed via a Puppet function, they may reside in
>>> one or more class variables, or they may be received in the form of
>>> definition parameters (or class parameters, though I advise against that).
>>>
>>>
>>>
 I want to create multiple Python virtual environments in different
 directories and use files from them in other resources (like Django
 installation and some other Python programs) in such way, that single
 Python virtual environment can be used in multiple other resources.

>>>
>>>
>>> Are you suggesting that some nodes will have multiple distinct Python
>>> environments, or just that Python environments of different nodes will
>>> differ?  It makes a big difference to which solution(s) I might recommend.
>>>
>>
>> Nodes can have multiple distinct Python environments. For example I want
>> test my python programs with multiple versions of libraries:
>>
>> Linux host:
>>   virtualenv1 with LibA version 1.0, LibB version 2.0 - test programC,
>> programD
>>   virtualenv2 with LibA version 0.1, LibB version 0.2 - test programC,
>> programD
>>
>> Windows host:
>>   virtualenv1 with LibA version 1.0, LibB version 2.0 - test programC,
>> programD
>>   virtualenv2 with LibA version 0.1, LibB version 0.2 - test programC,
>> programD
>>
>> So on each host I want to create two virtual environments, something like
>> this:
>>
>> node 'windows-testing-host', 'linux-testing-host' {
>>   # Setup python with dependencies. Suppose "python" executable is added
>> in global path on Windows and Linux, so no problems with finding it.
>>   class {'python': }
>>
>>   # Setup virtualenv1
>>   python::virtualenv::env { 'virtualenv1': }
>>
>>   # Setup virtualenv2
>>   python::virtualenv::env { 'virtualenv2': }
>>
>>   # easy_install LibA v1.0, LibB v2.0 in virtualenv1 - needs path to
>> bin/easy_install or Scripts/easy_install.exe
>>   ...
>>   # easy_install LibA v1.0, LibB v2.0 in virtualenv2 - needs path to
>> bin/easy_install or Scripts/easy_install.exe
>>   ...
>>
>>   # Install and test programC, programD in virtual environments
>> }
>>
>>
>> I'm new to Puppet and as temporary solution I done something like this:
>> [...]
>>
>
>
> Someone with more Puppet experience would probably wrap that up a little
> more neatly, possibly by using hashes and defined types.  An experienced
> Puppeteer would certainly put all the logic in a class instead of in a node
> block, and would consider loading the data from an external source via
> hiera instead of encoding it directly into the manifest.  For example
> (leaving hiera out of it):
>
>
> manifests/init.pp:
> node default {
>   include 'test::environments'
> }
>
>
> modules/test/manifests/environments.pp:
> class test::environments {
>   include 'test::params'
>
>   # the 'keys' function comes from Puppetlabs 'stdlib'
>   # add-in module
>   $environments = keys($test::params::environment_config)
>
>   # When a resource title is given as an array, it means one
>   # resource instance for each element of the array
>   test::environment { $environments: }
> }
>
>
> modules/test/manifests/params.pp:
> class test::params {
>   $env_root = $osfamily ? { 'Windows' => 'C:/', default => '/' }
>
>   # the parameters for each environment, and, via its keys,
>   # a master list of the environments needed.  It would be
>   # better to load this via hiera, though.
>   $environment_config = {
> 'env1' => {
>   directory => "${env_root}env1",
>   libA_version => '1.0',
>   libB_version => '2.0'
> },
> 'env2' => {
>   directory => "${env_root}env2",
>   libA_version => '0.1',
>   libB_version => '0.2'
> }
>   }
> }
>
>
> modules/test/manifests/environment.pp:
> # One virtual environment
> define test::environment() {
>   include 'python'
>
>   $config = $test::params::environment_config[$name]
>
>   python::virtualenv::env { $name:
> directory => $config['directory']
>   }
>
>   libA { "$name_libA":
> virtualenv_dir => $config['directory']
> version => $config['libA_version']
>   }
>
>   libB { "$name_libB":
> virtualenv_dir => $config['directory']
> version => $config['libB_version']
>   }
>
>   programC { "$name_programC":
> virtualenv_dir => $config['directory']
>   }
>
>   programD { "$name_programC

[Puppet Users] Re: Hi, problems with start puppetmaster

2013-01-21 Thread Gustavo Henrique Borges
thank you very much, jhon, I removed the folder and the file he created

tks

Em quinta-feira, 17 de janeiro de 2013 15h17min27s UTC-2, Gustavo Henrique 
Borges escreveu:
>
> hi, can you help me? when I start the puppetmaster it returns me the 
> following error:
>
> Could not prepare for execution: Got 1 failure(s) while initializing: 
> change from directory to file failed: Could not set 'file on ensure: Is a 
> directory - /var/lib/puppet/facts
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/Gzb-wFc3WiEJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: using file_line with match

2013-01-21 Thread Stefan Wiederoder
Hello Ellison,

yes, you´re right, now it´s working:

file_line { "xxx": line => "ALLOWHOST server1|server2", path => "/tmp/sw", 
match => "ALLOWHOST.*$", ensure => present }


thanks
,
Stefan

Am Freitag, 18. Januar 2013 18:50:36 UTC+1 schrieb Ellison Marks:
>
> @Stephan, as it stands, the match parameter must be able to regex match 
> the line parameter. I think this is so you can only replace similar lines. 
> You could drop the $ at the end and it would probably work.
>
> @bernard, I think something is wrong with the client you use to access the 
> group. Your replies are getting posted to random threads.
>
> On Friday, January 18, 2013 12:07:44 AM UTC-8, Stefan Wiederoder wrote:
>>
>> I´m using stdlib 3.2 on my 3.0.1 master/agent
>>
>> my goal is to replace a line within a configuration file to add one more 
>> server like this:
>> file_line { "xxx": line => "ALLOWHOST server1|server2", path => 
>> "/tmp/sw", match => "^ALLOWHOST$", ensure => present }
>>
>> I´ve tried to use match to ensure that the existing line is changed, but 
>> I´m getting this error message:
>> Error: Failed to apply catalog: When providing a 'match' parameter, the 
>> value must be a regex that matches against the value of your 'line' 
>> parameter
>>
>> how can I solve this?
>>
>> thanks
>> ,
>> Stefan
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/rvcMdignUksJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] no_longer_reporting_cutoff value has no effect

2013-01-21 Thread alcc
Hi,
my problem: puppet-dashboard doesn't seem to care about the *
no_longer_reporting_cutoff* value. Was set to 3600 and just did set it to 
600 but a node who sent his last report (last run failed... maybe that's 
important?) over 5 hours ago is still not marked as "Has not reported" yet. 
Thing is: It does set the state to "Has not reported" but after a much 
longer while. Any idea why that is?
Thanks in advance!

> cat /usr/share/puppet-dashboard/config/settings.yml | grep cutoff
no_longer_reporting_cutoff: 600

> rpm -qa | grep puppet
puppet-3.0.2-1.el6.noarch
puppet-dashboard-1.2.20-1.el6.noarch
puppet-server-3.0.2-1.el6.noarch
puppetlabs-release-6-6.noarch

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/FlBk8rK2v-UJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Server-side exec

2013-01-21 Thread Jeff Thomas
Well, I thought I had, but apparently not. Yes that works, thanks.

-Jeff




On Saturday, January 19, 2013 4:54:21 AM UTC-8, Jakov Sosic wrote:
>
> On 01/18/2013 08:33 PM, Jeff Thomas wrote: 
> > but that runs the "ypmatch" on the client, which isn't useful.  Then I 
> > found the "generate" function, but apparently "generate" can be called 
> > with only one argument (spaces are excluded from the characters 
> > "generate" will take). I tried: 
> > 
> > user { $username: 
> > ... 
> > password => generate("/path/getuserpasswd.sh  $username"), 
> > ... 
> > } 
> > 
> > but that gets an error due to the space (getuserpaswd.sh is just a shell 
> > script that does the ypmatch expecting $1 to be the username). 
>
> Have you tried: 
>
> password => generate('/path/getuserpasswd.sh', $username), 
>
>
>
> -- 
> Jakov Sosic 
> www.srce.unizg.hr 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/q9OS_R1Q0bkJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Terrible exported resources performance

2013-01-21 Thread Daniel
Hi, 

Since the below is a little long, I put my question at the top: how do I 
troubleshoot awful exported resources performance in puppet and is there 
anything I can tweak to get it to run under 10 minutes in larger 
environments?

I have a fairly modest environment (118 nodes, but prod will be at least 
twice as large). I'm trying to move my distributed nagios setup to one 
based on exported resources and it works brilliantly in a smaller env (35 
nodes), but with 118 nodes it's not so great anymore. 

All the hosts export a nagios host and services (up to 20) with 
corresponding commands, plus files for them. It's all based on this: 
https://github.com/camptocamp/puppet-nagios , but fixed so that it's 
working :). I appreciate it's not the most efficient way of doing things, 
but it makes my setup insanely easy to configure, comparing to the previous 
one, with a combination of static files, templates, multiple 'profiles', 
duplicated configs, etc.

In the small env puppet agent takes about 2 minutes to run on nagios server 
and collect resources.

In the larger env it takes about 70 minutes, if it manages to finish at 
all. Initially, as a "quick" test, I was running puppetdb without postgres 
and had to give it 5GB to get it to finish at all (70 mins). With postgres 
8.4, load on the puppetmaster is significantly reduced, but with 512MB for 
puppetdb (128 + 1MB per node, and then double it for good measure) puppetdb 
still runs out of memory. I set it to 1GB and puppedb just crashed again 
(I've got dumps). Trying with 2GB now. I haven't fiddled with thread 
settings, but my puppet agents aren't deamonized or 'croned', I run them 
using mcollective or manually. So there's only a single puppet agent 
running during this test, on the core nagios server. It seems that there's 
a ruby process taking 100% of one core during this run and nothing else 
"dramatic" seems to be happening (except for puppetdb dying of course).

It's all on centos 5.8 with puppetlabs ruby and puppet packages, on 
apache+passenger:

ruby-1.8.7.370-1.el5
ruby-rdoc-1.8.7.370-1.el5
rubygem-stomp-1.2.2-1.el5
rubygem-json-1.4.6-2.el5
rubygem-fastthread-1.0.7-1
rubygem-rake-0.8.7-2
rubygem-daemon_controller-0.2.5-1
rubygem-passenger-native-3.0.12-1
puppetdb-terminus-1.0.5-1.el5
puppet-server-3.0.2-1.el5
ruby-libs-1.8.7.370-1.el5
ruby-irb-1.8.7.370-1.el5
rubygems-1.3.7-1.el5
ruby-shadow-1.4.1-7
libselinux-ruby-1.33.4-5.7.el5
ruby-augeas-0.4.1-1
puppet-3.0.2-1.el5
rubygem-rack-1.1.0-2.el5
rubygem-passenger-3.0.12-1
rubygem-passenger-native-libs-3.0.12-1_1.8.7.370
puppetdb-1.0.5-1.el5

Passenger config:

PassengerHighPerformance on
PassengerMaxPoolSize 12
PassengerPoolIdleTime 1500
PassengerMaxRequests 1000
PassengerStatThrottleRate 120


Regards,
Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/bLnpN2PTnQsJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Terrible exported resources performance

2013-01-21 Thread David Schmitt

On 21.01.2013 14:05, Daniel wrote:

Hi,

Since the below is a little long, I put my question at the top: how do I
troubleshoot awful exported resources performance in puppet and is there
anything I can tweak to get it to run under 10 minutes in larger
environments?


There is a "simple" answer: puppetdb.

There'll still be bottlenecks to wring, but collection performance won't 
be one of them.



Best Regards, David

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



[Puppet Users] puppet configuration and variables ?

2013-01-21 Thread GRANIER Bernard (MORPHO)
Hi,

Is there a way to define a variable  in puppet.conf file ?

Something like  :
My_var = my_value in puppet.conf

Then to be able to use it in manifest with something like :
   file {custo.txt':
path=> $my_value,
ensure=> present,
mode=> 0640,
content=> "this content",
 }

Sincerly,

Bernard Granier

#
" This e-mail and any attached documents may contain confidential or 
proprietary information. If you are not the intended recipient, you are 
notified that any dissemination, copying of this e-mail and any attachments 
thereto or use of their contents by any means whatsoever is strictly 
prohibited. If you have received this e-mail in error, please advise the sender 
immediately and delete this e-mail and all attached documents from your 
computer system."
#

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



Re: [Puppet Users] puppet configuration and variables ?

2013-01-21 Thread Brian Mathis
Something like this would typically go in your manifest files, not the
puppet.conf file.  I think you will find the Puppet language guide
instructive, specifically the page on variables:
http://docs.puppetlabs.com/puppet/2.7/reference/lang_variables.html

You should think of Puppet as more of a development language than a
tool that you simply configure using a .conf file.  The site.pp is
simply the entry point into the structure you build with the
manifests, and you can do quite a lot with the language.


❧ Brian Mathis


On Mon, Jan 21, 2013 at 11:58 AM, GRANIER Bernard (MORPHO)
 wrote:
> Hi,
>
> Is there a way to define a variable  in puppet.conf file ?
>
> Something like  :
> My_var = my_value in puppet.conf
>
> Then to be able to use it in manifest with something like :
>file {custo.txt':
> path=> $my_value,
> ensure=> present,
> mode=> 0640,
> content=> "this content",
>  }
>
> Sincerly,
>
> Bernard Granier
>
> #
> " This e-mail and any attached documents may contain confidential or 
> proprietary information. If you are not the intended recipient, you are 
> notified that any dissemination, copying of this e-mail and any attachments 
> thereto or use of their contents by any means whatsoever is strictly 
> prohibited. If you have received this e-mail in error, please advise the 
> sender immediately and delete this e-mail and all attached documents from 
> your computer system."
> #
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>

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



RE: [Puppet Users] puppet configuration and variables ?

2013-01-21 Thread GRANIER Bernard (MORPHO)
Thanks for the advice, I will use variables to define specific values,

Sincerely,


Bernard Granier


-Original Message-
From: puppet-users@googlegroups.com [mailto:puppet-users@googlegroups.com] On 
Behalf Of Brian Mathis
Sent: Monday, January 21, 2013 6:09 PM
To: puppet-users@googlegroups.com
Subject: Re: [Puppet Users] puppet configuration and variables ?

Something like this would typically go in your manifest files, not the 
puppet.conf file.  I think you will find the Puppet language guide instructive, 
specifically the page on variables:
http://docs.puppetlabs.com/puppet/2.7/reference/lang_variables.html

You should think of Puppet as more of a development language than a tool that 
you simply configure using a .conf file.  The site.pp is simply the entry point 
into the structure you build with the manifests, and you can do quite a lot 
with the language.


❧ Brian Mathis


On Mon, Jan 21, 2013 at 11:58 AM, GRANIER Bernard (MORPHO) 
 wrote:
> Hi,
>
> Is there a way to define a variable  in puppet.conf file ?
>
> Something like  :
> My_var = my_value in puppet.conf
>
> Then to be able to use it in manifest with something like :
>file {custo.txt':
> path=> $my_value,
> ensure=> present,
> mode=> 0640,
> content=> "this content",
>  }
>
> Sincerly,
>
> Bernard Granier
>
> #
> " This e-mail and any attached documents may contain confidential or 
> proprietary information. If you are not the intended recipient, you are 
> notified that any dissemination, copying of this e-mail and any attachments 
> thereto or use of their contents by any means whatsoever is strictly 
> prohibited. If you have received this e-mail in error, please advise the 
> sender immediately and delete this e-mail and all attached documents from 
> your computer system."
> #
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>

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

#
" This e-mail and any attached documents may contain confidential or 
proprietary information. If you are not the intended recipient, you are 
notified that any dissemination, copying of this e-mail and any attachments 
thereto or use of their contents by any means whatsoever is strictly 
prohibited. If you have received this e-mail in error, please advise the sender 
immediately and delete this e-mail and all attached documents from your 
computer system."
#

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



[Puppet Users] what is this trying to tell me?

2013-01-21 Thread Scott Anderson
I am setting up puppet on my boxes.. and one of my boxes gives me this
error when I run puppet agent --test

ratbert ~ $puppet agent --test
info: Caching catalog for ratbert.in.torand.org
info: Applying configuration version '1358784048'
*err: Could not prefetch package provider 'yum': The yum provider can only
be used as root*
notice: /File[ntp.conf]/content:

I cannot find any information on the web about this error..

-- 
The most essential quality for leadership is not perfection,
but credibility.  People must be able to trust you, or
they won't follow you.
>From "The Purpose Driven Life" by Rick Warren

Scott Anderson - web: http://www.torand.org - e-mail: s...@torand.org
GoogleTalk: s...@torand.org - AIM:andersons776- Twitter:sdanderson
Phone: 703-594-1284

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



[Puppet Users] Unable to replace a symlink with regular file

2013-01-21 Thread Sean Kelly
I am running Puppet 2.7.x (x varies from 14 to 20 on different machines). 
 I am trying to use Puppet to deploy a new Zabbix agent configuration file. 
On all machines where the file wasn't a symlink, the deployment worked. 
However, every machine where it is a link, Puppet refuses to replace teh 
link with a regular file or do anything with it.

I've read the type reference, and I see nothing specific about forcing 
symlink replacement. I've looked at the source, and it seems like 
remove_existing should be unlinking teh symlink ahead of my new file. But, 
it isn't happening. Any suggestions on hwo to do this?

File {
backup => main,
owner => "root",
group => $operatingsystem ? {
freebsd => "wheel",
default => "root",
},
mode => 644,
ensure => present,
}

class zabbix {
file {
'/usr/local/etc/zabbix':
ensure => 'directory';
'/usr/local/etc/zabbix/zabbix_agentd.conf':
content => template("zabbix/zabbix_agentd.conf.erb"),
}
...

root@victor:~# ls -ld /usr/local/etc/zabbix/zabbix_agentd.conf
lrwxr-xr-x  1 root  wheel  64 Dec  9  2011 
/usr/local/etc/zabbix/zabbix_agentd.conf -> 
/usr/local/flightaware/monitor-scripts/zabbix/zabbix_agentd.conf

root@victor:~# puppet agent --test --debug --color=no | grep 
zabbix_agentd.conf 2>&1
debug: /Stage[main]/Zabbix/Service[zabbix_agentd]/subscribe: subscribes to 
File[/usr/local/etc/zabbix/zabbix_agentd.conf]
debug: /Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]: 
Autorequiring File[/usr/local/etc/zabbix]
debug: 
/Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]/mode: 
Not managing symlink mode

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/mw3dMbd96TkJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] what is this trying to tell me?

2013-01-21 Thread R.I.Pienaar


- Original Message -
> From: "Scott Anderson" 
> To: puppet-users@googlegroups.com
> Sent: Monday, January 21, 2013 5:53:51 PM
> Subject: [Puppet Users] what is this trying to tell me?
> 
> I am setting up puppet on my boxes.. and one of my boxes gives me this
> error when I run puppet agent --test
> 
> ratbert ~ $puppet agent --test
> info: Caching catalog for ratbert.in.torand.org
> info: Applying configuration version '1358784048'
> *err: Could not prefetch package provider 'yum': The yum provider can only
> be used as root*
> notice: /File[ntp.conf]/content:
> 
> I cannot find any information on the web about this error..

you can only manage packages if you run puppet as root, you ran it as a user.

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



Re: [Puppet Users] what is this trying to tell me?

2013-01-21 Thread Scott Anderson
Oh %$&^*& you are right.. why didn't I catch that..

On Mon, Jan 21, 2013 at 12:57 PM, R.I.Pienaar  wrote:

>
>
> - Original Message -
> > From: "Scott Anderson" 
> > To: puppet-users@googlegroups.com
> > Sent: Monday, January 21, 2013 5:53:51 PM
> > Subject: [Puppet Users] what is this trying to tell me?
> >
> > I am setting up puppet on my boxes.. and one of my boxes gives me this
> > error when I run puppet agent --test
> >
> > ratbert ~ $puppet agent --test
> > info: Caching catalog for ratbert.in.torand.org
> > info: Applying configuration version '1358784048'
> > *err: Could not prefetch package provider 'yum': The yum provider can
> only
> > be used as root*
> > notice: /File[ntp.conf]/content:
> >
> > I cannot find any information on the web about this error..
>
> you can only manage packages if you run puppet as root, you ran it as a
> user.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>


-- 
The most essential quality for leadership is not perfection,
but credibility.  People must be able to trust you, or
they won't follow you.
>From "The Purpose Driven Life" by Rick Warren

Scott Anderson - web: http://www.torand.org - e-mail: s...@torand.org
GoogleTalk: s...@torand.org - AIM:andersons776- Twitter:sdanderson
Phone: 703-594-1284

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



Re: [Puppet Users] Re: exceptions, error, traces

2013-01-21 Thread Ellison Marks


On Monday, January 21, 2013 12:47:12 AM UTC-8, bernard...@morpho.com wrote:
>
> Hi,
>
>  
>
> First, thanks for your answer.
>
>  
>
> I am not still aware of a deep understanding of differences between 
> resources and functions, but some tests confirmed what you said. 
>
Let me put it this way: A resource manages something on the client. A 
collection of resources is compiled on the server and applied to the 
client. A function is run on the server and works on a manifest before it 
is compiled, sort of like preprocessing.

A point, with my tests, notify messages are displayed in the reverse order 
> they are written in manifest …
>
Ordering isn't guaranteed to be anything. The nature of puppet manifests is 
not linear, it is declarative. That is, unless you explicitly specify 
dependencies with before/require parameters, or the -> operator, resources 
will get applied in any order they please.
 

> I understood that alert, crit, debug, emerg, err, info, notice are 
> functions executed on server during parsing step; the documentation 
> explains that, by default, messages are sent to syslog even if I did not 
> find them.
>
>  
>
> Thanks for your details on fail function,  I did not understand clearly 
> which effects this function has.
>
>  
>
> I found ErrorLog in learning puppet documentation, (Generated on October 
> 24, 2012, from git revision 38e9e6c36310cb4895f51e180890cd3fa28e) page 
> 53/67 : this is a sample of an erb file.
>
That may be referring to an apache directive. 
http://httpd.apache.org/docs/current/mod/core.html#errorlog
Does it make sense in that context? 

> Sincerly,
>
>  
>
> Bernard Granier
>
> CE Plateforme Système
>
> bernard...@morpho.com 
>
> 01 58 11 32 51
>
>  
>
> *From:* puppet...@googlegroups.com  [mailto:
> puppet...@googlegroups.com ] *On Behalf Of *Ellison Marks
> *Sent:* Friday, January 18, 2013 7:07 PM
> *To:* puppet...@googlegroups.com 
> *Subject:* [Puppet Users] Re: exceptions, error, traces
>
>  
>
> Notify is not a function. It is a resource type. It essentially logs on 
> the client by putting a message in the client's catalog.
>
> alert, crit, debug, emerg, err, info, notice and warning are functions. 
> They will record a message to the server's log at the specified level. 
> Parsing and execution will continue. I did not list the levels in any 
> particular order.
>
> fail is also a function. It is a way to programatically cause a parse 
> failure. The error will be logged and execution on the current node will 
> stop.
>
> I'm not sure what you mean about ErrorLog. Where did you see it?
>
> On Friday, January 18, 2013 5:13:35 AM UTC-8, bernard...@morpho.com wrote:
>
> Hi,
>
> Is there a tutorial on exceptions and error management in puppet script ?
>
>  
>
> I read the manual  and found information which is confusing for me.
>
>  
>
> There is the notify function which seems to be executed on agent.
>
>  
>
> There are functions like notice, alert, fail and so on which are executed 
> on server.
>
>  
>
> And I read the ErrorLog word.
>
>  
>
> So how to put all things together, what is the right policy ?
>
>  
>
> Cordialement,
>
>  
>
> Bernard Granier
>
> CE Plateforme Système
>
> bernard.gran...@morpho.com
>
> 01 58 11 32 51
>
>  
>
> #
> " This e-mail and any attached documents may contain confidential or 
> proprietary information. If you are not the intended recipient, you are 
> notified that any dissemination, copying of this e-mail and any attachments 
> thereto or use of their contents by any means whatsoever is strictly 
> prohibited. If you have received this e-mail in error, please advise the 
> sender immediately and delete this e-mail and all attached documents from 
> your computer system."
> #
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/puppet-users/-/BwmVPXNfxcgJ.
> To post to this group, send email to puppet...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> puppet-users...@googlegroups.com .
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>
> #
> " This e-mail and any attached documents may contain confidential or 
> proprietary information. If you are not the intended recipient, you are 
> notified that any dissemination, copying of this e-mail and any attachments 
> thereto or use of their contents by any means whatsoever is strictly 
> prohibited. If you have received this e-mail in error, please advise the 
> sender immediately and delete this e-mail and all attached documents from 
> your computer system."
> #
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/XWooEEcFDvIJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, se

[Puppet Users] Re: Terrible exported resources performance

2013-01-21 Thread Luke Bigum
Hi Daniel,

On Monday, January 21, 2013 1:05:26 PM UTC, Daniel wrote:
>
> In the larger env it takes about 70 minutes, if it manages to finish at 
> all. Initially, as a "quick" test, I was running puppetdb without postgres 
> and had to give it 5GB to get it to finish at all (70 mins). With postgres 
> 8.4, load on the puppetmaster is significantly reduced, but with 512MB for 
> puppetdb (128 + 1MB per node, and then double it for good measure) puppetdb 
> still runs out of memory. I set it to 1GB and puppedb just crashed again 
> (I've got dumps). Trying with 2GB now. I haven't fiddled with thread 
> settings, but my puppet agents aren't deamonized or 'croned', I run them 
> using mcollective or manually. So there's only a single puppet agent 
> running during this test, on the core nagios server. It seems that there's 
> a ruby process taking 100% of one core during this run and nothing else 
> "dramatic" seems to be happening (except for puppetdb dying of course).
>
>
Given enough RAM it doesn't sound like PuppetDB is the problem any more, is 
that correct?

The Ruby process is most likely a Puppet Master thread doing the catalog 
construction. I think your suffering from a similar problem that we had 
recently, where it's not specifically resource collection that's taking up 
all the time, it's the Puppet Master turning the exported resources 
information into one enormous catalog that takes too long.

We got around this by bypassing exported resources and querying the 
information from PuppetDB directly and using that information in a 
template. I suggested the following to another user a few days ago in this 
thread:

https://groups.google.com/forum/#!topic/puppet-users/X6Lm-0_etbA

-Luke

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/GOV7Nh_co1EJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Custom provider: shell command gets corrupted, how to debug?

2013-01-21 Thread badbishop
Hello,

I'm writing my first custom type and provider for Puppet. I've run into 
following trouble. When I define a command binary (using touch here for the 
sake of example)

commands :mycommand => 'touch'

... and then in create run

mycommand '/tmp/test1'

somehow a new line gets inserted between command and the argument. In debug 
messages it looks OK, just as if there's an extra space, by the error looks 
like first the command got into interactive mode, and then received invalid 
argument (I have experimented with several commands, like aptitude, for 
instance). If I copy the resulting command from debugging output, it forks 
just fine. 

I'm using puppet 2.7.20

Any similar experiences?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/cExDwS1UzHoJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Unable to replace a symlink with regular file

2013-01-21 Thread Gary Larizza
You should be able to add  "force => true" and get this to work for you


On Monday, January 21, 2013 at 9:19 AM, Sean Kelly wrote:

> I am running Puppet 2.7.x (x varies from 14 to 20 on different machines).  I 
> am trying to use Puppet to deploy a new Zabbix agent configuration file. On 
> all machines where the file wasn't a symlink, the deployment worked. However, 
> every machine where it is a link, Puppet refuses to replace teh link with a 
> regular file or do anything with it.
> 
> I've read the type reference, and I see nothing specific about forcing 
> symlink replacement. I've looked at the source, and it seems like 
> remove_existing should be unlinking teh symlink ahead of my new file. But, it 
> isn't happening. Any suggestions on hwo to do this?
> 
> File {
> backup => main,
> owner => "root",
> group => $operatingsystem ? {
> freebsd => "wheel",
> default => "root",
> },
> mode => 644,
> ensure => present,
> }
> 
> 
> class zabbix {
> file {
> '/usr/local/etc/zabbix':
> ensure => 'directory';
> '/usr/local/etc/zabbix/zabbix_agentd.conf':
> content => template("zabbix/zabbix_agentd.conf.erb"),
> }
> 
> ...
> 
> root@victor:~# ls -ld /usr/local/etc/zabbix/zabbix_agentd.conf
> lrwxr-xr-x  1 root  wheel  64 Dec  9  2011 
> /usr/local/etc/zabbix/zabbix_agentd.conf -> 
> /usr/local/flightaware/monitor-scripts/zabbix/zabbix_agentd.conf
> 
> 
> root@victor:~# puppet agent --test --debug --color=no | grep 
> zabbix_agentd.conf 2>&1
> debug: /Stage[main]/Zabbix/Service[zabbix_agentd]/subscribe: subscribes to 
> File[/usr/local/etc/zabbix/zabbix_agentd.conf]
> debug: /Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]: 
> Autorequiring File[/usr/local/etc/zabbix]
> debug: 
> /Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]/mode: Not 
> managing symlink mode
> 
> 
> Thanks!
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/puppet-users/-/mw3dMbd96TkJ.
> To post to this group, send email to puppet-users@googlegroups.com 
> (mailto:puppet-users@googlegroups.com).
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com 
> (mailto:puppet-users+unsubscr...@googlegroups.com).
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.

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



Re: [Puppet Users] Puppet and Windows runtime error

2013-01-21 Thread Josh Cooper

On Jan 21, 2013, at 10:13 AM, Thomas Bendler  wrote:

> Hi @all,
> 
> I still have a problem with Puppet in conjunction with Windows. My goal in 
> the first step is to deploy Nagios agents on Windows servers. Therefore I 
> extended my current class with a Windows specific part:
> 
> # Class: nagios::client
> # [...]
> #
> class monitor::nagios::client inherits monitor::params {
> [...]
>   $windows = $::operatingsystem ? {
> windows => true,
> default => false
>   }
> [...]
>   if $windows {
> file {
>   'c:/local/source':
> ensure => directory,
> mode   => 0770,
> owner  => 'Administrator',
> group  => 'Administrators';
> 
>   'c:/local/source/NSClient++-0.3.9-x64.msi':
> ensure  => present,
> mode=> 0770,
> owner   => 'Administrator',
> group   => 'Administrators',
> require => File['c:/local/source'],
> path=> $::operatingsystem ? {
>   default => 'c:/local/source/NSClient++-0.3.9-x64.msi'
> },
> source  => 'puppet:///modules/nagios/client/NSClient++-0.3.9-x64.msi';
> 
>   'c:/local/nsclient/boot.ini':
> ensure  => present,
> mode=> 0770,
> owner   => 'Administrator',
> group   => 'Administrators',
> require => Package['NSClientpp'],
> notify  => Service['NSClientpp'],
> path=> $::operatingsystem ? {
>   default => 'c:/local/nsclient/boot.ini'
> },
> content => template('nagios/client/boot.ini.erb');
> 
>   'c:/local/nsclient/nsc.ini':
> ensure  => present,
> mode=> 0770,
> owner   => 'Administrator',
> group   => 'Administrators',
> require => Package['NSClientpp'],
> notify  => Service['NSClientpp'],
> path=> $::operatingsystem ? {
>   default => 'c:/local/nsclient/nsc.ini'
> },
> content => template('nagios/client/nsc.ini.erb');
> }
> 
> package { 'NSClientpp':
>   ensure  => installed,
>   provider=> 'windows',
>   source  => 'c:\local\source\NSClient++-0.3.9-x64.msi',
>   install_options => [
> {
>   'INSTALLLOCATION' => 'c:\local\nsclient'
> }
> ],
>   require => File['c:/local/source/NSClient++-0.3.9-x64.msi'];
> }
> 
> service { 'NSClientpp':
>   ensure  => 'running',
>   name=> $::operatingsystem ? {
> default => 'NSClientpp'
>   },
>   enable  => true,
>   require => Package['NSClientpp'];
> }
>   }
> }
> 
> So far, so good. The first time I run the manifest, the Nagios client is 
> downloaded from the Puppet Server and stored localy. The local msi get 
> installed on the server, the configuration is deployed and the service is up 
> and running. Unfortunately, if I try to run the manifest again, the package 
> provider try to install the client again and the service is deleted from the 
> service list:
> 
> Level Date and Time   Source  Event IDTask Category
> Information   21.01.2013 18:59:16 Puppet  1   NoneFinished 
> catalog run in 5.59 seconds
> Error 21.01.2013 18:59:16 Puppet  3   None
> /Stage[main]/Nagios::Client/Service[NSClientpp]: Could not evaluate: Cannot 
> get status of NSClientpp, error was: The specified service does not exist as 
> an installed service.
> Information   21.01.2013 18:59:16 Puppet  1   None
> /Stage[main]/Nagios::Client/Package[NSClientpp]/ensure: created
> Information   21.01.2013 18:59:15 MsiInstaller1042NoneEnding 
> a Windows Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. 
> Client Process Id: 10316.
> Information   21.01.2013 18:59:15 MsiInstaller1035NoneWindows 
> Installer reconfigured the product. Product Name: NSClient++ (x64). Product 
> Version: 0.3.9.328. Product Language: 1033. Reconfiguration success or error 
> status: 0.
> Information   21.01.2013 18:59:15 MsiInstaller11728   None
> Product: NSClient++ (x64) -- Configuration completed successfully.
> Information   21.01.2013 18:59:13 MsiInstaller1040None
> Beginning a Windows Installer transaction: 
> c:\local\source\NSClient++-0.3.9-x64.msi. Client Process Id: 10316.
> Information   21.01.2013 18:29:06 Puppet  1   NoneFinished 
> catalog run in 4.30 seconds
> Error 21.01.2013 18:29:05 Puppet  3   None
> /Stage[main]/Nagios::Client/Service[NSClientpp]: Could not evaluate: Cannot 
> get status of NSClientpp, error was: The specified service does not exist as 
> an installed service.
> Information   21.01.2013 18:29:05 Puppet  1   None
> /Stage[main]/Nagios::Client/Package[NSClientpp]/ensure: created
> Information   21.01.2013 18:29:05 MsiInstaller1042NoneEnding 
> a Windows Installer transaction: c:\local\source\NSClient++-0.3.9-x64.msi. 
> Client Process Id: 14800.
> Informati

Re: [Puppet Users] Unable to replace a symlink with regular file

2013-01-21 Thread Sean Kelly
I've tried that as well. It doesn't work.


On Monday, January 21, 2013 12:34:00 PM UTC-6, Gary Larizza wrote:
>
>  You should be able to add  "force => true" and get this to work for you
>
> On Monday, January 21, 2013 at 9:19 AM, Sean Kelly wrote:
>
> I am running Puppet 2.7.x (x varies from 14 to 20 on different machines). 
>  I am trying to use Puppet to deploy a new Zabbix agent configuration file. 
> On all machines where the file wasn't a symlink, the deployment worked. 
> However, every machine where it is a link, Puppet refuses to replace teh 
> link with a regular file or do anything with it.
>
> I've read the type reference, and I see nothing specific about forcing 
> symlink replacement. I've looked at the source, and it seems like 
> remove_existing should be unlinking teh symlink ahead of my new file. But, 
> it isn't happening. Any suggestions on hwo to do this?
>
> File {
> backup => main,
> owner => "root",
> group => $operatingsystem ? {
> freebsd => "wheel",
> default => "root",
> },
> mode => 644,
> ensure => present,
> }
>
> class zabbix {
> file {
> '/usr/local/etc/zabbix':
> ensure => 'directory';
> '/usr/local/etc/zabbix/zabbix_agentd.conf':
> content => template("zabbix/zabbix_agentd.conf.erb"),
> }
> ...
>
> root@victor:~# ls -ld /usr/local/etc/zabbix/zabbix_agentd.conf
> lrwxr-xr-x  1 root  wheel  64 Dec  9  2011 
> /usr/local/etc/zabbix/zabbix_agentd.conf -> 
> /usr/local/flightaware/monitor-scripts/zabbix/zabbix_agentd.conf
>
> root@victor:~# puppet agent --test --debug --color=no | grep 
> zabbix_agentd.conf 2>&1
> debug: /Stage[main]/Zabbix/Service[zabbix_agentd]/subscribe: subscribes to 
> File[/usr/local/etc/zabbix/zabbix_agentd.conf]
> debug: /Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]: 
> Autorequiring File[/usr/local/etc/zabbix]
> debug: 
> /Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]/mode: 
> Not managing symlink mode
>
> Thanks!
>
>  -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/puppet-users/-/mw3dMbd96TkJ.
> To post to this group, send email to puppet...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> puppet-users...@googlegroups.com .
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>  
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/uzMEDywYxD8J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] how to make changes to the network configuration without connection errors?

2013-01-21 Thread Peter Bauer
hi,

i am very happy with a network configuration module so far, but there is 
one thing left i can not find a solution for:
if i change the network configuration e.g. from a single interface to a 
bonding interface using puppet (basically if-down and if-ups), the next 
steps in the run of the agent fail due to connection errors but then the 
agent seems to reconnect again during the run and is able to send the 
report (of course containing the errors) to the master.
Is there some way to avoid those errors (maybe by waiting for the interface 
to be up)?
Can somebody please elaborate more on the connection handling of the agent:
- does it keep a TCP connection and reconnect on errors only and just for 
the following steps?

thx,
Peter

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/8RCTtUTCTusJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] How to watch a logfile in Puppet?

2013-01-21 Thread Andrey Brindeyev
Hi!

I'm a newbie in Puppet with some Chef experience.

Now trying to convert my pet project from Chef to Puppet.

When I start a Tomcat is takes some time (several seconds).

I need to wait a line "Server startup in" in Tomcat's log before proceeding.

Here is a way which I used in Chef:

https://github.com/abrindeyev/documentr-tomcat-cookbooks/blob/master/cookbooks/tomcat7/providers/logwatcher.rb

And include following in your recipe:

tomcat7_logwatcher "#{tc7target}/apache-tomcat-#{tc7ver}/logs/catalina.out" do
  pattern "Server startup in"
  timeout 60
  action :watch_for_line
end


What is an easy way to do the same in Puppet world?

Andrey.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/WtW6gPXF42oJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: How to watch a logfile in Puppet?

2013-01-21 Thread llowder


On Monday, January 21, 2013 3:32:51 PM UTC-6, Andrey Brindeyev wrote:
>
> Hi!
>
> I'm a newbie in Puppet with some Chef experience.
>
> Now trying to convert my pet project from Chef to Puppet.
>
> When I start a Tomcat is takes some time (several seconds).
>
> I need to wait a line "Server startup in" in Tomcat's log before 
> proceeding.
>
> Here is a way which I used in Chef:
>
>
> https://github.com/abrindeyev/documentr-tomcat-cookbooks/blob/master/cookbooks/tomcat7/providers/logwatcher.rb
>
> And include following in your recipe:
>
> tomcat7_logwatcher "#{tc7target}/apache-tomcat-#{tc7ver}/logs/catalina.out" do
>   pattern "Server startup in"
>   timeout 60
>   action :watch_for_line
> end
>
>
> What is an easy way to do the same in Puppet world?
>
>
There isn't, really. Puppet is more about the state a node should be in, 
not so much the exact order the steps need to be done in. Puppet and Chef, 
while having the same end goals, are use two very different approaches.

If you can better describe what it is you are trying to accomplish, we can 
more than likely help you find the best way to do that.
 

> Andrey.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/z1B7xdLhBJ8J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Unable to replace a symlink with regular file

2013-01-21 Thread Gary Larizza
Have you tried explicitly setting the ensure value - a la "ensure => file" - on 
the files that might exist as symlinks?  I tested this out locally and was able 
to get Puppet to overwrite a symlink with a file declaration.


On Monday, January 21, 2013 at 11:31 AM, Sean Kelly wrote:

> I've tried that as well. It doesn't work.
> 
> 
> On Monday, January 21, 2013 12:34:00 PM UTC-6, Gary Larizza wrote:
> > You should be able to add  "force => true" and get this to work for you
> > 
> > 
> > On Monday, January 21, 2013 at 9:19 AM, Sean Kelly wrote:
> > 
> > > I am running Puppet 2.7.x (x varies from 14 to 20 on different machines). 
> > >  I am trying to use Puppet to deploy a new Zabbix agent configuration 
> > > file. On all machines where the file wasn't a symlink, the deployment 
> > > worked. However, every machine where it is a link, Puppet refuses to 
> > > replace teh link with a regular file or do anything with it.
> > > 
> > > I've read the type reference, and I see nothing specific about forcing 
> > > symlink replacement. I've looked at the source, and it seems like 
> > > remove_existing should be unlinking teh symlink ahead of my new file. 
> > > But, it isn't happening. Any suggestions on hwo to do this?
> > > 
> > > File {
> > > backup => main,
> > > owner => "root",
> > > group => $operatingsystem ? {
> > > freebsd => "wheel",
> > > default => "root",
> > > },
> > > mode => 644,
> > > ensure => present,
> > > }
> > > 
> > > 
> > > class zabbix {
> > > file {
> > > '/usr/local/etc/zabbix':
> > > ensure => 'directory';
> > > '/usr/local/etc/zabbix/zabbix_agentd.conf':
> > > content => template("zabbix/zabbix_agentd.conf.erb"),
> > > }
> > > 
> > > ...
> > > 
> > > root@victor:~# ls -ld /usr/local/etc/zabbix/zabbix_agentd.conf
> > > lrwxr-xr-x  1 root  wheel  64 Dec  9  2011 
> > > /usr/local/etc/zabbix/zabbix_agentd.conf -> 
> > > /usr/local/flightaware/monitor-scripts/zabbix/zabbix_agentd.conf
> > > 
> > > 
> > > root@victor:~# puppet agent --test --debug --color=no | grep 
> > > zabbix_agentd.conf 2>&1
> > > debug: /Stage[main]/Zabbix/Service[zabbix_agentd]/subscribe: subscribes 
> > > to File[/usr/local/etc/zabbix/zabbix_agentd.conf]
> > > debug: 
> > > /Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]: 
> > > Autorequiring File[/usr/local/etc/zabbix]
> > > debug: 
> > > /Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]/mode: 
> > > Not managing symlink mode
> > > 
> > > 
> > > Thanks!
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google Groups 
> > > "Puppet Users" group.
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msg/puppet-users/-/mw3dMbd96TkJ.
> > > To post to this group, send email to puppet...@googlegroups.com 
> > > (javascript:).
> > > To unsubscribe from this group, send email to 
> > > puppet-users...@googlegroups.com (javascript:).
> > > For more options, visit this group at 
> > > http://groups.google.com/group/puppet-users?hl=en.
> > 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/puppet-users/-/uzMEDywYxD8J.
> To post to this group, send email to puppet-users@googlegroups.com 
> (mailto:puppet-users@googlegroups.com).
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com 
> (mailto:puppet-users+unsubscr...@googlegroups.com).
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.

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



[Puppet Users] Re: How to watch a logfile in Puppet?

2013-01-21 Thread Andrey Brindeyev
I need to deploy Java artifact to Tomcat and run tests.
Due Java environment variables change I can't just put WAR file inside 
Tomcat, entire Tomcat app needs to be restarted.

If I start my tests immediately after Tomcat startup then they fail due 
"Connection refused" error.
I need to wait until Tomcat service start and initializes itself and all 
deployed artifacts. Easiest way to do that is to wait specified pattern in 
Tomcat's log file.

Andrey.

On Monday, January 21, 2013 2:04:24 PM UTC-8, llowder wrote:
>
>
>
> On Monday, January 21, 2013 3:32:51 PM UTC-6, Andrey Brindeyev wrote:
>>
>> Hi!
>>
>> I'm a newbie in Puppet with some Chef experience.
>>
>> Now trying to convert my pet project from Chef to Puppet.
>>
>> When I start a Tomcat is takes some time (several seconds).
>>
>> I need to wait a line "Server startup in" in Tomcat's log before 
>> proceeding.
>>
>> Here is a way which I used in Chef:
>>
>>
>> https://github.com/abrindeyev/documentr-tomcat-cookbooks/blob/master/cookbooks/tomcat7/providers/logwatcher.rb
>>
>> And include following in your recipe:
>>
>> tomcat7_logwatcher "#{tc7target}/apache-tomcat-#{tc7ver}/logs/catalina.out" 
>> do
>>   pattern "Server startup in"
>>   timeout 60
>>   action :watch_for_line
>> end
>>
>>
>> What is an easy way to do the same in Puppet world?
>>
>>
> There isn't, really. Puppet is more about the state a node should be in, 
> not so much the exact order the steps need to be done in. Puppet and Chef, 
> while having the same end goals, are use two very different approaches.
>
> If you can better describe what it is you are trying to accomplish, we can 
> more than likely help you find the best way to do that.
>  
>
>> Andrey.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/lsxSq_kvaK4J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: How to watch a logfile in Puppet?

2013-01-21 Thread Nan Liu
On Mon, Jan 21, 2013 at 4:28 PM, Andrey Brindeyev <
abrinde...@griddynamics.com> wrote:

> I need to deploy Java artifact to Tomcat and run tests.
> Due Java environment variables change I can't just put WAR file inside
> Tomcat, entire Tomcat app needs to be restarted.
>
> If I start my tests immediately after Tomcat startup then they fail due
> "Connection refused" error.
> I need to wait until Tomcat service start and initializes itself and all
> deployed artifacts. Easiest way to do that is to wait specified pattern in
> Tomcat's log file.
>

Just write and deploy the service startup wrapper script and ask puppet to
invoke that script for service start.

service { 'tomcat':
   ensure => running,
   start => custom_startup_script.
}

The custom startup script should just do the same thing as the chef script,
start the service, watch the log before exit, or timeout and fail.

Nan

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



Re: [Puppet Users] Puppet and Windows runtime error

2013-01-21 Thread Thomas Bendler
2013/1/21 Josh Cooper 

> [...]
> The name of the package in your manifest
>
>  package { 'NSClientpp':
>
> needs to match the name that is displayed in Add/Remove Programs.
>

Life could be so easy ... ;)

Now it's working as expected, thanks for the help!

Regards, Thomas
-- 
Linux ... enjoy the ride!

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



Re: [Puppet Users] Unable to replace a symlink with regular file

2013-01-21 Thread Sean Kelly
That worked, thanks! I didn't realize "file" was even a valid setting for 
ensure.

notice: 
/Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]/ensure: 
defined content as '{md5}6b3491d534f04c4eea426b9cf83e637d'
info: /Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]: 
Scheduling refresh of Service[zabbix_agentd]
notice: /Stage[main]/Zabbix/Service[zabbix_agentd]: Triggered 'refresh' 
from 1 events
notice: Finished catalog run in 5.32 seconds

Again, thanks!

On Monday, January 21, 2013 4:11:18 PM UTC-6, Gary Larizza wrote:
>
> Have you tried explicitly setting the ensure value - a la "ensure => file" 
> - on the files that might exist as symlinks?  I tested this out locally and 
> was able to get Puppet to overwrite a symlink with a file declaration.
>
> On Monday, January 21, 2013 at 11:31 AM, Sean Kelly wrote:
>
> I've tried that as well. It doesn't work.
>
>
> On Monday, January 21, 2013 12:34:00 PM UTC-6, Gary Larizza wrote:
>
>  You should be able to add  "force => true" and get this to work for you
>
> On Monday, January 21, 2013 at 9:19 AM, Sean Kelly wrote:
>
> I am running Puppet 2.7.x (x varies from 14 to 20 on different machines). 
>  I am trying to use Puppet to deploy a new Zabbix agent configuration file. 
> On all machines where the file wasn't a symlink, the deployment worked. 
> However, every machine where it is a link, Puppet refuses to replace teh 
> link with a regular file or do anything with it.
>
> I've read the type reference, and I see nothing specific about forcing 
> symlink replacement. I've looked at the source, and it seems like 
> remove_existing should be unlinking teh symlink ahead of my new file. But, 
> it isn't happening. Any suggestions on hwo to do this?
>
> File {
> backup => main,
> owner => "root",
> group => $operatingsystem ? {
> freebsd => "wheel",
> default => "root",
> },
> mode => 644,
> ensure => present,
> }
>
> class zabbix {
> file {
> '/usr/local/etc/zabbix':
> ensure => 'directory';
> '/usr/local/etc/zabbix/zabbix_agentd.conf':
> content => template("zabbix/zabbix_agentd.conf.erb"),
> }
> ...
>
> root@victor:~# ls -ld /usr/local/etc/zabbix/zabbix_agentd.conf
> lrwxr-xr-x  1 root  wheel  64 Dec  9  2011 
> /usr/local/etc/zabbix/zabbix_agentd.conf -> 
> /usr/local/flightaware/monitor-scripts/zabbix/zabbix_agentd.conf
>
> root@victor:~# puppet agent --test --debug --color=no | grep 
> zabbix_agentd.conf 2>&1
> debug: /Stage[main]/Zabbix/Service[zabbix_agentd]/subscribe: subscribes to 
> File[/usr/local/etc/zabbix/zabbix_agentd.conf]
> debug: /Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]: 
> Autorequiring File[/usr/local/etc/zabbix]
> debug: 
> /Stage[main]/Zabbix/File[/usr/local/etc/zabbix/zabbix_agentd.conf]/mode: 
> Not managing symlink mode
>
> Thanks!
>
>  -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/puppet-users/-/mw3dMbd96TkJ.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>  
>
>   -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/puppet-users/-/uzMEDywYxD8J.
> To post to this group, send email to puppet...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> puppet-users...@googlegroups.com .
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>  
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/CI6dzpN2iKEJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] ssh::auth and other ways of managing ssh keys

2013-01-21 Thread Wolf Noble
This is actually a module I would love to see CURATED by PL, as I believe it is 
a great real-world example to demonstrate the current recommendations from 
which many people can learn.

The focus is pretty tight, however it could make a lot of people's lives easier.
Many community members(1)(2)(3) (and I'm sure there are more) have mentioned 
that they've taken the time to improve on the existing module available on the 
(out of date) wiki(4) for their own needs. With some guidance and direction 
those improvements could be merged into a practical and useful example of some 
of the more intricate parts of puppet.

There are a lot of modules out there which have found interesting and creative 
ways to get from point A to point B. That doesn't mean that these are good 
examples to follow.
I'm not asserting that there is always only ONE "right" way to do (something)… 
however there ARE several ways that are certainly NOT the right way, and 
discerning the difference is not always easy.
I have been under the impression that puppetlabs modules are as close to living 
reference material as it gets. I'd like to see more examples out there, as I 
think community modules will show a real increase in both quality, and code 
similarity with a stronger authoritative reference base.

In other words, with a little effort on puppetlabs' part, this could have the 
benefit of
- Really increasing the immediately available sexy that puppet can accomplish 
out of the box
- Further the community's proverbial fishing skill
- Increasing the efficiency of module creation, as there will be more 'trusted' 
examples to start from
- Theoretically, more of the community's modules would become increasingly 
compatable as there is a greater pool of reference material to evolve from. 
This could serve to improve the average quality of modules available.. ergo 
moar win.

Thoughts?
(1) https://github.com/boklm/puppet-sshkeys
(2) https://github.com/vurbia/puppet-sshauth
(3) https://github.com/ashleygould/puppet-sshauth
(4)http://projects.puppetlabs.com/projects/1/wiki/Module_Ssh_Auth_Patterns#detailed-usage

On Jan 15, 2013, at 8:56 AM, nicolas vigier  wrote:

> On Mon, 14 Jan 2013, Ashley Gould wrote:
>
>>
>> I've created a puppet-sshauth repo on github:
>> https://github.com/ashleygould/puppet-sshauth
>>
>> I would very much like to work with others on perfecting this
>> module.  Management of keypairs is really useful.  2 improvements I
>> imagine are using hiera as the keystore and adding ablity to install
>> the same pubkey into multiple user accounts on a single node.
>
> Hello,
>
> I also reworked the ssh::auth module :
> https://github.com/boklm/puppet-sshkeys
>
> The main changes in this version are :
> - allow installing the same pubkey into multipe user accounts
> - allow installing multiple key pairs or pubkeys into one account
> - remove use of exported resources, for simplification
> - renaming resources to create_key, set_client_key_pair and
>   set_authorized_keys instead of key, client, server because I think
>   that's easier to understand
>
> It's not using hiera but it looks like a good idea for an improvement.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>




This message may contain confidential or privileged information. If you are not 
the intended recipient, please advise us immediately and delete this message. 
See http://www.datapipe.com/legal/email_disclaimer/ for further information on 
confidentiality and the risks of non-secure electronic communication. If you 
cannot access these links, please notify us by reply message and we will send 
the contents to you.

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



Re: [Puppet Users] (New To Puppet)Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class sudo for pupclient on node pupclient

2013-01-21 Thread Fusebox
yeah..I figured that out after posting..works after fixing it.. but thanks 
for looking into it and responding..appreciate much :)

On Sunday, January 20, 2013 8:40:54 PM UTC-6, nseagoon wrote:
>
> It looks like a syntax issue (at a minimum):
>
> *package { "sudo-ldap":*
> *ensure => present,*
> *require => Package["sudo],*
> *}*
> *}*
> *
> *
> There isn't a trailing doublequote for the "sudo" line.
>
> On 20 January 2013 16:38, Fusebox > wrote:
>
>> Hello Folks!
>>
>> I am trying to learn puppet. Installed the puppet 3.0.2 and configured 
>> one node as the master and the other as the client. Generated the certs and 
>> all that. But, I seem to be doing something wrong wrt to the init.pp file. 
>> Attached is exact error and my current server configuration. Any help in 
>> helping me fix this issue is appreciated:
>>
>> *[root@pupclient ~]# puppet agent --test*
>> *Info: Retrieving plugin*
>> *Error: Could not retrieve catalog from remote server: Error 400 on 
>> SERVER: Could not find class sudo for pupclient on node pupclient*
>> *Warning: Not using cache on failed catalog*
>> *Error: Could not retrieve catalog; skipping run*
>>
>> puppet.conf file on the client is pointed to the server which I named as 
>> puppet and which the client is able to resolve in DNS.
>> *[root@pupclient ~]# cat /etc/puppet/puppet.conf*
>> *[main]*
>> *# The Puppet log directory.*
>> *# The default value is '$vardir/log'.*
>> *logdir = /var/log/puppet*
>> *
>> *
>> *# Where Puppet PID files are kept.*
>> *# The default value is '$vardir/run'.*
>> *rundir = /var/run/puppet*
>> *
>> *
>> *# Where SSL certificates are kept.*
>> *# The default value is '$confdir/ssl'.*
>> *ssldir = $vardir/ssl*
>> *server=puppet*
>> *
>> *
>> *[agent]*
>> *# The file in which puppetd stores a list of the classes*
>> *# associated with the retrieved configuratiion.  Can be loaded in*
>> *# the separate ``puppet`` executable using the ``--loadclasses``*
>> *# option.*
>> *# The default value is '$confdir/classes.txt'.*
>> *classfile = $vardir/classes.txt*
>> *
>> *
>> *# Where puppetd caches the local configuration.  An*
>> *# extension indicating the cache format is added automatically.*
>> *# The default value is '$confdir/localconfig'.*
>> *localconfig = $vardir/localconfig*
>>
>> *
>> *
>> Below is the configuration on the puppet master:
>> *
>> *
>> *[root@puppet manifests]# pwd*
>> */etc/puppet/manifests*
>> *
>> *
>> *[root@puppet manifests]# cat site.pp*
>> *import 'nodes.pp'*
>> *$puppetserver = 'puppet'*
>> *
>> *
>> *[root@puppet manifests]# cat nodes.pp*
>> *node 'pupclient' {*
>> *include sudo*
>> *package {'firefox': ensure => present}*
>> *}*
>>
>> *[root@puppet manifests]# pwd*
>> */etc/puppet/modules/sudo/manifests*
>> *
>> *
>> *[root@puppet manifests]# ls -l*
>> *total 4*
>> *-rw-r--r-- 1 root root 327 Jan 19 23:15 init.pp*
>> *
>> *
>> *[root@puppet manifests]# cat init.pp*
>> *class sudo {*
>> *package { sudo:*
>> *ensure => present,*
>> *}*
>> *if $operatingsystem == "Ubuntu" {*
>> *package { "sudo-ldap":*
>> *ensure => present,*
>> *require => Package["sudo],*
>> *}*
>> *}*
>> *file { "/etc/sudoers":*
>> *owner => root,*
>> *group => root,*
>> *mode => 0440,*
>> *source => "puppet://$puppetserver/modules/sudo/etc/sudoers",*
>> *require => Package["sudo"],*
>> *}*
>> *}*
>> *
>> *
>> Is this error result of a syntax issue or something else?
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/puppet-users/-/elQPK2m6uLkJ.
>> To post to this group, send email to puppet...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> puppet-users...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/puppet-users?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/SDVqxW7FC-0J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Custom Error/Exception Handler

2013-01-21 Thread James Birchfield
I have looked over the documentation, but I did not see anything pertaining 
to this subject.  If there is documentation of such sort, could someone 
please point me to it?

Is it possible to register some sort of custom error/exception handler?  I 
would like to be able to register for any exception or error during a 
catalog run and potentially act upon said errors (i.e. create an SNMP trap, 
generate an email, etc.).  Is there a prescribed way to do this?

Thanks!

Birch

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/c4lzYX3_od8J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.