[Puppet Users] Re: Setting savedefult options with augeas/puppet

2011-10-13 Thread Luke Bigum
Can you give me an example of a grub.conf file that you want to
achieve? I don't have a dual boot windows system so not exactly sure
what option you mean.

On Oct 12, 9:15 pm, James A. Peltier jpelt...@sfu.ca wrote:
 Hi All,

 I'm trying to create a puppet manifest that sets the grub default= value to 
 saved and the Windows option to savedefault for a dual_boot class.  Setting 
 the default= option is actually fairly easy, but I'm not sure how to create 
 the savedefault entry for the Windows side.  Anyone have to deal with this 
 and have a suggestion?

 --
 James A. Peltier
 IT Services - Research Computing Group
 Simon Fraser University - Burnaby Campus
 Phone   : 778-782-6573
 Fax     : 778-782-3045
 E-Mail  : jpelt...@sfu.ca
 Website :http://www.sfu.ca/itservices
          http://blogs.sfu.ca/people/jpeltier
 I will do the best I can with the talent I have

-- 
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] How to inherit a parameterized class ? What is the syntax ?

2011-10-13 Thread Alexandre
Hi,

I am trying to manage the puppet.conf file, but both my classes
'puppet' and 'puppet::master' need to manage it. Basically, the class
'puppet::master' should be able to override the resource, which could
be done by inheritance.
My problem is that my class 'puppet' is a parameterized class:

class puppet ( $puppetmaster_fqdn ) {
file { '/etc/puppet/puppet.conf':
content = template('puppet/puppet.conf.erb'),
}
# (...)
}

and so, i don't find any syntax to inherit from it:

class puppet::master ( $with_dashboard  = 'yes',
   $with_cloud_provisioner  = 'no'
 ) inherits puppet {
# (...)
}

fails with

err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Must pass puppetmaster_fqdn to Class[Puppet] at /etc/puppet/
modules/puppet/manifests/puppet.pp:1 on node (...)

I tried different ways to declare my class 'puppet::master', but i do
not find the right syntax, it always fails

class puppet::master ( $puppetmaster_fqdn   = 'something',
   $with_dashboard  = 'yes',
   $with_cloud_provisioner  = 'no'
 ) inherits puppet {
# (...)
}

class puppet::master ( $with_dashboard  = 'yes',
   $with_cloud_provisioner  = 'no'
 ) inherits puppet( puppetmaster_fqdn =
'something' ) {
# (...)
}

What is the good syntax for that ?


Note also that i tried to work around the problem by using a virtual
resource for my File['/etc/puppet.conf'], and realize it in both
classes (without inheritance) but it did not end up as i wished. It
worked, but the templated file missed the content which should have
been triggered by the variables $with_dashboard from class
'puppet::master'

-- 
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] How to divide the puppet.conf file in multiple files ?

2011-10-13 Thread Alexandre
Hi,

How can i divide my puppet.conf file in multiple files ?
I would like to have the [main] and [agent] section in puppet.conf and
[master] in puppetmaster.conf for example. I could call sone include
or import  statement inside  puppet.conf to include the content of
puppetmaster.conf in my configuration

Not sure if this is a stupid question, but i could not find any
include or import statement in the man page of puppet.conf

Alex

-- 
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: Cannot reassign variable

2011-10-13 Thread jcbollinger


On Oct 12, 4:23 pm, Mohamed Lrhazi lrh...@gmail.com wrote:
 I have a custom fact called:  gu_app_oracle_rac

 Which gets set, indirectly, by puppet itself... and so in the very
 first run it does not exist... I will be changing the whole business
 of how I set these facts, but I need a quick workaround to the
 following issue...

 I have some templates using that variable and so the first run fails
 because the var is undefined, and so I added this to site.pp:

 if !defined(gu_app_oracle_rac) {
     $gu_app_oracle_rac = false

 }

 Now, this allows the first run, maybe a few, to work... then when the
 fact comes to life, I get:

 Cannot reassign variable gu_app_oracle_rac in site.pp

 Why doesn't the *if* statement do what I expect it to do?


Amplifying what Nan said, the 'defined' function is documented to be
for use with classes, resource types, and resource instances.  In your
case, therefore, it is looking for a class or definition named
gu_app_oracle_rac, and returning false when it doesn't find one.
Even if it worked on variables, however, 'defined' is parse-order
dependent and Puppet parse order is unpredictable, so using 'defined'
is never a good idea.  Ever.

As to the underlying problem, I'm confused about your description.  If
gu_app_oracle_rac is a custom fact, then aren't you delivering it to
clients via pluginsync?  If so then it should be available on every
run, including the first.


John

-- 
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: Cannot reassign variable

2011-10-13 Thread Mohamed Lrhazi
Thanks guys, I did not realize defined was for resources only, not variables.

The custom fact is created using a custom fact creator fact, which
makes other custom facts out of strings in a text file. the text file
itself is managed by puppet.

http://www.devco.net/archives/2008/06/16/rework_of_puppet_facts_for_etcfactstxt.php

And so it is normal that the text file based custom facts do not exist
in the first run...

Thanks,
Mohamed.


On Thu, Oct 13, 2011 at 8:59 AM, jcbollinger john.bollin...@stjude.org wrote:


 On Oct 12, 4:23 pm, Mohamed Lrhazi lrh...@gmail.com wrote:
 I have a custom fact called:  gu_app_oracle_rac

 Which gets set, indirectly, by puppet itself... and so in the very
 first run it does not exist... I will be changing the whole business
 of how I set these facts, but I need a quick workaround to the
 following issue...

 I have some templates using that variable and so the first run fails
 because the var is undefined, and so I added this to site.pp:

 if !defined(gu_app_oracle_rac) {
     $gu_app_oracle_rac = false

 }

 Now, this allows the first run, maybe a few, to work... then when the
 fact comes to life, I get:

 Cannot reassign variable gu_app_oracle_rac in site.pp

 Why doesn't the *if* statement do what I expect it to do?


 Amplifying what Nan said, the 'defined' function is documented to be
 for use with classes, resource types, and resource instances.  In your
 case, therefore, it is looking for a class or definition named
 gu_app_oracle_rac, and returning false when it doesn't find one.
 Even if it worked on variables, however, 'defined' is parse-order
 dependent and Puppet parse order is unpredictable, so using 'defined'
 is never a good idea.  Ever.

 As to the underlying problem, I'm confused about your description.  If
 gu_app_oracle_rac is a custom fact, then aren't you delivering it to
 clients via pluginsync?  If so then it should be available on every
 run, including the first.


 John

 --
 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 cant find a class

2011-10-13 Thread Nan Liu
On Wed, Oct 12, 2011 at 2:31 PM, Boskey bos...@gmail.com wrote:
 Hi,

 I am having trouble getting puppet to find a class thats defined in
 one of the modules.I have a module/folder called 'webserver' in /etc/
 puppet/modules/, which has a init.pp file with the below content

 class webserver{
 file {'test.txt':
        path = '/etc/test.txt',
        ensure = present,
        mode = 0640,
        source = puppet:///webserver/test.txt
     }
 }

The code above should be located in
/etc/puppet/modules/webserver/manifests/init.pp

Move the test.txt to /etc/puppet/modules/webserver/files/test.txt and
update your source to:
puppet:///modules/webserver/test.txt

 I have a nodes.pp file with

 node basenode {
        include webserver
 }

 node 'puppet-client02.eng.xyz.com'inherits basenode {
 }

 node 'puppet-client.eng.xyz.com'inherits basenode  {


 And the site.pp, file has

 -SNIP-
 import modules
 import nodes
 -SNIP-

You don't need either import statement.

HTH,

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 cant find a class

2011-10-13 Thread Craig White

On Oct 12, 2011, at 2:31 PM, Boskey wrote:

 Hi,
 
 I am having trouble getting puppet to find a class thats defined in
 one of the modules.I have a module/folder called 'webserver' in /etc/
 puppet/modules/, which has a init.pp file with the below content
 
 class webserver{
 file {'test.txt':
path = '/etc/test.txt',
ensure = present,
mode = 0640,
source = puppet:///webserver/test.txt
 }
 }
 
 I have a nodes.pp file with
 
 node basenode {
include webserver
 }
 
 node 'puppet-client02.eng.xyz.com'inherits basenode {
 }
 
 node 'puppet-client.eng.xyz.com'inherits basenode  {
 
 
 And the site.pp, file has
 
 -SNIP-
 import modules
 import nodes
 -SNIP-
 
 when I run the puppet on the client i get an error message:
 
 err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
 resource: Could not retrieve information from source(s) 
 puppet://puppet/plugins
 err: Could not retrieve catalog from remote server: Error 400 on
 SERVER: Could not find class webserver at /etc/puppet/manifests/
 nodes.pp:3 on node puppet-client.eng.xyz.com
 warning: Not using cache on failed catalog
 err: Could not retrieve catalog; skipping run
 
 
 Whats wrong here?, why cant puppet find the class 'webserver', i have
 checked with puppet--chkconfig modulepath, and the path is /etc/puppet/
 modules

Do these files exist in this path?

/etc/puppet/modules/webserver/manifests/init.pp
/etc/puppet/modules/webserver/files/test.txt

also, source?

source = puppet:///modules/webserver/test.txt

Craig

-- 
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 to inherit a parameterized class ? What is the syntax ?

2011-10-13 Thread Nan Liu
On Thu, Oct 13, 2011 at 3:16 AM, Alexandre alexandre.fou...@gmail.com wrote:
 Hi,

 I am trying to manage the puppet.conf file, but both my classes
 'puppet' and 'puppet::master' need to manage it. Basically, the class
 'puppet::master' should be able to override the resource, which could
 be done by inheritance.
 My problem is that my class 'puppet' is a parameterized class:

    class puppet ( $puppetmaster_fqdn ) {
        file { '/etc/puppet/puppet.conf':
            content = template('puppet/puppet.conf.erb'),
        }
        # (...)
    }

 and so, i don't find any syntax to inherit from it:

    class puppet::master ( $with_dashboard          = 'yes',
                           $with_cloud_provisioner  = 'no'
                         ) inherits puppet {
        # (...)
    }

 fails with

    err: Could not retrieve catalog from remote server: Error 400 on
 SERVER: Must pass puppetmaster_fqdn to Class[Puppet] at /etc/puppet/
 modules/puppet/manifests/puppet.pp:1 on node (...)

 I tried different ways to declare my class 'puppet::master', but i do
 not find the right syntax, it always fails

    class puppet::master ( $puppetmaster_fqdn       = 'something',
                           $with_dashboard          = 'yes',
                           $with_cloud_provisioner  = 'no'
                         ) inherits puppet {
        # (...)
    }

    class puppet::master ( $with_dashboard          = 'yes',
                           $with_cloud_provisioner  = 'no'
                         ) inherits puppet( puppetmaster_fqdn =
 'something' ) {
        # (...)
    }

 What is the good syntax for that ?

There's probably three ways to tackle it:
1. have the puppet class write a file called puppet.conf.agent, and
the master class write puppet.conf.master and cat puppet.conf.* 
puppet.conf.
2. use a variable and add some logic to the ERB template.
3. use the following syntax (be aware it realize and override):

In class puppet::master:

File | title=='/etc/puppet/puppet.conf' | {
  content = template('puppet/puppetmaster.conf.erb'),
}

HTH,

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.



[Puppet Users] how to check if a hash/array is empty or not in puppet .pp/module (not in template)?

2011-10-13 Thread midair77
Dear all,

I have a parameterized class and one of the args is a hash or an array
and I would like to check if they are empty or not?

I tried with

class test($hash, $array){
   if $hash.empty? == true
{
}
  if $array.empty? == true
{
}

}

but when I just
puppet parser validate init.pp

I would get this error: Could not parse for environment production:
Syntax error at '.'; expected '}' at.

Please help as this is important to know how to do this type of check.

Thank you in advance.

-- 
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 to check if a hash/array is empty or not in puppet .pp/module (not in template)?

2011-10-13 Thread Jacob Helwig
On Thu, 13 Oct 2011 10:01:49 -0700, midair77 wrote:
 
 Dear all,
 
 I have a parameterized class and one of the args is a hash or an array
 and I would like to check if they are empty or not?
 
 I tried with
 
 class test($hash, $array){
if $hash.empty? == true
 {
 }
   if $array.empty? == true
 {
 }
 
 }
 
 but when I just
 puppet parser validate init.pp
 
 I would get this error: Could not parse for environment production:
 Syntax error at '.'; expected '}' at.
 
 Please help as this is important to know how to do this type of check.
 
 Thank you in advance.
 

The cleanest way to do this would be to write a custom rvalue function
that does the Ruby check for you.  You can't call ruby directly from the
puppet language, so you need to use functions or inline templates.  I
definitely recommend going the function route, since it's much easier to
write tests for those, and your manifests end up looking much cleaner.

http://docs.puppetlabs.com/guides/custom_functions.html

-- 
Jacob Helwig


signature.asc
Description: Digital signature


Re: [Puppet Users] puppet apache module

2011-10-13 Thread Dan Sheffner
I found what I had was working.  Was just thrown off by the warnings.

On Thu, Oct 13, 2011 at 12:07 AM, thesheff17 dsheff...@gmail.com wrote:

 I'm getting this and it isn't applying my apache module. Is it because
 of these warnings?

 notice: Starting Puppet client version 2.7.5
 /usr/local/rvm/gems/ruby-1.9.2-p290/gems/puppet-2.7.5/lib/puppet/
 provider/service/freebsd.rb:8: warning: class variable access from
 toplevel
 /usr/local/rvm/gems/ruby-1.9.2-p290/gems/puppet-2.7.5/lib/puppet/
 provider/service/freebsd.rb:9: warning: class variable access from
 toplevel
 /usr/local/rvm/gems/ruby-1.9.2-p290/gems/puppet-2.7.5/lib/puppet/
 provider/service/freebsd.rb:10: warning: class variable access from
 toplevel
 /usr/local/rvm/gems/ruby-1.9.2-p290/gems/puppet-2.7.5/lib/puppet/
 provider/service/bsd.rb:11: warning: class variable access from
 toplevel
 info: Caching catalog for stagedns05.ttrb2b.com
 info: Applying configuration version '1318482080'
 notice: Finished catalog run in 0.27 seconds


 I want to make sure that I'm using a modules correctly.

 I have:
 /etc/puppet/modules/apache/manifests/init.pp
 class apache
 {
include apache::install, apache::service
 }

 /etc/puppet/modules/apache/manifests/service.pp
 class apache::service
 {
service
{
'apache2':
ensure = true,
hasstatus = true,
hasrestart = true,
enable = true,
require = Class[apache::install],
}
 }


 /etc/puppet/modules/apache/manifests/install.pp
 class apache::install
 {
package
{
['apache2']:
ensure = present,
}
 }

 /etc/puppet/manifests/nodes.pp
 node /^stagedns\d+\.example\.com/
 {
include apache
 }

 /etc/puppet/manifests/sites.pp
 import 'nodes.pp'


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



[Puppet Users] Re: how to check if a hash/array is empty or not in puppet .pp/module (not in template)?

2011-10-13 Thread midair77
Thank you very much..  I am writing a function to do that.


On Oct 13, 10:51 am, Jacob Helwig ja...@puppetlabs.com wrote:
 On Thu, 13 Oct 2011 10:01:49 -0700, midair77 wrote:

  Dear all,

  I have a parameterized class and one of the args is a hash or an array
  and I would like to check if they are empty or not?

  I tried with

  class test($hash, $array){
     if $hash.empty? == true
  {
  }
    if $array.empty? == true
  {
  }

  }

  but when I just
  puppet parser validate init.pp

  I would get this error: Could not parse for environment production:
  Syntax error at '.'; expected '}' at.

  Please help as this is important to know how to do this type of check.

  Thank you in advance.

 The cleanest way to do this would be to write a custom rvalue function
 that does the Ruby check for you.  You can't call ruby directly from the
 puppet language, so you need to use functions or inline templates.  I
 definitely recommend going the function route, since it's much easier to
 write tests for those, and your manifests end up looking much cleaner.

 http://docs.puppetlabs.com/guides/custom_functions.html

 --
 Jacob Helwig

  signature.asc
  1KViewDownload

-- 
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: how to check if a hash/array is empty or not in puppet .pp/module (not in template)?

2011-10-13 Thread Dan White
Please share it back with the list when you get it working.

Thanks.

“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin  Hobbes)

- midair77 midai...@gmail.com wrote:
 Thank you very much..  I am writing a function to do that.
 
 
 On Oct 13, 10:51 am, Jacob Helwig ja...@puppetlabs.com wrote:
  On Thu, 13 Oct 2011 10:01:49 -0700, midair77 wrote:
 
   Dear all,
 
   I have a parameterized class and one of the args is a hash or an array
   and I would like to check if they are empty or not?
 
   I tried with
 
   class test($hash, $array){
      if $hash.empty? == true
   {
   }
     if $array.empty? == true
   {
   }
 
   }
 
   but when I just
   puppet parser validate init.pp
 
   I would get this error: Could not parse for environment production:
   Syntax error at '.'; expected '}' at.
 
   Please help as this is important to know how to do this type of check.
 
   Thank you in advance.
 
  The cleanest way to do this would be to write a custom rvalue function
  that does the Ruby check for you.  You can't call ruby directly from the
  puppet language, so you need to use functions or inline templates.  I
  definitely recommend going the function route, since it's much easier to
  write tests for those, and your manifests end up looking much cleaner.
 
  http://docs.puppetlabs.com/guides/custom_functions.html
 
  --
  Jacob Helwig
 
   signature.asc
   1KViewDownload
 
 -- 
 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] Re: Problem with custom function returning array

2011-10-13 Thread Jacob Helwig
Did you topo part of the function definition, or does it actually have
'returnsources' at the end of the newfunction block?

You should have 'return sources', 'sources', or just leave that bit off,
since 'sources  puppet:///files/common/#{filename}' will return the
value of sources.

-- 
Jacob Helwig

On Thu, 13 Oct 2011 13:44:14 -0700, Nate wrote:
 
 Anybody have any thoughts on this?
 
 On Oct 7, 8:50 am, Nate nathan.schum...@gmail.com wrote:
  Hi,
 
  I'm trying create acustomfunctionthat willreturnanarrayof file
  paths for the file type source.  Instead of defining the followingarrayfor 
  source for each file type:
 
  file: { some_file:
    source = [ puppet:///file/$hostname/path, puppet:///file/$role/
  $mode/path, puppet:///file/$role/path, puppet:///file/common/
  path, ],
    ...
 
  }
 
  I've created acustomfunctiontoreturnthe generatedarraysimilar
  to the following:
 
  file: { some_file:
    source = find_file(path),
    ...
 
  }
 
  I'm getting the following message on the client:
 
  err: Could not retrieve catalog from remote server: Error 400 on
  SERVER:Function'find_file' does notreturna value at /etc/puppet/
  manifests/class/sudo.pp:12 on node tnfs01
 
  Thefunctionis located at /var/lib/puppet/lib/puppet/parser/functions/
  find_file.rb.
 
  Function:
 
  module Puppet::Parser::Functions
    newfunction(:find_file, :type = :rvalue) do |args|
      filename = args[0]
      hostname = lookupvar('hostname')
      role = lookupvar('role')
      mode = lookupvar('mode')
      sources =Array.new
      sources  puppet:///files/#{hostname}/#{filename}
      sources  puppet:///files/#{role}/#{mode}/#{filename}
      sources  puppet:///files/#{role}/#{filename}
      sources  puppet:///files/common/#{filename}
     returnsources
    end
  end
 
  Not sure what I'm doing wrong here.  Any help would be greatly
  appreciated.  Also, if there's already a built-in way to do this in
  Puppet I'd gladly ditch thecustomfunction, although I'd still like
  to figure out the problem for future reference.
 
  Thanks,
 
  Nate
 


signature.asc
Description: Digital signature


[Puppet Users] Re: Could not retrieve local facts: private method `split' called for nil:NilClass

2011-10-13 Thread Berry Sizemore
I would use puppet-enterprise-1.2.3-solaris-10-sparc instead of 1.2.1,
but the installer is broken.  I filed this bug on the issue -
http://projects.puppetlabs.com/issues/10069 - and if the package
doesn't have a problem, then I have no idea what dependency we haven't
satisfied.

Thanks,
Berry

On Oct 12, 1:25 pm, Nigel Kersten ni...@puppetlabs.com wrote:
 On Wed, Oct 12, 2011 at 1:17 PM, Berry Sizemore 
 berry.sizem...@gmail.comwrote:

  Hi all,

  When I set out learning Puppet I was using the free version (not PE)
  and was able to do all I wanted to do running the agent as the puppet
  user.  I recently switched to Puppet Enterprise when I hit the snag
  this thread is about, and continued the practice of running the agent
  as the puppet user.  Little did I know that PE employs prtdiag where
  the free version apparently doesn't (it could be failing silently).

 This must just be a version difference somewhere in what you're running.

 Puppet and Facter in PE are just specific versions of the open source
 projects.











  The giveaway is the error message prtdiag can only be run in the
  global zone, which for you beginners like me means you aren't doing
  this as root when you should be, but there is surely a highly
  technical/philosophical discussion behind my inexpert summary.
  Consult the documentation and/or your Solaris system administrator for
  a better explanation.

  It's fair to say that the Puppet Enterprise agent in Solaris 10 has a
  dependency on the root user.

  Thanks,
  Berry Sizemore

  On Oct 12, 11:04 am, Berry Sizemore berry.sizem...@gmail.com wrote:
   Adrien,

   Thanks for the reply.

   hostxyz: facter facterversion
   1.6.0

   hostxyz: facter
   prtdiag can only be run in the global zone
   Error: private method `split' called for nil:NilClass

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

 --
 Nigel Kersten
 Product Manager, Puppet Labs

-- 
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] Announce: Puppet 2.7.6rc3 available

2011-10-13 Thread Michael Stahnke
Puppet 2.7.6rc3 is available.

 This release candidate fixes a regression in the Exec resource that
prevented multi-line execs from working properly.


Release Notes for 2.7.6 series --
https://projects.puppetlabs.com/projects/puppet/wiki/Release_Notes

This release is available for download at:
http://downloads.puppetlabs.com/puppet/

See the Verifying Puppet Download section at:
http://projects.puppetlabs.com/projects/puppet/wiki/Downloading_Puppet

Please report feedback via the Puppet Labs Redmine site, using an affected
version of 2.7.6rc3 http://projects.puppetlabs.com/projects/puppet

Documentation is available at: http://docs.puppetlabs.com/index.html



Changes since RC2.

   (#9996) Restore functionality for multi-line commands in exec resources

Originally we were relying on the behavior that Array.new would call
 #to_a on its argument, which is a no-op if the object is already an
array.  When #to_a is called on a string, it does not always return
[original_string].  Because string.to_a is effectively equivalent to
string.each_line.to_a (at least in Ruby 1.8.7) we were breaking
commands with embedded newlines.

Manually wrapping the passed in command in an array, and calling
 #flatten is much safer since it will not helpfully split up the
command string for us.

-- 
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] parsedfile help needed

2011-10-13 Thread Guy Matz
Thanks for the reply!!  One more thing I can't quite figure out:  How to get
a new entry in my target file!  I can parse, but an entry in manifests
doesn't magically appear.  Do I need to add something to my provider or type
to get that to happen?  Any help would be s appreciated; i'm getting
tired of struggling with this!

vncserver/manifests/init.pp
class vncserver {
  vncserver { 'guymatz':
  port = '92',
  geometry = '1024x768',
  ensure = 'present'
  }
} # class vncserver


vncserver/lib/puppet/type/vncserver.rb
require 'puppet/property/list'
require 'puppet/provider/parsedfile'

Puppet::Type.newtype(:vncserver) do

ensurable

newparam(:port) do
  desc The vnc servers port assignment.  Will be +5900 on the server
end

newparam(:name) do
  isnamevar
  desc The user who will own the VNC session.
end

newparam(:geometry) do
  desc Resolution for VNC, in XxY, e.g. 1024x768.
end

newparam(:password) do
  desc Password to be put into users .vnc/passwd.
end

newparam(:args) do
  desc Optional arguments to be added to the vncserver command-line.
end

@doc = Installs and manages entries for vncservers.  For Redhat-bases
  systems, and likely many others, these entries will be in
  /etc/sysconfig/vncservers.

end


and, finally, my very unfinished provider:
vncserver/lib/puppet/provider/vncserver/parsed.rb:
require 'puppet/provider/parsedfile'

vncservers = /etc/sysconfig/vncservers

Puppet::Type.type(:vncserver).provide(:parsed,
  :parent =
Puppet::Provider::ParsedFile,
  :default_target = vncservers,
  :filetype = :flat
  ) do
  desc The vncserver provider that uses the ParsedFile class
  confine :exists = vncservers
  text_line :comment, :match = /^\s*#/;
  text_line :blank, :match = /^\s*$/;

  record_line :parsed,
  :joiner = '',
  :fields = %w{port geometry optional_args},
  :optional = %w{port geometry },
  :match = /^VNCSERVERARGS\[(\d+)\]=-geometry (\d+x\d+)(.*)$/,
  :to_line = proc { |record|
VNCSERVERARGS[#{record[:port]}]=\-geometry
#{record[:geometry]} #{record[:optional_args]}\
  }

  record_line :parsed_again,
  :joiner = '',
  :fields = %w{port_name},
  :optional = %w{port_name},
  :match = /^VNCSERVERS=(.*)$/,
  :to_line = proc { |record|
VNCSERVERS=\#{record[:port_name]}\
  }
end

-- 
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: Setting savedefult options with augeas/puppet

2011-10-13 Thread James Peltier
On Thu, Oct 13, 2011 at 1:24 AM, Luke Bigum luke.bi...@lmax.com wrote:

 Can you give me an example of a grub.conf file that you want to
 achieve? I don't have a dual boot windows system so not exactly sure
 what option you mean.




 # grub.conf generated by anaconda
 #
 # Note that you do not have to rerun grub after making changes to this file
 # NOTICE:  You have a /boot partition.  This means that
 #  all kernel and initrd paths are relative to /boot/, eg.
 #  root (hd0,2)
 #  kernel /vmlinuz-version ro root=/dev/ROOTDISK/root
 #  initrd /initrd-version.img
 #boot=/dev/sda
 default=0
 timeout=15
 splashimage=(hd0,2)/grub/splash.xpm.gz
 hiddenmenu
 password --md5 $1$CgIXv$laSfgcbmFW62.Y7PWbtBB0
 title CentOS (2.6.18-274.3.1.el5)
 root (hd0,2)
 kernel /vmlinuz-2.6.18-274.3.1.el5 ro root=/dev/ROOTDISK/root rhgb
 quiet
 initrd /initrd-2.6.18-274.3.1.el5.img
 title Windows
 rootnoverify (hd0,0)
 chainloader +1



default= should be set to saved
davedefault should be appended after chainloader +1

-- 
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: Setting savedefult options with augeas/puppet

2011-10-13 Thread James A. Peltier
- Original Message -
| On Thu, Oct 13, 2011 at 1:24 AM, Luke Bigum luke.bi...@lmax.com
| wrote:
| 
|  Can you give me an example of a grub.conf file that you want to
|  achieve? I don't have a dual boot windows system so not exactly sure
|  what option you mean.
| 
| 
| 
| 
|  # grub.conf generated by anaconda
|  #
|  # Note that you do not have to rerun grub after making changes to
|  this file
|  # NOTICE: You have a /boot partition. This means that
|  # all kernel and initrd paths are relative to /boot/, eg.
|  # root (hd0,2)
|  # kernel /vmlinuz-version ro root=/dev/ROOTDISK/root
|  # initrd /initrd-version.img
|  #boot=/dev/sda
|  default=0
|  timeout=15
|  splashimage=(hd0,2)/grub/splash.xpm.gz
|  hiddenmenu
|  password --md5 $1$CgIXv$laSfgcbmFW62.Y7PWbtBB0
|  title CentOS (2.6.18-274.3.1.el5)
|  root (hd0,2)
|  kernel /vmlinuz-2.6.18-274.3.1.el5 ro
|  root=/dev/ROOTDISK/root rhgb
|  quiet
|  initrd /initrd-2.6.18-274.3.1.el5.img
|  title Windows
|  rootnoverify (hd0,0)
|  chainloader +1
| 
| 
| 
| default= should be set to saved
| davedefault should be appended after chainloader +1

savedefault should be appended after chainloader +1

-- 
James A. Peltier
IT Services - Research Computing Group
Simon Fraser University - Burnaby Campus
Phone   : 778-782-6573
Fax : 778-782-3045
E-Mail  : jpelt...@sfu.ca
Website : http://www.sfu.ca/itservices
  http://blogs.sfu.ca/people/jpeltier
I will do the best I can with the talent I have

-- 
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] Problem with custom function returning array

2011-10-13 Thread Nan Liu
On Fri, Oct 7, 2011 at 6:50 AM, Nate nathan.schum...@gmail.com wrote:
 Hi,

 I'm trying create a custom function that will return an array of file
 paths for the file type source.  Instead of defining the following
 array for source for each file type:

 file: { some_file:
  source = [ puppet:///file/$hostname/path, puppet:///file/$role/
 $mode/path, puppet:///file/$role/path, puppet:///file/common/
 path, ],
  ...
 }

In general more desirable to be explicit about the file you are
distributing rather than using this pattern. Moving on to the issue.

 I've created a custom function to return the generated array similar
 to the following:

 file: { some_file:
  source = find_file(path),
  ...
 }

Function seems fine:
notice: Scope(Class[main]): puppet:///files/puppet/file.txt
puppet:///files/my_role//file.txt puppet:///files/my_role/file.txt
puppet:///files/common/file.txt
notice: Finished catalog run in 0.02 seconds

file: { ... should be file { some_file: ...

Are you using path as a variable instead of the actual file path?

file { some_file:
 source = find_file(/path/to/file),
 ...
}

HTH,

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] Re: how to check if a hash/array is empty or not in puppet .pp/module (not in template)?

2011-10-13 Thread Nan Liu
On Thu, Oct 13, 2011 at 11:41 AM, midair77 midai...@gmail.com wrote:
 Thank you very much..  I am writing a function to do that.


 On Oct 13, 10:51 am, Jacob Helwig ja...@puppetlabs.com wrote:
 On Thu, 13 Oct 2011 10:01:49 -0700, midair77 wrote:

  Dear all,

  I have a parameterized class and one of the args is a hash or an array
  and I would like to check if they are empty or not?

  I tried with

  class test($hash, $array){
     if $hash.empty? == true
  {
  }
    if $array.empty? == true
  {
  }

  }

  but when I just
  puppet parser validate init.pp

  I would get this error: Could not parse for environment production:
  Syntax error at '.'; expected '}' at.

  Please help as this is important to know how to do this type of check.

  Thank you in advance.

See empty function:
https://github.com/puppetlabs/puppetlabs-stdlib/tree/master/lib/puppet/parser/functions

Thanks,

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] How to inherit a parameterized class ? What is the syntax ?

2011-10-13 Thread Henrik Lindberg
Don't know if I am out on a limb here, but did you try setting class 
defaults?


class puppet::master inherits puppet {
  class { 'puppet': puppetmaster_fqdn = my wanted value }
  # ...
}

- henrik

On 10/13/11 12:16 PM, Alexandre wrote:

Hi,

I am trying to manage the puppet.conf file, but both my classes
'puppet' and 'puppet::master' need to manage it. Basically, the class
'puppet::master' should be able to override the resource, which could
be done by inheritance.
My problem is that my class 'puppet' is a parameterized class:

 class puppet ( $puppetmaster_fqdn ) {
 file { '/etc/puppet/puppet.conf':
 content =  template('puppet/puppet.conf.erb'),
 }
 # (...)
 }

and so, i don't find any syntax to inherit from it:

 class puppet::master ( $with_dashboard  = 'yes',
$with_cloud_provisioner  = 'no'
  ) inherits puppet {
 # (...)
 }

fails with

 err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Must pass puppetmaster_fqdn to Class[Puppet] at /etc/puppet/
modules/puppet/manifests/puppet.pp:1 on node (...)

I tried different ways to declare my class 'puppet::master', but i do
not find the right syntax, it always fails

 class puppet::master ( $puppetmaster_fqdn   = 'something',
$with_dashboard  = 'yes',
$with_cloud_provisioner  = 'no'
  ) inherits puppet {
 # (...)
 }

 class puppet::master ( $with_dashboard  = 'yes',
$with_cloud_provisioner  = 'no'
  ) inherits puppet( puppetmaster_fqdn =
'something' ) {
 # (...)
 }

What is the good syntax for that ?


Note also that i tried to work around the problem by using a virtual
resource for my File['/etc/puppet.conf'], and realize it in both
classes (without inheritance) but it did not end up as i wished. It
worked, but the templated file missed the content which should have
been triggered by the variables $with_dashboard from class
'puppet::master'




--
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] parsedfile help needed

2011-10-13 Thread Adrien Thebo
Unfortunately, the parsedfile provider is mainly documented by code
that uses it. I've been meaning to write up a document on it, but I've
been unable to find the time. In the mean time, the OSUOSL has some
providers for gentoo that use the parsedfile provider, found at
https://github.com/ramereth/puppet-gentoo/blob/master/lib/puppet/provider/package_use/parsed.rb
that may give you a bit more insight. Sorry for the non-answer here,
but this might get you a bit further along.

On Thu, Oct 13, 2011 at 2:47 PM, Guy Matz gm...@matz.org wrote:
 Thanks for the reply!!  One more thing I can't quite figure out:  How to get
 a new entry in my target file!  I can parse, but an entry in manifests
 doesn't magically appear.  Do I need to add something to my provider or type
 to get that to happen?  Any help would be s appreciated; i'm getting
 tired of struggling with this!

 vncserver/manifests/init.pp
 class vncserver {
   vncserver { 'guymatz':
   port = '92',
   geometry = '1024x768',
   ensure = 'present'
   }
 } # class vncserver


 vncserver/lib/puppet/type/vncserver.rb
 require 'puppet/property/list'
 require 'puppet/provider/parsedfile'

 Puppet::Type.newtype(:vncserver) do

     ensurable

     newparam(:port) do
   desc The vnc servers port assignment.  Will be +5900 on the server
     end

     newparam(:name) do
   isnamevar
   desc The user who will own the VNC session.
     end

     newparam(:geometry) do
   desc Resolution for VNC, in XxY, e.g. 1024x768.
     end

     newparam(:password) do
   desc Password to be put into users .vnc/passwd.
     end

     newparam(:args) do
   desc Optional arguments to be added to the vncserver command-line.
     end

     @doc = Installs and manages entries for vncservers.  For Redhat-bases
   systems, and likely many others, these entries will be in
   /etc/sysconfig/vncservers.

 end


 and, finally, my very unfinished provider:
 vncserver/lib/puppet/provider/vncserver/parsed.rb:
 require 'puppet/provider/parsedfile'

 vncservers = /etc/sysconfig/vncservers

 Puppet::Type.type(:vncserver).provide(:parsed,
   :parent =
 Puppet::Provider::ParsedFile,
   :default_target = vncservers,
   :filetype = :flat
   ) do
   desc The vncserver provider that uses the ParsedFile class
   confine :exists = vncservers
   text_line :comment, :match = /^\s*#/;
   text_line :blank, :match = /^\s*$/;

   record_line :parsed,
   :joiner = '',
   :fields = %w{port geometry optional_args},
   :optional = %w{port geometry },
   :match = /^VNCSERVERARGS\[(\d+)\]=-geometry (\d+x\d+)(.*)$/,
   :to_line = proc { |record|
     VNCSERVERARGS[#{record[:port]}]=\-geometry
 #{record[:geometry]} #{record[:optional_args]}\
   }

   record_line :parsed_again,
   :joiner = '',
   :fields = %w{port_name},
   :optional = %w{port_name},
   :match = /^VNCSERVERS=(.*)$/,
   :to_line = proc { |record|
     VNCSERVERS=\#{record[:port_name]}\
   }
 end

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



[Puppet Users] I managed to break my Cent5 mongrel puppetmaster after upgrading from EPEL .25.5 to 2.6.6

2011-10-13 Thread Mark Christian
CentOS release 5.7 (Final)
puppet-server-2.6.6-1.el5.noarch
ruby-1.8.5-19.el5_6.1.x86_64
rake, version 0.9.2

The upgrade from 25.5 to 2.6.6 had been working fine.

Not sure if this is relevant: I then attempted to get puppet-dashboard
working using this guide: 
http://docs.puppetlabs.com/guides/installing_dashboard.html
I managed to upgrade rake, but never got this to work: rake
RAILS_ENV=production db:migrate , I then decided to restart the
puppetmaster and now I get this message:

Starting puppetmaster:
Port: 18140/usr/lib/ruby/site_ruby/1.8/puppet/network/http.rb:8:in
`server_class_by_type': Mongrel is not installed on this platform
(ArgumentError)
from /usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:157:in
`http_server_class_by_type'
from /usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:137:in
`http_server_class'
from /usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:58:in
`initialize'
from /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:104:in
`new'
from /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:104:in
`main'
from /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:46:in
`run_command'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:304:in `run'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:410:in
`exit_on_fail'
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:304:in `run'
from /usr/sbin/puppetmasterd:4
   [FAILED]

Any help would be most appreciated.  Thanks in advance.

$ cat /etc/puppet/puppet.conf
[main]
# Where Puppet stores dynamic and growing data.
# The default value is '/var/puppet'.
vardir = /var/lib/puppet

# 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

[production]
modulepath=/etc/puppet/modules
manifest=/etc/puppet/manifests/site.pp

[development]
modulepath=/etc/puppet/environments/development/modules
manifest=/etc/puppet/environments/development/manifests/site.pp
trace=true
report=false

[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

[master]
user = root
storeconfigs = false
dbadapter = mysql
dbuser = puppet
dbpassword =
dbserver = localhost
dbsocket = /var/lib/mysql/mysql.sock

modulepath = $confdir/modules

factsync = true
factpath = $vardir/facts

environments=production,development

# The list of reports to generate.  All reports are looked for
# in puppet/reports/name.rb, and multiple report names should be
# comma-separated (whitespace is okay).
# The default value is 'store'.
reports = store, rrdgraph, tagmail
tagmap = /etc/puppet/tagmail.conf

# Whether RRD information should be graphed.
rrdgraph = true

# How often RRD should expect data.
# This should match how often the hosts report back to the server.
# The default value is '$runinterval'.
rrdinterval = $runinterval

# The directory where RRD database files are stored.
# Directories for each reporting host will be created under
# this directory.
# The default value is '$vardir/rrd'.
rrddir = $vardir/rrd

$ cat /etc/sysconfig/puppetmaster
# Location of the main manifest
#PUPPETMASTER_MANIFEST=/etc/puppet/manifests/site.pp

# Where to log general messages to.
# Specify syslog to send log messages to the system log.
#PUPPETMASTER_LOG=syslog

# You may specify an alternate port or an array of ports on which
# puppetmaster should listen. Default is: 8140
# If you specify more than one port, the puppetmaster ist
automatically
# started with the servertype set to mongrel. This might be
interesting
# if you'd like to run your puppetmaster in a loadbalanced cluster.
# Please note: this won't setup nor start any loadbalancer.
# If you'd like to run puppetmaster with mongrel as servertype but
only
# on one (specified) port, you have to add --servertype=mongrel to
# PUPPETMASTER_EXTRA_OPTS.
# Default: Empty (Puppetmaster isn't started with mongrel, nor on a
# specific port)
#
# Please note: Due to reduced options in the rc-functions lib in RHEL/
Centos
# versions prior to 5, this feature won't work. Fedora versions = 8
are
# known to work.
#PUPPETMASTER_PORTS=
# Puppetmaster on a 

[Puppet Users] Re: I managed to break my Cent5 mongrel puppetmaster after upgrading from EPEL .25.5 to 2.6.6

2011-10-13 Thread Mark Christian
I removed the rubygem-mongrel rpm and reinstalled it.  That appears to
have fixed my issue.

On Oct 13, 6:22 pm, Mark Christian mchri...@altera.com wrote:
 CentOS release 5.7 (Final)
 puppet-server-2.6.6-1.el5.noarch
 ruby-1.8.5-19.el5_6.1.x86_64
 rake, version 0.9.2

 The upgrade from 25.5 to 2.6.6 had been working fine.

 Not sure if this is relevant: I then attempted to get puppet-dashboard
 working using this 
 guide:http://docs.puppetlabs.com/guides/installing_dashboard.html
 I managed to upgrade rake, but never got this to work: rake
 RAILS_ENV=production db:migrate , I then decided to restart the
 puppetmaster and now I get this message:

 Starting puppetmaster:
 Port: 18140/usr/lib/ruby/site_ruby/1.8/puppet/network/http.rb:8:in
 `server_class_by_type': Mongrel is not installed on this platform
 (ArgumentError)
         from /usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:157:in
 `http_server_class_by_type'
         from /usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:137:in
 `http_server_class'
         from /usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:58:in
 `initialize'
         from /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:104:in
 `new'
         from /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:104:in
 `main'
         from /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:46:in
 `run_command'
         from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:304:in `run'
         from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:410:in
 `exit_on_fail'
         from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:304:in `run'
         from /usr/sbin/puppetmasterd:4
                                                            [FAILED]

 Any help would be most appreciated.  Thanks in advance.

 $ cat /etc/puppet/puppet.conf
 [main]
     # Where Puppet stores dynamic and growing data.
     # The default value is '/var/puppet'.
     vardir = /var/lib/puppet

     # 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

 [production]
 modulepath=/etc/puppet/modules
 manifest=/etc/puppet/manifests/site.pp

 [development]
 modulepath=/etc/puppet/environments/development/modules
 manifest=/etc/puppet/environments/development/manifests/site.pp
 trace=true
 report=false

 [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

 [master]
     user = root
     storeconfigs = false
     dbadapter = mysql
     dbuser = puppet
     dbpassword =
     dbserver = localhost
     dbsocket = /var/lib/mysql/mysql.sock

     modulepath = $confdir/modules

     factsync = true
     factpath = $vardir/facts

     environments=production,development

     # The list of reports to generate.  All reports are looked for
     # in puppet/reports/name.rb, and multiple report names should be
     # comma-separated (whitespace is okay).
     # The default value is 'store'.
     reports = store, rrdgraph, tagmail
     tagmap = /etc/puppet/tagmail.conf

     # Whether RRD information should be graphed.
     rrdgraph = true

     # How often RRD should expect data.
     # This should match how often the hosts report back to the server.
     # The default value is '$runinterval'.
     rrdinterval = $runinterval

     # The directory where RRD database files are stored.
     # Directories for each reporting host will be created under
     # this directory.
     # The default value is '$vardir/rrd'.
     rrddir = $vardir/rrd

 $ cat /etc/sysconfig/puppetmaster
 # Location of the main manifest
 #PUPPETMASTER_MANIFEST=/etc/puppet/manifests/site.pp

 # Where to log general messages to.
 # Specify syslog to send log messages to the system log.
 #PUPPETMASTER_LOG=syslog

 # You may specify an alternate port or an array of ports on which
 # puppetmaster should listen. Default is: 8140
 # If you specify more than one port, the puppetmaster ist
 automatically
 # started with the servertype set to mongrel. This might be
 interesting
 # if you'd like to run your puppetmaster in a loadbalanced cluster.
 # Please note: this won't setup nor start any loadbalancer.
 # If you'd like to run puppetmaster with mongrel as servertype but
 only
 # on one (specified) port, you have to add --servertype=mongrel to
 # PUPPETMASTER_EXTRA_OPTS.
 # Default: Empty 

[Puppet Users] defined resource type not working in 2.7.5

2011-10-13 Thread CraftyTech
Hello All,

 I'm having problems getting a simple defined resource type work. 
 Here's an example of what I'm trying to run:

class app_deployer2 {
 define fil($ensure) { file {$name:
   content = this is a test
   }
 }

 fil { File1 :ensure = /tmp/file1 }

 }

#
But when I run it, I keep on geting error:

err: Failed to apply catalog: Parameter path failed: File paths must be 
fully qualified, not 'File1' at 
/etc/puppet/modules/app_deployer2/manifests/init.pp:5

As far as I can tell, this should work, but is not.  Can anyone see what I'm 
missing?

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/-/PpYd3Zoy2DMJ.
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: defined resource type not working in 2.7.5

2011-10-13 Thread CraftyTech
This is the whole file:
class app_deployer2 {

define fil($ensure= present, $path) { file {$name:
   content = this is a test
   }
 }

fil { File1: path = /tmp/file1 }
}

#
and this is the error message I keep on getting:
err: Failed to apply catalog: Parameter path failed: File paths must be 
fully qualified, not 'File1' at 
/etc/puppet/modules/app_deployer2/manifests/init.pp:5

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/-/OQYJ1wm1fBMJ.
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.