[Puppet Users] hiera_hash explanation?

2011-09-06 Thread niksfirefly
Hi
I want to create parametrized class with hash parameter from
hiera .yaml file

so i got
hiera.yaml
backends:  - yaml
   - json
   - puppet
:hierarchy: - %{host}
- common
:json:
:datadir: /etc/puppet/hiera
:yaml:
:datadir: /etc/puppet/hiera

:puppet:
:datasource: data

common.yaml
---
 mailserver:
  uid: 8
  gid: 8

and
init.pp

class dovecot($mailserver = hiera_hash(mailserver))
{
notice(${mailserver[uid]})
notice(${mailserver[gid]})
}


i cant get values uid,gid from hash $mailserver
how can i do that?
or how to better debug why it is not working??

thx in advance for any clues

-- 
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] hiera_hash explanation?

2011-09-06 Thread R.I.Pienaar


- Original Message -
 Hi
 I want to create parametrized class with hash parameter from
 hiera .yaml file
 
 so i got
 hiera.yaml
 backends:  - yaml
- json
- puppet
 :hierarchy: - %{host}
 - common
 :json:
 :datadir: /etc/puppet/hiera
 :yaml:
 :datadir: /etc/puppet/hiera
 
 :puppet:
 :datasource: data
 
 common.yaml
 ---
  mailserver:
   uid: 8
   gid: 8
 
 and
 init.pp
 
 class dovecot($mailserver = hiera_hash(mailserver))
 {
 notice(${mailserver[uid]})
 notice(${mailserver[gid]})
 }
 
 
 i cant get values uid,gid from hash $mailserver
 how can i do that?
 or how to better debug why it is not working??

just do hiera(mailserver)

hiera_hash is a special lookup that builds a hash based on data found
at many levels of the hierarchy, if you have a single key with a array
or hash in it, then just look it up with hiera()

-- 
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: hiera_hash explanation? - SOLVED

2011-09-06 Thread niksfirefly

 just do hiera(mailserver)

 hiera_hash is a special lookup that builds a hash based on data found
 at many levels of the hierarchy, if you have a single key with a array
 or hash in it, then just look it up with hiera()

thank u now it works!

-- 
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] Cross-nodes modules: howto?

2011-09-06 Thread Francis GALIEGUE
Let's say I have a web application which I want to deploy separately:

* the static content and appropriate configuration on a machine with
Apache on it,
* the dynamic content and appropriate configuration on a machine with
Tomcat on it.

Is there a possibility to write a module which takes as an argument
the name of the Apache node and the name of the Tomcat node, along
with appropriate configurations for Apache and Tomcat, and which would
do what is appropriate so that this web application be
installed/updated/removed?

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

-- 
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: Puppet unable to find a defined resource.

2011-09-06 Thread jcbollinger


On Sep 2, 1:21 pm, Brad Krane brad.kr...@gmail.com wrote:
 Here is a very simple manifest that recreates this error:

 class foo {
   define bar ( $val ) {
     notice(bar($val))
   }

 }

 $some_hash = { 'name' = some_name }

 foo::bar { $some_hash['name']: }

 Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
 resource type foo::bar at /tmp/puptest.pp:9 on node www-cms-
 dev.fs.uwaterloo.ca

 This seems like a bug to me.


There is at minimum a documentation bug (the docs don't discuss
whether or how to interpolate hash values) and a bug / needed feature
regarding the extremely unhelpful error message.  I'm not sure whether
it's supposed to work to interpolate a hash value as you are
attempting to do (and I don't recall offhand whether you can
interpolate array elements either), but supporting that is at least a
viable feature request.

In the mean time, there are at least two workarounds I can think of.
One is to use an inline template to do your interpolation, and another
is to copy the hash value into an ordinary variable and then
interpolate that.  I would personally prefer the latter in most
circumstances; I find it clearer, especially if I need the hash value
more than once:

$theme_name = $theme['name']

# Site theme
drupal6::theme-repo { ${name}-${theme_name}:
}


Note also that there's a better solution for your simplified example,
where the string you want is exactly the hash value: just omit the
quotes.  To wit,

foo::bar { $some_hash['name']: }


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.



[Puppet Users] Skipped schedule resources in reports

2011-09-06 Thread Greg Sutcliffe
Hi all,

Since upgrading a few test machines from 2.6.7 to 2.7.3, I've noticed 
something slightly odd. Every single run reports 6 skipped resources, yet 
the reports are empty - they only state the execution time as per usual). On 
digging further it seems that the auto-generated Schedule resources 
(type/schedule.rb, line 307) are the entities being skipped, presumably 
because I'm not using them in any of my manifests.

This is leading to a lot of reports with spurious data in them - since I 
don't use schedules, why should I care that Puppet skipped the default ones? 
This wouldn't be an issue, but I'm processing the reports and producing 
emails which summarize activity in the last hour, so for every 2.7.3 node, 
I'm seeing 12 skipped resources per hour, which is noise that swamps the 
real data of resources that have changed for good reason.

Is there a way to disable these default schedules, or the reporting of them? 
I tried --ignoreschedules on the commandline, but I get the impression 
that this causes other resources to run outside their normal schedule, 
rather than disabling the schedules themselves.

As a hack, I added return Array.new to the self.mkdefaultschedules listed 
above, which stops the resources being generated, but this seems an ugly 
hack, and one I seem to have to make on every node. Is there a better way?

Regards,
Greg

-- 
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/-/KUcUT4hu148J.
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] config files for ruby dsl manifests

2011-09-06 Thread Matt
I know I brought this up in a different post a while ago in as a
different question.

Whats the best way to locate a configuration file from a ruby
manifest? I'm tring to load a yaml for database properties but so far
the only way to make it work is if I explicitly define a path either
manually or looking up a specific module path. The latter being an
issue if the module name is not known when it is installed.

-- 
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] Cross-nodes modules: howto?

2011-09-06 Thread Brian Gallew
I do this with a define.  In my case, I define a web application and pass in
several arrays of hosts.  This expands, in turn, to a series of if
statements that check to see which array (if any) $hostname is in and then
sets appropriate variables.  I use this to generate Nagios hostgroups,
assign roles, generate configuration files, etc.  And since the ugliness is
all in the define, the manifest is very readable, e.g.
complete_app_environment{ Production Reno
  app_servers = [host1, host2, host3],
  web_servers = [host4, host5],
  solr_servers = [host6, host7],
  mule_servers = [host8, host9],
  external_name = foo.bar.com;
}

On Tue, Sep 6, 2011 at 5:13 AM, Francis GALIEGUE f...@one2team.com wrote:

 Let's say I have a web application which I want to deploy separately:

 * the static content and appropriate configuration on a machine with
 Apache on it,
 * the dynamic content and appropriate configuration on a machine with
 Tomcat on it.

 Is there a possibility to write a module which takes as an argument
 the name of the Apache node and the name of the Tomcat node, along
 with appropriate configurations for Apache and Tomcat, and which would
 do what is appropriate so that this web application be
 installed/updated/removed?

 --
 Francis Galiegue
 ONE2TEAM
 Ingénieur système
 Mob : +33 (0) 683 877 875
 Tel : +33 (0) 178 945 552
 f...@one2team.com
 40 avenue Raymond Poincaré
 75116 Paris

 --
 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] classes with parameters

2011-09-06 Thread David Kavanagh
I have a node def that refers to 2 classes like this;

node default {
  class {
[ eucalyptus, eucalyptus::nc ]:
  }
}


The 2nd requires the first class.

Now, I've added parameters to the 2nd class and would like to set
values here. What is the appropriate way to do that? I'm looking at
the docs here and not seeing a clear way. I'll just try some things to
see what works in the meantime.
http://docs.puppetlabs.com/guides/parameterized_classes.html

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.



Re: [Puppet Users] classes with parameters

2011-09-06 Thread Gabriel Filion
Hi,

On 11-09-06 11:11 AM, David Kavanagh wrote:
 I have a node def that refers to 2 classes like this;
 
 node default {
   class {
 [ eucalyptus, eucalyptus::nc ]:
   }
 }
 
 
 The 2nd requires the first class.
 
 Now, I've added parameters to the 2nd class and would like to set
 values here. What is the appropriate way to do that?

Did you try to split the two classes up? e.g.:

class {
  'eucalyptus':
  'eucalyptus::nc':
 arg1 = value1,
}

-- 
Gabriel Filion

-- 
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] Slightly OT: Puppet + OpenQRM

2011-09-06 Thread treydock
I've recently been looking to move my KVM management (currently via
Puppet and virt-manager) to something web-based and robust (ie
Cloud), and came across OpenQRM.  Looking at the features list it
mentions puppet Class/Machine management.  Has anyone that uses
Puppet extensively given this a try?  I'd like to get input on how
this works.  The only ENC or GUI interface I've used with Puppet is
Foreman (which is awesome btw), but this peaked my interest.  Thus far
I've tried Cloudstack (a few months ago) and Convirt, both were great,
but not what I needed.

Any input on experiences with OpenQRM as it relates to Puppet would be
great, thanks.

- Trey

-- 
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] config files for ruby dsl manifests

2011-09-06 Thread Nan Liu
On Tue, Sep 6, 2011 at 7:24 AM, Matt mjbl...@gmail.com wrote:
 I know I brought this up in a different post a while ago in as a
 different question.

 Whats the best way to locate a configuration file from a ruby
 manifest? I'm tring to load a yaml for database properties but so far
 the only way to make it work is if I explicitly define a path either
 manually or looking up a specific module path. The latter being an
 issue if the module name is not known when it is installed.

Not sure if there's an exposed API that's more suitable. What are you
using currently for find the file in a specific module?

I'm not sure why the module name is unknown, unless you are planning
to allow someone to change it during installation. Similar to puppet
manifests you should be able to use the puppet variable $module_name
if you are on 2.6+. Since the files directory is intended for file
service, the best place for the config is probably the templates
directory. The following should return the fully qualified filepath to
the config file in the module templates dir:

Puppet::Parser::Files.find_template_in_module(#{scope.lookup_var('module_name')}/config.yaml)

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.



[Puppet Users] Re: config files for ruby dsl manifests

2011-09-06 Thread Matt
I'm trying to write a ruby dsl manifest that pulls data from a
database. The issue I'm trying to overcome is I dont want to have to
hardcode the location of the db configuration. If I set it at the
init.pp level the configuration it will be picked up as top scope and
dumped to the facts, and also be visible to other things like
mcollective.

The piece of code you provided did not work for me, it looks like I'm
not able to pull back the module name from scope it seems.

On Sep 6, 11:56 am, Nan Liu n...@puppetlabs.com wrote:
 On Tue, Sep 6, 2011 at 7:24 AM, Matt mjbl...@gmail.com wrote:
  I know I brought this up in a different post a while ago in as a
  different question.

  Whats the best way to locate a configuration file from a ruby
  manifest? I'm tring to load a yaml for database properties but so far
  the only way to make it work is if I explicitly define a path either
  manually or looking up a specific module path. The latter being an
  issue if the module name is not known when it is installed.

 Not sure if there's an exposed API that's more suitable. What are you
 using currently for find the file in a specific module?

 I'm not sure why the module name is unknown, unless you are planning
 to allow someone to change it during installation. Similar to puppet
 manifests you should be able to use the puppet variable $module_name
 if you are on 2.6+. Since the files directory is intended for file
 service, the best place for the config is probably the templates
 directory. The following should return the fully qualified filepath to
 the config file in the module templates dir:

 Puppet::Parser::Files.find_template_in_module(#{scope.lookup_var('module_n­ame')}/config.yaml)

 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] Re: config files for ruby dsl manifests

2011-09-06 Thread Nan Liu
On Tue, Sep 6, 2011 at 9:08 AM, Matt mjbl...@gmail.com wrote:
 I'm trying to write a ruby dsl manifest that pulls data from a
 database. The issue I'm trying to overcome is I dont want to have to
 hardcode the location of the db configuration. If I set it at the
 init.pp level the configuration it will be picked up as top scope and
 dumped to the facts, and also be visible to other things like
 mcollective.

 The piece of code you provided did not work for me, it looks like I'm
 not able to pull back the module name from scope it seems.

What version of Puppet?

Here's a full example with file path:

# init.rb
hostclass :custom do
  pmod  = scope.lookupvar('module_name')
  fpath = Puppet::Parser::Files.find_template_in_module(#{pmod}/config.yaml)
  notify pmod, :message = pmod
  notify fpath, :message = fpath
end

Directory layout in modules:

└── custom
   ├── manifests
   │   └── init.rb
   ├── templates
   │   └── config.yaml
   └── tests
       └── init.pp

Sample output:
notice: custom
notice: /Stage[main]/Custom/Notify[custom]/message: defined 'message'
as 'custom'
notice: /Users/nan/.puppet/modules/custom/templates/config.yaml
notice: 
/Stage[main]/Custom/Notify[/Users/nan/.puppet/modules/custom/templates/config.yaml]/message:
defined 'message' as
'/Users/nan/.puppet/modules/custom/templates/config.yaml'
notice: Finished catalog run in 0.04 seconds

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] puppet dashboard 1.2.0 install problem on ubuntu 10.04

2011-09-06 Thread Bram Vogelaar
turns out that the dashboard workers need to run as root instead of www-data
because the fact that the reports are create by the root user

On 6 September 2011 01:08, Denmat tu2bg...@gmail.com wrote:

 Hi,

 Not sure of the exact answer but can your www-data user read that
 directory? What user is trying to access the file? What's the perms on the
 directory?

 Cheers,
 Den


 On 05/09/2011, at 21:59, Bram Vogelaar myli...@teambla.com wrote:

 *Hello folks**
 **I have trying to install puppet dashboard on our ubuntu 10.04 setup but
 am currently stuck on the following problem.**after the installation and
 the db sync the application refuses import any reports. In the background
 job notifier i find error messages like this one below.* *
 **Does anyone know how to proceed from here?* *
 **bram* *
 * *Importing report report-1540-1.yaml* at *2011-09-05 11:49 UTC* Permission 
 denied - /usr/share/puppet-dashboard/spool/report-1540-1832.yaml
 Backtracehttp://puppetmaster.pkpd.gorlaeus.net:3000/delayed_job_failures
  /usr/share/puppet-dashboard/app/models/report.rb:86:in `read'  
 /usr/share/puppet-dashboard/app/models/report.rb:86:in
 `create_from_yaml_file'*
 *

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


-- 
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] Slightly OT: Puppet + OpenQRM

2011-09-06 Thread James Turnbull
treydock wrote:
 I've recently been looking to move my KVM management (currently via
 Puppet and virt-manager) to something web-based and robust (ie
 Cloud), and came across OpenQRM.  Looking at the features list it
 mentions puppet Class/Machine management.  Has anyone that uses
 Puppet extensively given this a try?  I'd like to get input on how
 this works.  The only ENC or GUI interface I've used with Puppet is
 Foreman (which is awesome btw), but this peaked my interest.  Thus far
 I've tried Cloudstack (a few months ago) and Convirt, both were great,
 but not what I needed.
 
 Any input on experiences with OpenQRM as it relates to Puppet would be
 great, thanks.

Trey

So I wrote a very basic article some time ago:

http://searchenterpriselinux.techtarget.com/tip/How-to-install-and-get-started-with-OpenQRM

Things have changed quite a bit with the product since then and the best
bet is probably to talk to the primary guy - Matthias Rechenburg.

Cheers

James


-- 
James Turnbull
Puppet Labs
1-503-734-8571

Join us for PuppetConf http://www.bit.ly/puppetconfsig, September 22nd
and 23rd in Portland, Oregon, USA.

-- 
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: config files for ruby dsl manifests

2011-09-06 Thread Matt
I am using 2.6.6, when I try your example I get a empty string back, I
tried with 'module_name' and the actual name of the module and both
return an empty string.



On Sep 6, 12:27 pm, Nan Liu n...@puppetlabs.com wrote:
 On Tue, Sep 6, 2011 at 9:08 AM, Matt mjbl...@gmail.com wrote:
  I'm trying to write a ruby dsl manifest that pulls data from a
  database. The issue I'm trying to overcome is I dont want to have to
  hardcode the location of the db configuration. If I set it at the
  init.pp level the configuration it will be picked up as top scope and
  dumped to the facts, and also be visible to other things like
  mcollective.

  The piece of code you provided did not work for me, it looks like I'm
  not able to pull back the module name from scope it seems.

 What version of Puppet?

 Here's a full example with file path:

 # init.rb
 hostclass :custom do
   pmod  = scope.lookupvar('module_name')
   fpath = Puppet::Parser::Files.find_template_in_module(#{pmod}/config.yaml)
   notify pmod, :message = pmod
   notify fpath, :message = fpath
 end

 Directory layout in modules:

 └── custom
    ├── manifests
    │   └── init.rb
    ├── templates
    │   └── config.yaml
    └── tests
        └── init.pp

 Sample output:
 notice: custom
 notice: /Stage[main]/Custom/Notify[custom]/message: defined 'message'
 as 'custom'
 notice: /Users/nan/.puppet/modules/custom/templates/config.yaml
 notice: 
 /Stage[main]/Custom/Notify[/Users/nan/.puppet/modules/custom/templates/conf­ig.yaml]/message:
 defined 'message' as
 '/Users/nan/.puppet/modules/custom/templates/config.yaml'
 notice: Finished catalog run in 0.04 seconds

 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] classes with parameters

2011-09-06 Thread Gabriel Filion
On 11-09-06 12:15 PM, David Kavanagh wrote:
 Thanks,
 It wasn't clicking that it was an array notation.

hep, no problem ;)

I thought it was a little bit weird too, to be changing from include
classname to class { 'classname': ...}. (e.g. because of the 'class'
reserved word, it now looks like you're defining a new class inside your
nodes)
But I guess once you get the hang of it, it's not that bad. Being able
to use the same notation as other kinds of resources is a good thing.

-- 
Gabriel Filion

-- 
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] The require function

2011-09-06 Thread Douglas Garstang
The puppet documentation at
http://docs.puppetlabs.com/references/stable/function.html says for
the require function, that:

Evaluate one or more classes, adding the required class as a dependency.

This implies that any resources in the required class are
automatically added as a dependancy. I'm NOT seeing this behaviour.
How is it supposed to work?

Doug

-- 
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: The require function

2011-09-06 Thread Douglas Garstang
On Tue, Sep 6, 2011 at 11:52 AM, Douglas Garstang
doug.garst...@gmail.com wrote:
 The puppet documentation at
 http://docs.puppetlabs.com/references/stable/function.html says for
 the require function, that:

 Evaluate one or more classes, adding the required class as a dependency.

 This implies that any resources in the required class are
 automatically added as a dependancy. I'm NOT seeing this behaviour.
 How is it supposed to work?

 Doug


Actually, more specifically, I have this:

class platform::common {
file {
'/etc/somedir':
ensure = directory;
}

class webapp::common {
require platform::common
file {
/etc/somedir/configfile:
# stuff here.
}
}

When puppet runs, it's trying to apply the file
/etc/somedir/configfile _before_ /etc/somedir. This seems to
contradict the behaviour the documentation describes.

Doug.



-- 
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: doug.garst...@gmail.com
Cell: +1-805-340-5627

-- 
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] OS X Lion group membership not updated

2011-09-06 Thread David Thompson
Switching to puppet (2.7.3) for managing my OS X Lion systems, I'm
finding group membership not being updated.

Starting out, user dt is not a member of group dt-grp:

# dscl . read /groups/dt-grp | grep GroupMembership
GroupMembership:

...Run puppet, says it adds to the group:

# puppet agent --test --environment production
info: Caching catalog for cypress.keck.waisman.wisc.edu
info: Applying configuration version '1315332406'
notice: /Stage[main]/Users_test/User[dt]/groups: groups changed '' to
'dt-grp'
notice: Finished catalog run in 0.89 seconds

...but the user still isn't part of the group:

# dscl . read /groups/dt-grp | grep GroupMembership
GroupMembership:

...Hrm, let's add the user manually...

# dseditgroup -o edit -n . -a dt dt-grp
# dscl . read /groups/dt-grp | grep GroupMembership
GroupMembership: dt

...But puppet still tries to add the user to the group...

# puppet agent --test --environment production
info: Caching catalog for cypress.keck.waisman.wisc.edu
info: Applying configuration version '1315332406'
notice: /Stage[main]/Users_test/User[dt]/groups: groups changed '' to
'dt-grp'
notice: Finished catalog run in 0.83 seconds

Any help much appreciated...

-- 
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] Package provider for gentoo?

2011-09-06 Thread Peter Berghold
Once again I'm experimenting with the Gentoo Linux distro and trying to get
puppet to work with it.  I'm starting to think it is a lost cause.

In my puppet setup I have a list of packages that are built on any system
that I support regardless of the systems final use. These include tmpwatch,
snmpd, ntpd.. you get the idea.  Using the templates I already had in place
I run puppetd for the first time on the target host and got the following
error:


warning: Found multiple default providers for package: pip, gem; using pip

I checked the on-line documentation and found there was a provider (or so
the docs said) for portage, which was good news to me since I know that
Gentoo is portage based.  So I added to my site.pp file:

if ( $operatingsystem == gentoo ) {
Package { provider = portage }
}

Well in the words of my son, Epic Fail.

Now I get:
err: Could not prefetch package provider 'portage': Command update_eix is
missing

I'm running puppet 2.7.3 on both the puppet master and the client.   Any
thoughts?


-- 
Peter L. Berghold
Owner, Shark River Technical Solutions LLC

-- 
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] OS X Lion group membership not updated

2011-09-06 Thread James Turnbull
David Thompson wrote:
 Switching to puppet (2.7.3) for managing my OS X Lion systems, I'm
 finding group membership not being updated.
 
 
 Any help much appreciated...
 

David

I think there are a bunch of OSX Lion bugs in the ticket DB that might
be worth checking if this one is picked up. We've got code for some and
need to do some refactoring for others.

Cheers

James

-- 
James Turnbull
Puppet Labs
1-503-734-8571

Join us for PuppetConf http://www.bit.ly/puppetconfsig, September 22nd
and 23rd in Portland, Oregon, USA.

-- 
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] Package provider for gentoo?

2011-09-06 Thread James Turnbull
Peter Berghold wrote:
 Now I get:
 err: Could not prefetch package provider 'portage': Command update_eix
 is missing
 
 I'm running puppet 2.7.3 on both the puppet master and the client.   Any
 thoughts?

Caveat: I am not a Gentoo person.

Is the binary update_eix present on the host?

James

-- 
James Turnbull
Puppet Labs
1-503-734-8571

Join us for PuppetConf http://www.bit.ly/puppetconfsig, September 22nd
and 23rd in Portland, Oregon, USA.

-- 
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] Package provider for gentoo?

2011-09-06 Thread Peter Berghold
Doing a google after I sent the email I found the following page:

http://projects.puppetlabs.com/projects/puppet/wiki/Puppet_Gentoo

after doing a emerge eix and re-running the puppet transaction things
*look* to be going normally can't tell for sure since it is still
running and it is not generating any spew for me to look at.

I'll know in a while if it worked.



On Tue, Sep 6, 2011 at 3:43 PM, James Turnbull ja...@puppetlabs.com wrote:

 Peter Berghold wrote:
  Now I get:
  err: Could not prefetch package provider 'portage': Command update_eix
  is missing
 
  I'm running puppet 2.7.3 on both the puppet master and the client.   Any
  thoughts?

 Caveat: I am not a Gentoo person.

 Is the binary update_eix present on the host?

 James

 --
 James Turnbull
 Puppet Labs
 1-503-734-8571

 Join us for PuppetConf http://www.bit.ly/puppetconfsig, September 22nd
 and 23rd in Portland, Oregon, USA.

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




-- 
Peter L. Berghold
Owner, Shark River Technical Solutions LLC

-- 
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: The require function

2011-09-06 Thread Craig White

On Sep 6, 2011, at 11:58 AM, Douglas Garstang wrote:

 On Tue, Sep 6, 2011 at 11:52 AM, Douglas Garstang
 doug.garst...@gmail.com wrote:
 The puppet documentation at
 http://docs.puppetlabs.com/references/stable/function.html says for
 the require function, that:
 
 Evaluate one or more classes, adding the required class as a dependency.
 
 This implies that any resources in the required class are
 automatically added as a dependancy. I'm NOT seeing this behaviour.
 How is it supposed to work?
 
 Doug
 
 
 Actually, more specifically, I have this:
 
 class platform::common {
file {
'/etc/somedir':
ensure = directory;
 }
 
 class webapp::common {
require platform::common
file {
/etc/somedir/configfile:
# stuff here.
}
 }
 
 When puppet runs, it's trying to apply the file
 /etc/somedir/configfile _before_ /etc/somedir. This seems to
 contradict the behaviour the documentation describes.

Suggest you try this...
class webapp::common {
   include platform::common
   file {
   /etc/somedir/configfile:
   require = Class[platform::common],
   # stuff here.
   }
}

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] Re: The require function

2011-09-06 Thread R.I.Pienaar


- Original Message -
  class platform::common {
 file {
 '/etc/somedir':
 ensure = directory;
  }
  
  class webapp::common {
 require platform::common
 file {
 /etc/somedir/configfile:
 # stuff here.
 }
  }
  
  When puppet runs, it's trying to apply the file
  /etc/somedir/configfile _before_ /etc/somedir. This seems to
  contradict the behaviour the documentation describes.
 
 Suggest you try this...
 class webapp::common {
include platform::common
file {
/etc/somedir/configfile:
require = Class[platform::common],
# stuff here.
}
 }

files auto require their parents, it's not even needed to do
the require = or require()

He's not showing actual code, log lines or errors.

-- 
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: The require function

2011-09-06 Thread R.I.Pienaar


- Original Message -
 
 
 That's a feature in newish versions, right?

no, it's been there for ages and ages.

-- 
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] Package provider for gentoo?

2011-09-06 Thread Matthew Marlowe
Peter,

Puppet works great on gentoo with the following caveats:
- Puppet conceptually uses a binary package paradigm, and one needs to
work around that.  It would be nice if we could extend puppet for
gentoo to make it more source based distribution aware and
especially allow it to manage portage configuration files and limit
compile times/etc.
- Do to the differences between binary and source, one frequently will
setup puppet to run only once/day on server nodes during off peak
hours so that any compiling/package dependencies will not occur during
critical periods - and if possible, all compiling will occur on the
build server prior to puppet agent calls on other nodes.
- Gentoo supports more cron systems than puppet supports (last I
checked, puppet did not support fcron)
- Gentoo admins are slightly behind redhat/fedora admins in writing
public modules, this is an area where there is a significant amount of
activity and I hope we can eventually catch up on.
- The handling of dependencies and libraries is not clear cut, and one
usually has to create a separate script to run after puppet to ensure
linking is correct and that python/perl/etc modules are happy.

There are additional issues, but all of them to date can be reasonably
overcome/managed.  I've been in contact with many admins w/ larger
sized clusters and improving the puppet experience on gentoo is a
frequent topic of conversation.  I wouldn't be discouraged by any
initial issues
you find.

Matt

On Tue, Sep 6, 2011 at 12:46 PM, Peter Berghold salty.cowd...@gmail.com wrote:
 Doing a google after I sent the email I found the following page:

 http://projects.puppetlabs.com/projects/puppet/wiki/Puppet_Gentoo

 after doing a emerge eix and re-running the puppet transaction things
 *look* to be going normally can't tell for sure since it is still
 running and it is not generating any spew for me to look at.

 I'll know in a while if it worked.



 On Tue, Sep 6, 2011 at 3:43 PM, James Turnbull ja...@puppetlabs.com wrote:

 Peter Berghold wrote:
  Now I get:
  err: Could not prefetch package provider 'portage': Command update_eix
  is missing
 
  I'm running puppet 2.7.3 on both the puppet master and the client.   Any
  thoughts?

 Caveat: I am not a Gentoo person.

 Is the binary update_eix present on the host?

 James

 --
 James Turnbull
 Puppet Labs
 1-503-734-8571

 Join us for PuppetConf http://www.bit.ly/puppetconfsig, September 22nd
 and 23rd in Portland, Oregon, USA.

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




 --
 Peter L. Berghold
 Owner, Shark River Technical Solutions LLC

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




-- 
Matthew Marlowe
m...@professionalsysadmin.com
Senior Internet Infrastructure Consultant         DevOps/VMware/SysAdmin
https://www.twitter.com/deploylinux                       Gentoo Linux Dev

           Courage is not simply one of the virtues, but the form
              of every virtue at the testing point.  -- C.S. Lewis

-- 
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] Package provider for gentoo?

2011-09-06 Thread Daniel Pittman
On Tue, Sep 6, 2011 at 13:26, Matthew Marlowe
m...@professionalsysadmin.com wrote:

 Puppet works great on gentoo with the following caveats:
 - Puppet conceptually uses a binary package paradigm, and one needs to
 work around that.  It would be nice if we could extend puppet for
 gentoo to make it more source based distribution aware and
 especially allow it to manage portage configuration files and limit
 compile times/etc.

Er, that isn't really true.  The closest you could come was that our
timeouts might not suit, for example, hours of compilation to install
a package, but it fundamentally shouldn't fail.  If it does, file a
bug.

(Note, for example, that our gem package provider absolutely does
support native compiled code on install.)

This comes down to the package provider depending on eix, which is
presumably some sort of interface to portage that isn't standard;
fixing the provider should fix the problem there.  That pretty much
depends on someone who cares sending an appropriate patch.  (hint ;)

 - Do to the differences between binary and source, one frequently will
 setup puppet to run only once/day on server nodes during off peak
 hours so that any compiling/package dependencies will not occur during
 critical periods - and if possible, all compiling will occur on the
 build server prior to puppet agent calls on other nodes.
 - Gentoo supports more cron systems than puppet supports (last I
 checked, puppet did not support fcron)

Only vixie cron.


 - The handling of dependencies and libraries is not clear cut, and one
 usually has to create a separate script to run after puppet to ensure
 linking is correct and that python/perl/etc modules are happy.

You *should* be able to tie that together with an appropriate exec to
at least automate it.

Daniel
-- 
⎋ Puppet Labs Developer – http://puppetlabs.com
♲ Made with 100 percent post-consumer electrons

-- 
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: The require function

2011-09-06 Thread Douglas Garstang
On Tue, Sep 6, 2011 at 1:19 PM, R.I.Pienaar r...@devco.net wrote:


 - Original Message -


 That's a feature in newish versions, right?

 no, it's been there for ages and ages.

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



Well this is all awfully confusing. The documentation pretty clearly
says that using the require function automatically adds that class as
a dependancy. If so, why would I need to explicitly add require = to
resources? If I had to do that, I'd use include instead. Can someone
at Puppet Labs maybe chime in here.?

Douglas.

-- 
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] Package provider for gentoo?

2011-09-06 Thread Matthew Marlowe
 This comes down to the package provider depending on eix, which is
 presumably some sort of interface to portage that isn't standard;
 fixing the provider should fix the problem there.  That pretty much
 depends on someone who cares sending an appropriate patch.  (hint ;)


That's probably most of it.  Can you provide a link to the file(s) on
github within the puppet source specific to the gentoo packaging
provider?  I'll see if I can find to review it and consider extending
or updating it to understand more of the gentoo build specific
procedures.  I'm not sure if this might require adding new keywords or
resources, or if we're just talking about setting and creating class
variables that the provider would interpret and implement.


 - The handling of dependencies and libraries is not clear cut, and one
 usually has to create a separate script to run after puppet to ensure
 linking is correct and that python/perl/etc modules are happy.

 You *should* be able to tie that together with an appropriate exec to
 at least automate it.


Yes and no -- it's not a clear cut process.  Most of the time there
are just a few calls after a package is installed, but frequently
you'll want to limit those calls until all other package operations
are complete, and/or run the calls over and over to slowly resolve
dependencies if there is a failure.  Some of the calls can also be
quite expensive so they are only run when certain packages are
modified - so there might be a bit of intelligence that has to be
stored in code to get a fully optimized robust solution.  Differing
versions of portage can also have an impact/etc.

 Daniel
 --
 ⎋ Puppet Labs Developer – http://puppetlabs.com
 ♲ Made with 100 percent post-consumer electrons

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





-- 
Matthew Marlowe
m...@professionalsysadmin.com
Senior Internet Infrastructure Consultant         DevOps/VMware/SysAdmin
https://www.twitter.com/deploylinux                       Gentoo Linux Dev

           Courage is not simply one of the virtues, but the form
              of every virtue at the testing point.  -- C.S. Lewis

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