[Puppet Users] help using unless in exec for postgres database creation

2011-08-15 Thread Corey Osman
Hi, I have the following exec type: exec{"createdb": path => "/usr/bin:/usr/sbin:/bin", command => "sudo -u postgres createdb -U postgres -E UNICODE opennms", unless => "sudo -u postgres psql -l | grep opennms > /dev/null", require => Service["postgresql"], }

[Puppet Users] Re: need help with using tamplate function in Ruby DSL

2011-08-15 Thread piavlo
Nau , thank you so much it works !!! I was somehow stuck after trying other example based on the wiki call_function "notice", ["params1"] which did not work while the correct example did not draw my attention call_function(:realize,
 'Foo[bar]') Both examples seem to be valid, just syntactica

Re: [Puppet Users] ANNOUNCE: Puppet 2.7.3

2011-08-15 Thread David L Ballenger
Since upgrading for Puppet 2.7.1 to 2.7.3 I have been getting the following error whenever a Puppet agent runs: err: Failed to apply catalog: Parameter options failed: Options must be provided as an array, not a comma separated list I ran the puppet agent with --test and --debug and got the ou

Re: [Puppet Users] Corrupted inventory.txt - how to rebuild?

2011-08-15 Thread Nan Liu
On Mon, Aug 15, 2011 at 2:10 PM, Sean Carolan wrote: > We have an issue where sometimes servers get assigned serial number > "0x" in the inventory.txt file.  This causes major problems > including SSL cert errors in the log file.  Anyone know how to > properly rebuild inventory.txt without tea

Re: [Puppet Users] Re: trying to resolve group dependency in creating users

2011-08-15 Thread Gary Larizza
On Mon, Aug 15, 2011 at 3:02 PM, Jim N wrote: > Hi and thanks for your response. > > On Aug 15, 5:30 pm, Gary Larizza wrote: > > > There is an implicit relationship between managed users and groups in > > Puppet. If you're managing the group 'admin' and the user 'ringo' and > ringo > > needs to

Re: [Puppet Users] Enabling yum-repo on fly?

2011-08-15 Thread Stefan Schulte
On Mon, Aug 15, 2011 at 11:17:47AM -0700, Sans wrote: > Dear all, > > Is there any way to enable a particular yum-repo (like: yum -- > enablerepo=), which is disabled as default, for a > particular package installation? For our system, we need to "dag" for > particular two packages but keeping it

[Puppet Users] Re: trying to resolve group dependency in creating users

2011-08-15 Thread Jim N
Hi and thanks for your response. On Aug 15, 5:30 pm, Gary Larizza wrote: > There is an implicit relationship between managed users and groups in > Puppet.  If you're managing the group 'admin' and the user 'ringo' and ringo > needs to be a part of the 'admin' group, Puppet will do the right thin

Re: [Puppet Users] Notify/Require in config tests

2011-08-15 Thread Denmat
Hi, A couple of ways come to mind. Use the 'before' metaparameter in your configtest exec. You can use ordering syntax '->' between your resources, see http://docs.puppetlabs.com/guides/language_guide.html#chaining-resources See this for a complete overview: http://docs.puppetlabs.com/learnin

Re: [Puppet Users] Re: need help with using tamplate function in Ruby DSL

2011-08-15 Thread Nan Liu
In the wiki link you sent, I would try: call_function(:template, ...) Thanks, Nan On Mon, Aug 15, 2011 at 2:30 PM, piavlo wrote: >  Is there any Ruby DSL expert that has a clue how to use the template > function properly? > > Thanks > > On Aug 12, 9:06 pm, piavlo wrote: >>  HI, >> >> I'm tryin

[Puppet Users] Re: need help with using tamplate function in Ruby DSL

2011-08-15 Thread piavlo
Is there any Ruby DSL expert that has a clue how to use the template function properly? Thanks On Aug 12, 9:06 pm, piavlo wrote: >  HI, > > I'm trying to use tamplate function in ruby dsl but I miserably fail. > Then I just invoke it without using it in any resource like this > > template ['nag

Re: [Puppet Users] trying to resolve group dependency in creating users

2011-08-15 Thread Gary Larizza
On Mon, Aug 15, 2011 at 2:26 PM, Aaron Grewell wrote: > Have you tried including require => Group['admin'] in the user > declaration? I try to perform my Requires at the resource level instead of > the class level if at all possible. > > On Mon, Aug 15, 2011 at 2:04 PM, Jim Nachlin wrote: > >> Hi

Re: [Puppet Users] trying to resolve group dependency in creating users

2011-08-15 Thread Aaron Grewell
Have you tried including require => Group['admin'] in the user declaration? I try to perform my Requires at the resource level instead of the class level if at all possible. On Mon, Aug 15, 2011 at 2:04 PM, Jim Nachlin wrote: > Hi all, > > Using Puppet 2.5, I have a class which creates users: >

[Puppet Users] Re: Enabling yum-repo on fly?

2011-08-15 Thread Sans
Hi Douglas, could you provide a bit of sample code pls? Cheers!! On Aug 15, 7:20 pm, Douglas Garstang wrote: > You could do it with an Exec{} that enables the repo, another Exec{} that > does a yum clean (but requires the first Exec{}), a Package{} that requires > the first two Exec{}'s, and the

[Puppet Users] trying to resolve group dependency in creating users

2011-08-15 Thread Jim Nachlin
Hi all, Using Puppet 2.5, I have a class which creates users: # cat modules/users/manifests/init.pp class users { user { 'ringo': ensure => present, uid=> '1506', groups => ['admin'], shell => '/bin/bash', home => '/home/ringo', managehome =>

[Puppet Users] Corrupted inventory.txt - how to rebuild?

2011-08-15 Thread Sean Carolan
We have an issue where sometimes servers get assigned serial number "0x" in the inventory.txt file. This causes major problems including SSL cert errors in the log file. Anyone know how to properly rebuild inventory.txt without tearing everything out and starting from scratch? -- You receiv

[Puppet Users] scoping question - I want a node specific "global" var

2011-08-15 Thread Rich Rauenzahn
Is it possible to do something like this within the new scoping rules? It seems that $::IMSPECIAL doesn't refer to the decl in node a. And I can't use class parms as the variable is evaluated in a base class. Suggestions? Currently using puppet 2.7.1 node a { $IMSPECIAL=true include foo

Re: [Puppet Users] Nagios hostgroups

2011-08-15 Thread Denmat
Hi, http://docs.puppetlabs.com/guides/exported_resources.html You will need to include more detail for further help, like version of puppet and a snippet of how you are realizing them. Do any other exported resources work in your manifest? Cheers, Den On 16/08/2011, at 2:08, key...@gmail.com w

[Puppet Users] Re: Enabling yum-repo on fly?

2011-08-15 Thread Ramin K
Use include to set the packages your Dag repo is allowed to install. http://docs.puppetlabs.com/references/stable/type.html#yumrepo Or pull the packages into you local repo. On Aug 15, 11:17 am, Sans wrote: > Dear all, > > Is there any way to enable a particular yum-repo (like: yum -- > enabler

Re: [Puppet Users] enviroments are not being used

2011-08-15 Thread Frederiko Costa
Hello everyone, First of all, thanks for the prompt help. I should be able to move forward. I followed the suggestions pointed here. None of them seemed to work. However, the problem was in the versions I was using. I could not confirm in changelogs, but the versions I had installed from both di

[Puppet Users] ANNOUNCE: Puppet 2.7.3

2011-08-15 Thread Michael Stahnke
As stated a few days ago [1], the 2.7.2 series died in the Thunderdome[2], as per our release process. August has brought about 2.7.3. This includes all fixes from the 2.7.2, series as well as several new fixes and enhancements. This is also the first release of the 2.7 (Statler) series, that in

Re: [Puppet Users] Enabling yum-repo on fly?

2011-08-15 Thread Douglas Garstang
You could do it with an Exec{} that enables the repo, another Exec{} that does a yum clean (but requires the first Exec{}), a Package{} that requires the first two Exec{}'s, and then a final Exec{} that disables the repo again, and depends on everything else happening first. Ick On Mon, Aug 15

[Puppet Users] Enabling yum-repo on fly?

2011-08-15 Thread Sans
Dear all, Is there any way to enable a particular yum-repo (like: yum -- enablerepo=), which is disabled as default, for a particular package installation? For our system, we need to "dag" for particular two packages but keeping it always enabled, clashes with other packages, which we don't want t

Re: [Puppet Users] Vanishing facts

2011-08-15 Thread John T. Guthrie
On Fri, 2011-08-12 at 14:31 -0400, John T. Guthrie wrote: > On Thu, 2011-08-11 at 17:45 -0500, Nan Liu wrote: > > On Thu, Aug 11, 2011 at 4:59 PM, John T. Guthrie wrote: > > Thank you very much for the quick response. > > > > Hello all, > > > > > > I am running puppet 2.7.1 with mongrel and an

Re: [Puppet Users] Dashboard rhel5 problems

2011-08-15 Thread Michael Stahnke
We also can recommend Puppet Enterprise, which includes ruby 1.8.7 and passenger pre-configured. Mike -- 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 g

Re: [Puppet Users] using host resource with hiera data source

2011-08-15 Thread Nan Liu
On Sun, Aug 14, 2011 at 10:18 AM, Alex L. Demidov wrote: > I'm trying to implement /etc/hosts handling using hiera as data > source, but my current implementation requires data duplication > because I could pass only array of strings as $name to host resource. > Is there any way to avoid such data

Re: [Puppet Users] Notify/Require in config tests

2011-08-15 Thread Nan Liu
On Mon, Aug 15, 2011 at 6:29 AM, Jonathan Gazeley wrote: > Hi all, > > I'm trying to set up a routine in puppet where if a service is scheduled for > a restart, eg because of new configs, then a config test is executed first. > If the config test fails, the service is not restart (and so keeps run

Re: [Puppet Users] Dashboard rhel5 problems

2011-08-15 Thread Craig White
I think if you intend to run any reasonable ruby and/or rails applications on RHEL 5.x or CentOS 5.x, you should probably be using Ruby Enterprise Edition... http://www.rubyenterpriseedition.com/ Craig On Aug 15, 2011, at 9:05 AM, Marek Dohojda wrote: > So I moved further. The issue is ruby v

Re: [Puppet Users] Nagios hostgroups

2011-08-15 Thread keymon
Sent from my Verizon Wireless BlackBerry -Original Message- From: Jonathan Gazeley Sender: puppet-users@googlegroups.com Date: Mon, 15 Aug 2011 17:03:02 To: Puppet Users Reply-To: puppet-users@googlegroups.com Subject: [Puppet Users] Nagios hostgroups Hi all, I'm using various exporte

Re: [Puppet Users] Dashboard rhel5 problems

2011-08-15 Thread Marek Dohojda
So I moved further. The issue is ruby version. Dashboard passenger ruby apparently wants to be above version 1.8.5, which is the default version for RHEL5. This likely would not have been an issue if I haven't already upgrade puppet to 2.6.6 and thereby loaded new passenger. I will see if there

[Puppet Users] Nagios hostgroups

2011-08-15 Thread Jonathan Gazeley
Hi all, I'm using various exported resources for Nagios, including @@nagios_host, @@nagios_service and others. Elsewhere in my manifest I am using all of these commands to realise the resources on my Nagios server. All of these commands work fine except for Nagios_hostgroup which does not pr

[Puppet Users] Installing 'rpm' using puppet

2011-08-15 Thread Sans
Dear all, I'm trying to write a module, to install a few rpm packages on the agent. This is what I've started with: class emi_repo { $emiVer = 'emi-release-1.0.0-1.sl5.noarch.rpm' package { 'yum-priorities': ensure => latest; 'yum-protectbase': ensure => installed;

[Puppet Users] Notify/Require in config tests

2011-08-15 Thread Jonathan Gazeley
Hi all, I'm trying to set up a routine in puppet where if a service is scheduled for a restart, eg because of new configs, then a config test is executed first. If the config test fails, the service is not restart (and so keeps running with the old config, rather than stopping and causing an