[Puppet Users] Re: Why?

2011-08-11 Thread ki_chi_saga
 See the little arrows?
No i didn't 

 See the puppet language guide.
I did and now (...) I see it!

Thank you!
Rgds
 Mat
..
On Aug 10, 4:28 pm, vagn scott vagnsc...@gmail.com wrote:
 On 08/10/2011 02:40 AM, ki_chi_saga wrote:   exec { 'a':  ... } -
    exec { 'b':  ... } -
    exec { 'c':  ... }

  can I really be sure that puppet evaluates this in the sequence of
  writing?

 See the little arrows?

      -

 That is one way to declare sequence.  There are others.
 See the puppet language guide.

 --
 vagn

-- 
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: Strange Could not find dependency error

2011-08-11 Thread Christian Kauhaus
Am 10.08.2011 22:24, schrieb piavlo:
 Does anyone have clear logical explanation why nagios::client 
 nagios::server
 have no dep problems but nagios-client  nagios-server does?

- is no legal character in identifier names. Unfortunately, the error
messages are not very helpful in such a case.

Regards

Christian

-- 
Dipl.-Inf. Christian Kauhaus  · k...@gocept.com · systems administration
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 11 · fax +49 345 1229889 1
Zope and Plone consulting and development

-- 
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] Custom manifest

2011-08-11 Thread Himanshu Raina
Hi,


Can I execute a command basis on some criteria in puppet. For example, I
would want to execute the following command

svn up; /usr/local/apache/bin/apachectl restart

only if revision number of file on host = revision number of file on svn

i.e.

/usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep
Revision| cut -d: -f2| sed -e's/ //g' = /usr/bin/svn info
http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf|
grep Revision| cut -d: -f2| sed -e's/ //g'

Is it possible or instead can I do a md5sum of both the configurations i.e
one available on svn and one on the host machine and if they differ execute
the command else exit ??

Regards,

-- 
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] Custom manifest

2011-08-11 Thread Scott Smith
Why don't you generate httpd.conf from a template in Puppet and restart
apache if deemed necessary?

On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina dopedoxy...@gmail.comwrote:

 Hi,


 Can I execute a command basis on some criteria in puppet. For example, I
 would want to execute the following command

 svn up; /usr/local/apache/bin/apachectl restart

 only if revision number of file on host = revision number of file on svn

 i.e.

 /usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep
 Revision| cut -d: -f2| sed -e's/ //g' = /usr/bin/svn info
 http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf|
  grep Revision| cut -d: -f2| sed -e's/ //g'

 Is it possible or instead can I do a md5sum of both the configurations i.e
 one available on svn and one on the host machine and if they differ execute
 the command else exit ??

 Regards,

 --
 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: Does Node Inheritance work for people?

2011-08-11 Thread Bruce Richardson
On Mon, Aug 08, 2011 at 06:25:20AM -0700, Alessandro Franceschi wrote:
 NEVER include a class in the inheritance tree (well you can if you
 don't redefine variables used in that class but still is not
 necessary).
 In a nodes inheritance layout BEFORE you set the variables and THEN
 you include classes (in my case role classes).

This is precisely why Puppet's inheritance model is painful.  To be
safe, you have to include all classes at the specific node.  You can
hide some of this in role-based classes, but only so much.  It causes
duplication, noise in the config and is an unnecessary potential source
of error.  Yes, if you use an ENC, you can avoid some of this by, for
example, having a script that queries a database in which the
duplication has been removed by normalisation, or by using a language
with a sane inheritance model to describe your nodes.  That, though, is
only hiding the problem and still means much more noise than is
necessary in the communication between the ECN and Puppet (which is
still a potential source of error, as the same datum transmitted many
times is more likely to be corrupted/distorted in one of those
instances).

-- 
Bruce

I unfortunately do not know how to turn cheese into gold.


signature.asc
Description: Digital signature


Re: [Puppet Users] Custom manifest

2011-08-11 Thread Himanshu Raina
Hi Scott,

For that I would need to have a puppet file server installed. The idea
behind using puppet and svn is to keep track of revision history of changes
made to configuration files. Also, if my understanding is wrong could you
please guide me to do it using template as you have mentioned.

Regards,


On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith sc...@ohlol.net wrote:

 Why don't you generate httpd.conf from a template in Puppet and restart
 apache if deemed necessary?

 On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina dopedoxy...@gmail.comwrote:

 Hi,


 Can I execute a command basis on some criteria in puppet. For example, I
 would want to execute the following command

 svn up; /usr/local/apache/bin/apachectl restart

 only if revision number of file on host = revision number of file on svn

 i.e.

 /usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep
 Revision| cut -d: -f2| sed -e's/ //g' = /usr/bin/svn info
 http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf|
  grep Revision| cut -d: -f2| sed -e's/ //g'

 Is it possible or instead can I do a md5sum of both the configurations i.e
 one available on svn and one on the host machine and if they differ execute
 the command else exit ??

 Regards,

 --
 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] Custom manifest

2011-08-11 Thread Scott Smith
Puppet's file server is built in. You don't have to do anything extra beyond
creating the template and specifying it in your manifest.

If your Puppet manifests are under version control (they should be), your
Apache configuration is essentially versioned as well.

On Thu, Aug 11, 2011 at 2:12 AM, Himanshu Raina dopedoxy...@gmail.comwrote:

 Hi Scott,

 For that I would need to have a puppet file server installed. The idea
 behind using puppet and svn is to keep track of revision history of changes
 made to configuration files. Also, if my understanding is wrong could you
 please guide me to do it using template as you have mentioned.

 Regards,


 On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith sc...@ohlol.net wrote:

 Why don't you generate httpd.conf from a template in Puppet and restart
 apache if deemed necessary?

 On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina dopedoxy...@gmail.comwrote:

 Hi,


 Can I execute a command basis on some criteria in puppet. For example, I
 would want to execute the following command

 svn up; /usr/local/apache/bin/apachectl restart

 only if revision number of file on host = revision number of file on
 svn

 i.e.

 /usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep
 Revision| cut -d: -f2| sed -e's/ //g' = /usr/bin/svn info
 http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf|
  grep Revision| cut -d: -f2| sed -e's/ //g'

 Is it possible or instead can I do a md5sum of both the configurations
 i.e one available on svn and one on the host machine and if they differ
 execute the command else exit ??

 Regards,

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


-- 
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] Custom manifest

2011-08-11 Thread Scott Smith
Then you would be missing out on one of the best features of Puppet.

On Thu, Aug 11, 2011 at 2:39 AM, Himanshu Raina dopedoxy...@gmail.comwrote:

 What if I don't want to use the templates and instead would want to do it
 otherwise (as mentioned earlier).

 Regards,


 On Thu, Aug 11, 2011 at 2:52 PM, Scott Smith sc...@ohlol.net wrote:

 Puppet's file server is built in. You don't have to do anything extra
 beyond creating the template and specifying it in your manifest.

 If your Puppet manifests are under version control (they should be), your
 Apache configuration is essentially versioned as well.


 On Thu, Aug 11, 2011 at 2:12 AM, Himanshu Raina dopedoxy...@gmail.comwrote:

 Hi Scott,

 For that I would need to have a puppet file server installed. The idea
 behind using puppet and svn is to keep track of revision history of changes
 made to configuration files. Also, if my understanding is wrong could you
 please guide me to do it using template as you have mentioned.

 Regards,


 On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith sc...@ohlol.net wrote:

 Why don't you generate httpd.conf from a template in Puppet and restart
 apache if deemed necessary?

 On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina 
 dopedoxy...@gmail.comwrote:

 Hi,


 Can I execute a command basis on some criteria in puppet. For example,
 I would want to execute the following command

 svn up; /usr/local/apache/bin/apachectl restart

 only if revision number of file on host = revision number of file on
 svn

 i.e.

 /usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep
 Revision| cut -d: -f2| sed -e's/ //g' = /usr/bin/svn info
 http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf|
  grep Revision| cut -d: -f2| sed -e's/ //g'

 Is it possible or instead can I do a md5sum of both the configurations
 i.e one available on svn and one on the host machine and if they differ
 execute the command else exit ??

 Regards,

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


  --
 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] Custom manifest

2011-08-11 Thread Scott Smith
http://docs.puppetlabs.com/index.html explains it pretty well :)

On Thu, Aug 11, 2011 at 2:55 AM, Himanshu Raina dopedoxy...@gmail.comwrote:

 So, can you guide me on how can this be done using templates.

 Regards,

 On Thu, Aug 11, 2011 at 3:19 PM, Scott Smith sc...@ohlol.net wrote:

 Then you would be missing out on one of the best features of Puppet.


 On Thu, Aug 11, 2011 at 2:39 AM, Himanshu Raina dopedoxy...@gmail.comwrote:

 What if I don't want to use the templates and instead would want to do it
 otherwise (as mentioned earlier).

 Regards,


 On Thu, Aug 11, 2011 at 2:52 PM, Scott Smith sc...@ohlol.net wrote:

 Puppet's file server is built in. You don't have to do anything extra
 beyond creating the template and specifying it in your manifest.

 If your Puppet manifests are under version control (they should be),
 your Apache configuration is essentially versioned as well.


 On Thu, Aug 11, 2011 at 2:12 AM, Himanshu Raina 
 dopedoxy...@gmail.comwrote:

 Hi Scott,

 For that I would need to have a puppet file server installed. The idea
 behind using puppet and svn is to keep track of revision history of 
 changes
 made to configuration files. Also, if my understanding is wrong could you
 please guide me to do it using template as you have mentioned.

 Regards,


 On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith sc...@ohlol.net wrote:

 Why don't you generate httpd.conf from a template in Puppet and
 restart apache if deemed necessary?

 On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina 
 dopedoxy...@gmail.com wrote:

 Hi,


 Can I execute a command basis on some criteria in puppet. For
 example, I would want to execute the following command

 svn up; /usr/local/apache/bin/apachectl restart

 only if revision number of file on host = revision number of file on
 svn

 i.e.

 /usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf |
 grep Revision| cut -d: -f2| sed -e's/ //g' = /usr/bin/svn info
 http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf|
  grep Revision| cut -d: -f2| sed -e's/ //g'

 Is it possible or instead can I do a md5sum of both the
 configurations i.e one available on svn and one on the host machine and 
 if
 they differ execute the command else exit ??

 Regards,

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


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


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

[Puppet Users] parameterized class precedences

2011-08-11 Thread lluis
Hello,
I want to access variable of a parameterized class but it fails with
class has not been evaluated.
Tried to evaluate it first adding stages and requires, but still same.
I'll explain better with an example:

stage { pre: before = Stage[main] }

class directory($path) {
  file { $path:
ensure = directory,
  }
}

class directory::subdirectory {
  file {
$directory::path/other:
  ensure = directory,
  require = [File[$directory::path],Class[directory]];
  }
}

# if I include directory::subdirectory at the end, it works
# but classes come from an ENC, can't order since it's a hash

include directory::subdirectory

class { directory:
  path = /tmp/test,
  stage = pre
}


Applying this manifest produces:
warning: Scope(Class[Directory::Subdirectory]): Could not look up
qualified variable 'directory::path'; class directory has not been
evaluated at test.pp:16
warning: Scope(Class[Directory::Subdirectory]): Could not look up
qualified variable 'directory::path'; class directory has not been
evaluated at test.pp:14
Could not find dependency File[] for File[/other] at test.pp:17

any hint?

-- 
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] Custom manifest

2011-08-11 Thread Daniel Pittman
Scott is right, but if you really wanted to do it the hard way, two choices:

One, use an `exec` resource that just runs those commands on the
client.  Which pretty much sucks, FWIW, but not quite as much if you
use the `unless` and `notify` metaparameters for `exec`.

Two, you can use something like `generate` on the master to extract
the version from SVN, and send that to the client as part of the
catalog.

That said, the *usual* way to get the benefits of SVN with Puppet is
to put your manifests, templates, and files directly into SVN, then
make `/etc/puppet` or your module path a checkout from SVN.  Use a
post-commit hook to update *that*, and Puppet to distribute it.

Then you get the benefits of SVN, and of Puppet, and the bonus that
you don't need give all your machines access to the VCS repository
that contains all your configuration data.

Daniel

On Thu, Aug 11, 2011 at 09:49, Scott Smith sc...@ohlol.net wrote:
 Then you would be missing out on one of the best features of Puppet.

 On Thu, Aug 11, 2011 at 2:39 AM, Himanshu Raina dopedoxy...@gmail.com
 wrote:

 What if I don't want to use the templates and instead would want to do it
 otherwise (as mentioned earlier).
 Regards,

 On Thu, Aug 11, 2011 at 2:52 PM, Scott Smith sc...@ohlol.net wrote:

 Puppet's file server is built in. You don't have to do anything extra
 beyond creating the template and specifying it in your manifest.
 If your Puppet manifests are under version control (they should be), your
 Apache configuration is essentially versioned as well.

 On Thu, Aug 11, 2011 at 2:12 AM, Himanshu Raina dopedoxy...@gmail.com
 wrote:

 Hi Scott,
 For that I would need to have a puppet file server installed. The idea
 behind using puppet and svn is to keep track of revision history of changes
 made to configuration files. Also, if my understanding is wrong could you
 please guide me to do it using template as you have mentioned.
 Regards,

 On Thu, Aug 11, 2011 at 2:29 PM, Scott Smith sc...@ohlol.net wrote:

 Why don't you generate httpd.conf from a template in Puppet and restart
 apache if deemed necessary?

 On Thu, Aug 11, 2011 at 1:51 AM, Himanshu Raina dopedoxy...@gmail.com
 wrote:

 Hi,

 Can I execute a command basis on some criteria in puppet. For example,
 I would want to execute the following command
 svn up; /usr/local/apache/bin/apachectl restart
 only if revision number of file on host = revision number of file on
 svn
 i.e.
 /usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep
 Revision| cut -d: -f2| sed -e's/ //g' = /usr/bin/svn info
 http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf
 | grep Revision| cut -d: -f2| sed -e's/ //g'
 Is it possible or instead can I do a md5sum of both the configurations
 i.e one available on svn and one on the host machine and if they differ
 execute the command else exit ??
 Regards,

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

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

Re: [Puppet Users] Does Node Inheritance work for people?

2011-08-11 Thread Charles Johnson
We probably have the quintessential setup for using node inheritance.

We now have about 1000 nodes in a HPC cluster with CentOS 5.x. About 950
nodes are identical, and the naming scheme is simplistic (vmp). The
remaining nodes are gateways that users log into to launch jobs,
or infrastructure nodes (DNS, NTP, etc.).

We have a site.pp that imports modules, nodes and templates.

Templates defines

node default {
  include envvars
  include selinux
}

node prodnode {
  [include all production node modules]
}

node prodgateway {
  [include all production gateway modules]
}

And a sprinkling of other special nodes.

Nodes file defines the nodes like so:

node 'vmps04.vampire' inherits prodgateway {}
node 'vmp001.vampire' inherits prodnode {}

The modules file imports all the modules.

The modules themselves are fairly fine grained to avoid the class this::that
syntax. We started that way, but we have eliminated it.

This works well because of the relatively simple, and massively uniform
environment with which we work.

~Charles~

On Fri, Aug 5, 2011 at 8:33 AM, Nigel Kersten ni...@puppetlabs.com wrote:

 We have a bunch of problems people regularly run into with node
 inheritance, and it's something we'd like to find a better solution for.

 Is anyone using node inheritance and happy with how it works? If so, can
 you describe your setup briefly?

 --
 Nigel Kersten
 Product Manager, Puppet Labs

 *Join us for **PuppetConf *
 http://www.bit.ly/puppetconfsig
 Sept 22/23 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.


-- 
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: Why?

2011-08-11 Thread Randall Hansen
On Thu, Aug 11, 2011 at 12:40 AM, ki_chi_saga fan...@kth.se wrote:
 See the little arrows?
 No i didn't 

I think that this is more common than we suspect.  It's been on my
list for a while, now I have a ticket:
http://projects.puppetlabs.com/issues/8923

Maybe what we're doing now cannot be improved, but I'll keep thinking
about it.  Feedback welcome.

r

-- 
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: Does Node Inheritance work for people?

2011-08-11 Thread Alessandro Franceschi
To be honest I don't find painful at all to include at node level ONE
and only one (role) class.
I wonder where you find all this duplication. If your node names are
standardized (ie: web01 web02 web03.. ) you can even use wildcards for
all the nodes that share the same role.

I personally find more quick and handy to add a node via vi that
clicking around a web interface. And most of the times when I've to
add a node I just insert the node name and the role class that it
includes.
I've worked with this layout in different environments with various
different colleagues, more or less Puppet experts (some never used it
before) and nobody has ever made mistakes while managing nodes, and
once explained the override logic of variables in the inheritance tree
they were autonomous in managing customizations.
So somehow, for me, this is a hint, if not a proof, that this layout
is not so confusing or problematic.
Once again, I don't intend to convince anyone that this is the best or
the only possible one, but I'm ready to demonstrate any time that it
works and scales well and, once explained is easy to work with.

My2c
Al

On Aug 11, 11:02 am, Bruce Richardson itsbr...@workshy.org wrote:
 On Mon, Aug 08, 2011 at 06:25:20AM -0700, Alessandro Franceschi wrote:
  NEVER include a class in the inheritance tree (well you can if you
  don't redefine variables used in that class but still is not
  necessary).
  In a nodes inheritance layout BEFORE you set the variables and THEN
  you include classes (in my case role classes).

 This is precisely why Puppet's inheritance model is painful.  To be
 safe, you have to include all classes at the specific node.  You can
 hide some of this in role-based classes, but only so much.  It causes
 duplication, noise in the config and is an unnecessary potential source
 of error.  Yes, if you use an ENC, you can avoid some of this by, for
 example, having a script that queries a database in which the
 duplication has been removed by normalisation, or by using a language
 with a sane inheritance model to describe your nodes.  That, though, is
 only hiding the problem and still means much more noise than is
 necessary in the communication between the ECN and Puppet (which is
 still a potential source of error, as the same datum transmitted many
 times is more likely to be corrupted/distorted in one of those
 instances).

 --
 Bruce

 I unfortunately do not know how to turn cheese into gold.

  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.



[Puppet Users] cleaning puppet dashboard

2011-08-11 Thread Arnau Bria
Hi all,

I have a cron that follows
http://docs.puppetlabs.com/dashboard/manual/1.2/maintaining.html and
cleans our puppet dashboard:

[...]
rake RAILS_ENV=production reports:prune upto=1 unit=wk
rake RAILS_ENV=production db:raw:optimize
[...]

but I've found a table which is 22GB and I'm not able to clean its space:


22G -rw-rw 1 mysql mysql  22G Aug 11 17:15 resource_statuses.ibd

Our DB started to work on March, so I've removed all table entries
before July, but the table is still 22GB .

mysql delete from resource_statuses where time  2011-07-12%;
Query OK, 76040474 rows affected (1 hour 50 min 2.07 sec)

So, how may I get some free space from dashboard DB?

TIA,
Arnau

-- 
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] Is accessing vars from different class safe?

2011-08-11 Thread Stefan Schulte
On Sat, Aug 06, 2011 at 04:14:31PM +0200, Stefan Schulte wrote:
 Is it ALWAYS safe to access $::my_application::paramBalsoInterestingForBackup
 inside the backup::client class or can I run into ordering issues?

At least I can answer this question my self: It is not safe, you can end
up with

2 Modules with one class each

class mod1::class1($message) {
  $messag = $message
  notice $message 
}
class mod2::class2 {
  notice $mod1::class1::message
}

1 Manifest

class { 'mod2::class2': }
class { 'mod1::class1': message = 'Hallo Welt'}

Output

warning: Scope(Class[Mod2::Class2]): Could not look up qualified
variable 'mod1::class1::message'; class mod1::class1 has not been
evaluated at /tmp/modules/mod2/manifests/class2.pp:2
notice: Scope(Class[Mod2::Class2]): 
notice: Scope(Class[Mod1::Class1]): Hallo Welt
info: Applying configuration version '1313075940'
notice: Finished catalog run in 0.16 seconds


-Stefan


pgpr4tg2SOwXf.pgp
Description: PGP signature


Re: [Puppet Users] Is accessing vars from different class safe?

2011-08-11 Thread Aaron Grewell
It's fine, just make sure class2 requires class1.  That's what requires are
for.

On Thu, Aug 11, 2011 at 8:26 AM, Stefan Schulte 
stefan.schu...@taunusstein.net wrote:

 On Sat, Aug 06, 2011 at 04:14:31PM +0200, Stefan Schulte wrote:
  Is it ALWAYS safe to access
 $::my_application::paramBalsoInterestingForBackup
  inside the backup::client class or can I run into ordering issues?

 At least I can answer this question my self: It is not safe, you can end
 up with

 2 Modules with one class each

class mod1::class1($message) {
  $messag = $message
  notice $message
}
class mod2::class2 {
  notice $mod1::class1::message
}

 1 Manifest

class { 'mod2::class2': }
class { 'mod1::class1': message = 'Hallo Welt'}

 Output

 warning: Scope(Class[Mod2::Class2]): Could not look up qualified
 variable 'mod1::class1::message'; class mod1::class1 has not been
 evaluated at /tmp/modules/mod2/manifests/class2.pp:2
 notice: Scope(Class[Mod2::Class2]):
 notice: Scope(Class[Mod1::Class1]): Hallo Welt
 info: Applying configuration version '1313075940'
 notice: Finished catalog run in 0.16 seconds


 -Stefan


-- 
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: Strange Could not find dependency error

2011-08-11 Thread piavlo
 Hi Christian

Strangely then I had - in manifest like this

class nagios-client {
  include nagios::params, nagios::nrpe, nagios::plugins
}

but was not including nagios-client any where - the puppet master/
agent did not give any errors - or this is since nagios-client was
never compiled on the master and so was not send to the agent as
well ?

Also if you look at my original mail at first I had nagios and not
nagios::server - and had same problem
of Could not find dependency - does it mean that in this case I had
some nasty magic puppet dependency problem - and renaming  nagios to
nagios::server solved it - seems to me like some puppet bug, wdyt?

Thanks
Alex

On Aug 11, 10:42 am, Christian Kauhaus k...@gocept.com wrote:
 Am 10.08.2011 22:24, schrieb piavlo:

  Does anyone have clear logical explanation why nagios::client 
  nagios::server
  have no dep problems but nagios-client  nagios-server does?

 - is no legal character in identifier names. Unfortunately, the error
 messages are not very helpful in such a case.

 Regards

 Christian

 --
 Dipl.-Inf. Christian Kauhaus  k...@gocept.com systems administration
 gocept gmbh  co. kg forsterstra e 29 06112 halle (saale) 
 germanyhttp://gocept.comtel +49 345 1229889 11 fax +49 345 1229889 1
 Zope and Plone consulting and development

-- 
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: cleaning puppet dashboard

2011-08-11 Thread Luke Bigum
Hi Arnau,

This is not a Puppet Dashboard problem, it's a MySQL feature of
InnoDB. You're using per-table InnoDB data files. InnoDB data files
grow. They never, ever, ever shrink. So what you've got there is a
22GB sparse file that MySQL will fill up with more resource_statuses
rows. It won't use that space for any other table because you've for
per-table InnoDB data files configured on.

I *think* one solution is to convert the resource_statuses to MyISAM
then back to InnoDB again but I've never done it. Another way is to
dump the database out, blow away the InnoDB data files and import the
dump (see 
http://dev.mysql.com/doc/refman/5.5/en/innodb-data-log-reconfiguration.html).

Hope that helps,

-Luke

On Aug 11, 4:20 pm, Arnau Bria arnaub...@pic.es wrote:
 Hi all,

 I have a cron that 
 followshttp://docs.puppetlabs.com/dashboard/manual/1.2/maintaining.htmland
 cleans our puppet dashboard:

 [...]
 rake RAILS_ENV=production reports:prune upto=1 unit=wk
 rake RAILS_ENV=production db:raw:optimize
 [...]

 but I've found a table which is 22GB and I'm not able to clean its space:

 22G -rw-rw 1 mysql mysql  22G Aug 11 17:15 resource_statuses.ibd

 Our DB started to work on March, so I've removed all table entries
 before July, but the table is still 22GB .

 mysql delete from resource_statuses where time  2011-07-12%;
 Query OK, 76040474 rows affected (1 hour 50 min 2.07 sec)

 So, how may I get some free space from dashboard DB?

 TIA,
 Arnau

-- 
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] Is accessing vars from different class safe?

2011-08-11 Thread Stefan Schulte
On Thu, Aug 11, 2011 at 08:30:37AM -0700, Aaron Grewell wrote:
 It's fine, just make sure class2 requires class1.  That's what requires are
 for.
 

Unfortunately it still doesnt worked. Changed class2 to

class mod2::class2 {
  file { $mod1::class1::message:
ensure  = file,
require = Class['mod1::class1'],
  }
}

Manifest is still

class { 'mod2::class2': }
class { 'mod1::class1': message = 'Hallo Welt'}

What I get is

warning: Scope(Class[Mod2::Class2]): Could not look up qualified
variable 'mod1::class1::message'; class mod1::class1 has not been
evaluated at /tmp/modules/mod2/manifests/class2.pp:2

notice: Scope(Class[Mod1::Class1]): Hallo Welt

Parameter path failed: File paths must be fully qualified, not 'undef'
at /tmp/modules/mod2/manifests/class2.pp:5

If I change the order in the manifest it works.

-Stefan
 On Thu, Aug 11, 2011 at 8:26 AM, Stefan Schulte 
 stefan.schu...@taunusstein.net wrote:
 
  On Sat, Aug 06, 2011 at 04:14:31PM +0200, Stefan Schulte wrote:
   Is it ALWAYS safe to access
  $::my_application::paramBalsoInterestingForBackup
   inside the backup::client class or can I run into ordering issues?
 
  At least I can answer this question my self: It is not safe, you can end
  up with
 
  2 Modules with one class each
 
 class mod1::class1($message) {
   $messag = $message
   notice $message
 }
 class mod2::class2 {
   notice $mod1::class1::message
 }
 
  1 Manifest
 
 class { 'mod2::class2': }
 class { 'mod1::class1': message = 'Hallo Welt'}
 
  Output
 
  warning: Scope(Class[Mod2::Class2]): Could not look up qualified
  variable 'mod1::class1::message'; class mod1::class1 has not been
  evaluated at /tmp/modules/mod2/manifests/class2.pp:2
  notice: Scope(Class[Mod2::Class2]):
  notice: Scope(Class[Mod1::Class1]): Hallo Welt
  info: Applying configuration version '1313075940'
  notice: Finished catalog run in 0.16 seconds
 
 
  -Stefan
 
 
 -- 
 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.
 


pgpkmpazStcKQ.pgp
Description: PGP signature


[Puppet Users] Distributing a PHP file as template fails

2011-08-11 Thread Tom De Vylder
Hi all,

I'm trying to distribute a PHP file as a template. 
The problem I'm running into is that each variable in the PHP file is 
recognized as a Puppet or ERB variable.

Take this snippet for instance:

# cat include/init.php
?php
$dbhost = '%= app_dbhost %';
$dbname = '%= app_dbname %';
$dbuser = '%= app_dbuser %';
$dbpass = '%= app_dbpass %';
?

When running this in Puppet I get the following error:

info: Applying configuration version '1311757652'
err: /Stage[main]/app::Config/File[/var/www/app/include/init.php]: Could not 
evaluate: Cannot find file: Invalid path '$dbhost = 'localhost';
$dbname = 'app_db';
$dbuser = 'user1';
$dbpass = 'spoofed';' Could not retrieve file metadata for $dbhost = 
'localhost';
$dbname = 'app_db';
$dbuser = 'user1';
$dbpass = 'spoofed';: Cannot find file: Invalid path '$dbhost = 'localhost';
$dbname = 'app_db';
$dbuser = 'user1';
$dbpass = 'spoofed';' at /etc/puppet/modules/app/manifests/init.pp:64

As you can see the actual ERB parts are filled in nicely but it fails on PHP's 
variables.
I've tried escaping the variables and equation marks. I've also renamed the php 
file not to end with *.erb. To no avail. 

Is there a way to avoid this behavior?

Kind regards,
TomDV

-- 
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] Creating manifests automatically from an existing configuration?

2011-08-11 Thread Spiral Syzygy
Hello,

I'm new to puppet and I would like to use it to clone the
configuration of an existing base machine. Are there any tools that
would allow puppet to scan the existing machine's state and generate
manifests I can then use to manage this other machine?

I know I can make them by hand or use prepared manifests, I'm just
hoping there may be a little time saver I'm not aware of.

Thanks,
Mike

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this 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: Distributing a PHP file as template fails

2011-08-11 Thread Tom De Vylder
Forgot to mention some important details:

# cat /etc/debian_version 
6.0.2
# puppet --version # Take 1: Debian default
2.6.2
# puppet --version # take 2: Debian Backports
2.7.1


On 11 Aug 2011, at 10:42, Tom De Vylder wrote:

 Hi all,
 
 I'm trying to distribute a PHP file as a template. 
 The problem I'm running into is that each variable in the PHP file is 
 recognized as a Puppet or ERB variable.
 
 Take this snippet for instance:
 
 # cat include/init.php
 ?php
$dbhost = '%= app_dbhost %';
$dbname = '%= app_dbname %';
$dbuser = '%= app_dbuser %';
$dbpass = '%= app_dbpass %';
 ?
 
 When running this in Puppet I get the following error:
 
 info: Applying configuration version '1311757652'
 err: /Stage[main]/app::Config/File[/var/www/app/include/init.php]: Could not 
 evaluate: Cannot find file: Invalid path '$dbhost = 'localhost';
 $dbname = 'app_db';
 $dbuser = 'user1';
 $dbpass = 'spoofed';' Could not retrieve file metadata for $dbhost = 
 'localhost';
 $dbname = 'app_db';
 $dbuser = 'user1';
 $dbpass = 'spoofed';: Cannot find file: Invalid path '$dbhost = 'localhost';
 $dbname = 'app_db';
 $dbuser = 'user1';
 $dbpass = 'spoofed';' at /etc/puppet/modules/app/manifests/init.pp:64
 
 As you can see the actual ERB parts are filled in nicely but it fails on 
 PHP's variables.
 I've tried escaping the variables and equation marks. I've also renamed the 
 php file not to end with *.erb. To no avail. 
 
 Is there a way to avoid this behavior?
 
 Kind regards,
 TomDV
 

-- 
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] Custom manifest

2011-08-11 Thread Tom De Vylder
Hi,

You could use something like this:

exec { svn up:
command = svn up,
notify = Service[apache],
}

service { apache:
enable = true,
ensure = running,
}

Regards,
Tom

On 11 Aug 2011, at 10:51, Himanshu Raina wrote:

 Hi,
 
 
 Can I execute a command basis on some criteria in puppet. For example, I 
 would want to execute the following command
 
 svn up; /usr/local/apache/bin/apachectl restart
 
 only if revision number of file on host = revision number of file on svn
 
 i.e.
 
 /usr/bin/svn info /usr/local/apache/conf/Web_Config/httpd.conf | grep 
 Revision| cut -d: -f2| sed -e's/ //g' = /usr/bin/svn info 
 http://svn.myhost.com/svn/Configuration_Management/Backup/Web_Config/httpd.conf
  | grep Revision| cut -d: -f2| sed -e's/ //g'
 
 Is it possible or instead can I do a md5sum of both the configurations i.e 
 one available on svn and one on the host machine and if they differ execute 
 the command else exit ??
 
 Regards,
 
 -- 
 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] Is accessing vars from different class safe?

2011-08-11 Thread Aaron Grewell
I think you'll have to do it at the class level with the arrow operators
rather than at the resource level.  I haven't ever done that, but I think if
the manifest contains something like:

   class { 'mod2::class2': }
   class { 'mod1::class1': message = 'Hallo Welt'}
   mod1 - mod2

you may have better luck.

On Thu, Aug 11, 2011 at 8:54 AM, Stefan Schulte 
stefan.schu...@taunusstein.net wrote:

 On Thu, Aug 11, 2011 at 08:30:37AM -0700, Aaron Grewell wrote:
  It's fine, just make sure class2 requires class1.  That's what requires
 are
  for.
 

 Unfortunately it still doesnt worked. Changed class2 to

class mod2::class2 {
  file { $mod1::class1::message:
ensure  = file,
require = Class['mod1::class1'],
  }
}

 Manifest is still

class { 'mod2::class2': }
class { 'mod1::class1': message = 'Hallo Welt'}

 What I get is

 warning: Scope(Class[Mod2::Class2]): Could not look up qualified
 variable 'mod1::class1::message'; class mod1::class1 has not been
 evaluated at /tmp/modules/mod2/manifests/class2.pp:2

 notice: Scope(Class[Mod1::Class1]): Hallo Welt

 Parameter path failed: File paths must be fully qualified, not 'undef'
 at /tmp/modules/mod2/manifests/class2.pp:5

 If I change the order in the manifest it works.

 -Stefan
  On Thu, Aug 11, 2011 at 8:26 AM, Stefan Schulte 
  stefan.schu...@taunusstein.net wrote:
 
   On Sat, Aug 06, 2011 at 04:14:31PM +0200, Stefan Schulte wrote:
Is it ALWAYS safe to access
   $::my_application::paramBalsoInterestingForBackup
inside the backup::client class or can I run into ordering issues?
  
   At least I can answer this question my self: It is not safe, you can
 end
   up with
  
   2 Modules with one class each
  
  class mod1::class1($message) {
$messag = $message
notice $message
  }
  class mod2::class2 {
notice $mod1::class1::message
  }
  
   1 Manifest
  
  class { 'mod2::class2': }
  class { 'mod1::class1': message = 'Hallo Welt'}
  
   Output
  
   warning: Scope(Class[Mod2::Class2]): Could not look up qualified
   variable 'mod1::class1::message'; class mod1::class1 has not been
   evaluated at /tmp/modules/mod2/manifests/class2.pp:2
   notice: Scope(Class[Mod2::Class2]):
   notice: Scope(Class[Mod1::Class1]): Hallo Welt
   info: Applying configuration version '1313075940'
   notice: Finished catalog run in 0.16 seconds
  
  
   -Stefan
  
 
  --
  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] Creating manifests automatically from an existing configuration?

2011-08-11 Thread Daniel Pittman
On Thu, Aug 11, 2011 at 16:05, Spiral Syzygy spiralena...@gmail.com wrote:

 I'm new to puppet and I would like to use it to clone the
 configuration of an existing base machine. Are there any tools that
 would allow puppet to scan the existing machine's state and generate
 manifests I can then use to manage this other machine?

`puppet resource` can generate the raw material.  It doesn't produce
dependencies, and you would need to make sensible decisions about
structuring file resources, but it can sure be a help.

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] Creating manifests automatically from an existing configuration?

2011-08-11 Thread Eric Shamow
 This could also be a place for the use of exported resources. End result is 
similar to puppet resource but can change dynamically, which is nice.  

--  
Join us for PuppetConf (http://www.bit.ly/puppetconfsig), September 22nd and 
23rd in Portland, OR.

Eric Shamow
Professional Services
http://puppetlabs.com/
(c)631.871.6441

On Thursday, August 11, 2011 at 9:27 AM, Daniel Pittman wrote:

 On Thu, Aug 11, 2011 at 16:05, Spiral Syzygy spiralena...@gmail.com 
 (mailto:spiralena...@gmail.com) wrote:
  
  I'm new to puppet and I would like to use it to clone the
  configuration of an existing base machine. Are there any tools that
  would allow puppet to scan the existing machine's state and generate
  manifests I can then use to manage this other machine?
  
 `puppet resource` can generate the raw material. It doesn't produce
 dependencies, and you would need to make sensible decisions about
 structuring file resources, but it can sure be a help.
  
 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 
 (mailto:puppet-users@googlegroups.com).
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com 
 (mailto:puppet-users+unsubscr...@googlegroups.com).
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.


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



Re: [Puppet Users] Is accessing vars from different class safe?

2011-08-11 Thread Stefan Schulte
On Thu, Aug 11, 2011 at 09:23:51AM -0700, Aaron Grewell wrote:
 I think you'll have to do it at the class level with the arrow operators
 rather than at the resource level.  I haven't ever done that, but I think if
 the manifest contains something like:
 
class { 'mod2::class2': }
class { 'mod1::class1': message = 'Hallo Welt'}
mod1 - mod2
 
 you may have better luck.

Nope. Neither does

class { 'mod2::class2': require = Class['mod1::class1']}
class { 'mod1::class1': message = 'Hallo Welt'}

nor does


  class { 'mod2::class2': require = Class['mod2::class2']}
  class { 'mod1::class1': message = 'Hallo Welt'}

  Class['mod1::class1'] - Class['mod2::class2']

work.

So you basically run into the same issues as when you use the defined
function to check for other classes inside a class: It all depends on
the parsing order. At least I get a warning if the order in my manifest
is wrong:

warning: Scope(Class[Mod2::Class2]): Could not look up qualified
variable 'mod1::class1::message'; class mod1::class1 has not been
evaluated at /tmp/modules/mod2/manifests/class2.pp:2

but unfortunately puppet does not fail hard here but just applies a
catalog with some empty variables which in my opinion is just wrong.

-Stefan


pgp4mciTMLpfS.pgp
Description: PGP signature


Re: [Puppet Users] need urgent help with including Ruby DSL class from puppet manifests

2011-08-11 Thread Stefan Schulte
On Thu, Aug 11, 2011 at 09:06:37AM -0700, piavlo wrote:
 Hi,
 
 I have a Ruby class in nagios module - it's located in nagios/
 manifests/ssa_nagios_checks.rb
 and looks like this
 
 hostclass :ssa_nagios_checks do
 ...
 end
 
 In nagios/manifests/init.pp I have
 
 class nagios::server {
 ...
include ssa_nagios_checks
 ...
 }
 

I may be wrong here but I guess you cannot mix manifests written in ruby
DSL with classes written in pure puppet DSL.

-Stefan


pgpinGDKMcY7f.pgp
Description: PGP signature


Re: [Puppet Users] need urgent help with including Ruby DSL class from puppet manifests

2011-08-11 Thread Ken Barber
If you look at this example:

 I have a Ruby class in nagios module - it's located in nagios/
 manifests/ssa_nagios_checks.rb
 and looks like this

 hostclass :ssa_nagios_checks do
 ...
 end

 In nagios/manifests/init.pp I have

 class nagios::server {
 ...
    include ssa_nagios_checks
 ...
 }

The autoloader/module layout recommendations/rules haven't been followed.

You actually want something more like:

nagios/manifests/server.pp:

  class nagios::server {
include nagios::ssa_nagios_checks
  }

nagios/manifests/ssa_nagios_checks.rb:

  hostclass :'nagios::ssa_nagios_checks' do
notice([should work])
  end

This should work. Can you test it?

Remember that sub-classes belong in their own file ... and only the
class with the same name as the module belongs in init.pp. Also - you
have to fully qualify class names when declaring them in their rb/pp
file.

ken.

-- 
Join us for PuppetConf, September 22nd and 23rd in Portland, OR:
http://bit.ly/puppetconfsig;

-- 
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] Parse Puppet Manifests

2011-08-11 Thread Andrew Thompson
I am looking for a method to parse the entire set of puppet manifests/
modules.  For example I want to see a list of all packages that I am
managing with puppet.  I have seen the compile option, but this only
gives me a particular node's point of view.  While I could just scrape
all of the manifest files for this information with grep, etc., there
must be something in the puppet code base I could plug into??

-Andrew

-- 
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: need urgent help with including Ruby DSL class from puppet manifests

2011-08-11 Thread piavlo
Hi Ken,

Thank you so much for your reply
I did like you said BUT i was still getting the error

err: Must pass a parameter or all necessary values at /etc/puppet/
modules/nagios/manifests/server.pp:19 on node mon1a.internal

Then I started to insert notice statement in the ruby DSL class - it
turns out I a logical erro in the code.
Arghhh - I have been so fooled by the totally misguiding error
message.
Shouldn't puppet err indicate that there is problem in /etc/puppet/
modules/nagios/manifests/ssa_nagios_checks.rb and not in /etc/puppet/
modules/nagios/manifests/server.pp?

Anyway now that the ruby error is fixed I get new error
err: undefined method `Puppet' for #Puppet::DSL::ResourceAPI:
0xb73f50e0 at /etc/puppet/modules/nagios/manifests/server.pp:15 on
node mon1a.internal

What does this error means?

Here is the real ruby dsl class code - in case it's again a problem
with the class :)


require 'json'
require 'open-uri'

hostclass :'nagios::ssa_nagios_checks' do

  nagios_confdir = scope.lookupvar('nagios::params::nrpe_confdir')

  url = http://localhost:5984/nagios_alerts/_all_docs?
include_docs=true
  result = JSON.parse(open(URI.parse(url)).read)

  result['rows'].each do |x|

type = x['doc']['type']
args = x['doc']['args']
warning_threshold = x['doc']['warning_threshold']
critical_threshold = x['doc']['critical_threshold']

contacts = x['doc']['contacts']
contact_groups = x['doc']['contact_groups']
notification_period = x['doc']['notifications_period']

case type
when mysql
  mysql_user = 'nagios'
  mysql_password = ''
  check_command = check_mysql_health_sql_tresholds!#{mysql_user}!
#{mysql_password}!'#{args}'!#{warning_threshold}!
#{critical_threshold}
when api
  check_command = blah-blah
else
  raise Puppet:Error, Unsupported ssa nagios check type $type
end

nagios_service( ssa_#{x['doc']['_id']},
  :target  = ${nagios_confdir}/app_alerts/ssa/
services/${name}.cfg,
  :host_name   = x['doc']['hosts'],
  :service_description = x['doc']['desc'],
  :use = 'generic-service',
  :check_command   = check_command,
  :require = File[#{nagios_confdir}/app_alerts/ssa/
services] )

  end

end


Thanks
Alex

On Aug 11, 9:13 pm, Ken Barber k...@puppetlabs.com wrote:
 If you look at this example:

  I have a Ruby class in nagios module - it's located in nagios/
  manifests/ssa_nagios_checks.rb
  and looks like this

  hostclass :ssa_nagios_checks do
  ...
  end

  In nagios/manifests/init.pp I have

  class nagios::server {
  ...
     include ssa_nagios_checks
  ...
  }

 The autoloader/module layout recommendations/rules haven't been followed.

 You actually want something more like:

 nagios/manifests/server.pp:

   class nagios::server {
     include nagios::ssa_nagios_checks
   }

 nagios/manifests/ssa_nagios_checks.rb:

   hostclass :'nagios::ssa_nagios_checks' do
     notice([should work])
   end

 This should work. Can you test it?

 Remember that sub-classes belong in their own file ... and only the
 class with the same name as the module belongs in init.pp. Also - you
 have to fully qualify class names when declaring them in their rb/pp
 file.

 ken.

 --
 Join us for PuppetConf, September 22nd and 23rd in Portland, 
 OR:http://bit.ly/puppetconfsig;

-- 
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] Passing hash as parameters to manifest

2011-08-11 Thread treydock
I have a module for backuppc, and am trying to pass a hash to a define
to create a single script and the necessary directories.  What I can't
seem to figure out how to do is have this hash's values be used to
create files / directories and also populate a template.

Here's the hash...


$backuppc_db_dumps =  {
redmine = {
'backup_dir'= '/var/www/rails/redmine',
'databases' = 'redmine',
'dump_dir'  = '/backups/misc-sqldumps',
},
general = {
'backup_dir'= '/etc',
'databases' = 'mysql',
'dump_dir'  = '/backups/misc-sqldumps',
},
}


I have successfully used that to with a template to generate a script,
but am unsure how to pass those values to a define in order to ensure
the dump_dir exists.

After the above variable I added

backuppc::sqldump { $backuppc_db_dumps: }

Here's the define ...

define backuppc::sqldump () {

file {
$name[dump_dir]:
ensure  = directory,
owner   = 'root',
group   = 'root',
mode= '0770',
}
}

Is this something that's even possible?  The error I get doesn't make
any sense to me...

err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Invalid tag generaldump_dir/backups/misc-
sqldumpsdatabasesmysqlbackup_dir/etcredminedump_dir/backups/redmine-
sqldumpsdatabasesredminebackup_dir/var/www/rails/redmine at /etc/
puppet/modules/backuppc/manifests/definitions/sqldump.pp:9 on node

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] Re: need urgent help with including Ruby DSL class from puppet manifests

2011-08-11 Thread Ken Barber
Is it this line?

raise Puppet:Error, Unsupported ssa nagios check type $type

Should be double colon ... Puppet::Error.

Looking at your code, I can't help but think a function is a better
fit then Ruby DSL.

ken.

On Thu, Aug 11, 2011 at 9:34 PM, piavlo lolitus...@gmail.com wrote:
 Hi Ken,

 Thank you so much for your reply
 I did like you said BUT i was still getting the error

 err: Must pass a parameter or all necessary values at /etc/puppet/
 modules/nagios/manifests/server.pp:19 on node mon1a.internal

 Then I started to insert notice statement in the ruby DSL class - it
 turns out I a logical erro in the code.
 Arghhh - I have been so fooled by the totally misguiding error
 message.
 Shouldn't puppet err indicate that there is problem in /etc/puppet/
 modules/nagios/manifests/ssa_nagios_checks.rb and not in /etc/puppet/
 modules/nagios/manifests/server.pp?

 Anyway now that the ruby error is fixed I get new error
 err: undefined method `Puppet' for #Puppet::DSL::ResourceAPI:
 0xb73f50e0 at /etc/puppet/modules/nagios/manifests/server.pp:15 on
 node mon1a.internal

 What does this error means?

 Here is the real ruby dsl class code - in case it's again a problem
 with the class :)

 
 require 'json'
 require 'open-uri'

 hostclass :'nagios::ssa_nagios_checks' do

  nagios_confdir = scope.lookupvar('nagios::params::nrpe_confdir')

  url = http://localhost:5984/nagios_alerts/_all_docs?
 include_docs=true
  result = JSON.parse(open(URI.parse(url)).read)

  result['rows'].each do |x|

    type = x['doc']['type']
    args = x['doc']['args']
    warning_threshold = x['doc']['warning_threshold']
    critical_threshold = x['doc']['critical_threshold']

    contacts = x['doc']['contacts']
    contact_groups = x['doc']['contact_groups']
    notification_period = x['doc']['notifications_period']

    case type
    when mysql
      mysql_user = 'nagios'
      mysql_password = ''
      check_command = check_mysql_health_sql_tresholds!#{mysql_user}!
 #{mysql_password}!'#{args}'!#{warning_threshold}!
 #{critical_threshold}
    when api
      check_command = blah-blah
    else
      raise Puppet:Error, Unsupported ssa nagios check type $type
    end

    nagios_service( ssa_#{x['doc']['_id']},
      :target              = ${nagios_confdir}/app_alerts/ssa/
 services/${name}.cfg,
      :host_name           = x['doc']['hosts'],
      :service_description = x['doc']['desc'],
      :use                 = 'generic-service',
      :check_command       = check_command,
      :require             = File[#{nagios_confdir}/app_alerts/ssa/
 services] )

  end

 end
 

 Thanks
 Alex

 On Aug 11, 9:13 pm, Ken Barber k...@puppetlabs.com wrote:
 If you look at this example:

  I have a Ruby class in nagios module - it's located in nagios/
  manifests/ssa_nagios_checks.rb
  and looks like this

  hostclass :ssa_nagios_checks do
  ...
  end

  In nagios/manifests/init.pp I have

  class nagios::server {
  ...
     include ssa_nagios_checks
  ...
  }

 The autoloader/module layout recommendations/rules haven't been followed.

 You actually want something more like:

 nagios/manifests/server.pp:

   class nagios::server {
     include nagios::ssa_nagios_checks
   }

 nagios/manifests/ssa_nagios_checks.rb:

   hostclass :'nagios::ssa_nagios_checks' do
     notice([should work])
   end

 This should work. Can you test it?

 Remember that sub-classes belong in their own file ... and only the
 class with the same name as the module belongs in init.pp. Also - you
 have to fully qualify class names when declaring them in their rb/pp
 file.

 ken.

 --
 Join us for PuppetConf, September 22nd and 23rd in Portland, 
 OR:http://bit.ly/puppetconfsig;

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





-- 
Join us for PuppetConf, September 22nd and 23rd in Portland, OR:
http://bit.ly/puppetconfsig;

-- 
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: Is accessing vars from different class safe?

2011-08-11 Thread jcbollinger


On Aug 11, 10:54 am, Stefan Schulte stefan.schu...@taunusstein.net
wrote:
 On Thu, Aug 11, 2011 at 08:30:37AM -0700, Aaron Grewell wrote:
  It's fine, just make sure class2 requires class1.  That's what requires are
  for.

 Unfortunately it still doesnt worked. Changed class2 to

     class mod2::class2 {
       file { $mod1::class1::message:
         ensure  = file,
         require = Class['mod1::class1'],
       }
     }

 Manifest is still

     class { 'mod2::class2': }
     class { 'mod1::class1': message = 'Hallo Welt'}

 What I get is

 warning: Scope(Class[Mod2::Class2]): Could not look up qualified
 variable 'mod1::class1::message'; class mod1::class1 has not been
 evaluated at /tmp/modules/mod2/manifests/class2.pp:2


I must say I'm not surprised that one didn't work.  Indeed, I would
have been surprised if it had.  The require is inside a scope defined
by the variable in question, and that scope can't be defined in the
first place.

I think I know what's going on.  Basically, 'require' and its friends
are the the wrong tool for the job: they establish order relationships
for determining the order in which resources are *applied* by the
agent, but they not necessarily the order in which resources are
evaluated during catalog compilation by the master.

Were class1 not parameterized, I would recommend that class2 simply
'include' it, and I am confident that would make it all good.  But you
cannot do that with a parameterized class (as far as I am aware), so I
think that leaves you up a creek.


John
Parameterized Classes -- Finding new ways to break your manifests
since 2010!

-- 
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: Creating manifests automatically from an existing configuration?

2011-08-11 Thread jcbollinger


On Aug 11, 11:52 am, Eric Shamow e...@puppetlabs.com wrote:
  This could also be a place for the use of exported resources. End result is 
 similar to puppet resource but can change dynamically, which is nice.  

If the OP already had Puppet manifests for the machine he wanted to
clone, then he would not need to go through this exercise in the first
place.  He could more or less just assign all the same classes to the
new node that are assigned to the existing one.  That would be a lot
easier than exporting all of one node's resources and collecting them
on the other, or using 'puppet resource' to analyze the original
machine.

I interpreted the OP's use of configuration differently: I think he
means what we more typically might describe as state (indeed, he
later uses that term himself).  He's looking for tools with which to
create Puppet manifests describing the existing machine, which he will
then apply to the new one.  Exported resources are clearly no help
there, because there are no existing resource declaration to export.


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] Vanishing facts

2011-08-11 Thread John T. Guthrie
Hello all,

I am running puppet 2.7.1 with mongrel and an apache proxy.  I have been
seeing an issue where it appears that the puppetmaster is completely
ignoring any facts that are sent to it.

When a client connects, any configuration that relies on facts shows
those variables as being empty strings.  (I have been testing this with
a simple notify resource that prints out the IP address and the FQDN.
Both of these are coming up as empty strings.)  If I check the list of
facts for a node through the REST API, it comes up as an empty list.
Moreover, /var/lib/puppet/facts is persistently empty.  This has been
happening with every client that I have checked.

If run a packet capture on the puppetmaster paying attention to the
puppetmaster ports, then I definitely see the puppetmaster receive the
facts in b64_zlib_yaml format.  I can even decode the facts string and
get the correct set of facts.  So the puppetmaster is definitely
receiving the facts.  However, in the same packet capture, I see the
puppetmaster return json for resources as if it had not received any
facts at all.

I have even gone so far as to blow away my entire /var/lib/puppet
directory (except for the ssl), and try starting fresh to no avail.

Does anyone have any suggestions for how I can fix this?  I am attaching
my puppet.conf in case that will help.  Thanks in advance for any advice
that anyone has.

Thank you very much.

John Guthrie
jguth...@book.com


This electronic mail message contains information that (a) is or 
may be CONFIDENTIAL, PROPRIETARY IN NATURE, OR OTHERWISE 
PROTECTED 
BY LAW FROM DISCLOSURE, and (b) is intended only for the use of 
the addressee(s) named herein.  If you are not an intended 
recipient, please contact the sender immediately and take the 
steps necessary to delete the message completely from your 
computer system.

Not Intended as a Substitute for a Writing: Notwithstanding the 
Uniform Electronic Transaction Act or any other law of similar 
effect, absent an express statement to the contrary, this e-mail 
message, its contents, and any attachments hereto are not 
intended 
to represent an offer or acceptance to enter into a contract and 
are not otherwise intended to bind this sender, 
barnesandnoble.com 
llc, barnesandnoble.com inc. or any other person or entity.

-- 
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 template
# Serial 2011071200

[main]
# The Puppet log directory.
# The default value is '$vardir/log'.
logdir = /var/log/puppet

# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet

# Where SSL certificates are kept.
# The default value is '$confdir/ssl'.
ssldir = $vardir/ssl

external_nodes = /usr/local/bin/puppet_get_host_config
node_terminus = exec

[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

server = mongrel01

certificate_revocation = false

pluginsync = false

[master]
#storeconfigs = true
#thin_storeconfigs = true

dbadapter = mysql
dbuser = puppet
dbpassword = 
dbserver = puppetdb01
#dbsocket = /var/run/mysqld/mysqld.sock


external_nodes = /usr/local/bin/puppet_get_host_config
node_terminus = exec

manifest = /etc/puppet/manifests/site.pp
modulepath = /etc/puppet/modules

facts_terminus = yaml


Re: [Puppet Users] Re: Creating manifests automatically from an existing configuration?

2011-08-11 Thread Spiral Syzygy
Thank you John, I think you hit the nail on the head. I just started
this gig and the sysadmin before me started the process of setting up
our machines to be managed by puppet. We have a project to add a
redundant server and he started this project with puppet in mind, but
the manifests are not all done. He left in a bit of a hurry and I'm
left to clean up and fill in the gaps where I can. As server1 is sound
in it's current state, I was hoping I could use puppet to inspect that
machines state and generate manifests that would make it simple to
clone the machines state to another machine.

It's ok, I believe I have the manifests good enough for a dry run.
Anything missed now will be caught later when we start running full
regression tests on the fail-over server. I'm starting to gather up
the ammo needed to convince the boss to let me start moving most of
our services into the cloud. From here on out, any new machines will
be managed with puppet. It's quite a nice tool now that I'm starting
to get the hang of it.

Cheers!
Mike





On Thu, Aug 11, 2011 at 2:45 PM, jcbollinger john.bollin...@stjude.org wrote:


 On Aug 11, 11:52 am, Eric Shamow e...@puppetlabs.com wrote:
  This could also be a place for the use of exported resources. End result is 
 similar to puppet resource but can change dynamically, which is nice.

 If the OP already had Puppet manifests for the machine he wanted to
 clone, then he would not need to go through this exercise in the first
 place.  He could more or less just assign all the same classes to the
 new node that are assigned to the existing one.  That would be a lot
 easier than exporting all of one node's resources and collecting them
 on the other, or using 'puppet resource' to analyze the original
 machine.

 I interpreted the OP's use of configuration differently: I think he
 means what we more typically might describe as state (indeed, he
 later uses that term himself).  He's looking for tools with which to
 create Puppet manifests describing the existing machine, which he will
 then apply to the new one.  Exported resources are clearly no help
 there, because there are no existing resource declaration to export.


 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] Re: Is accessing vars from different class safe?

2011-08-11 Thread Aaron Grewell
Thanks John ,  I wasn't aware of that distinction.  I suspect you've saved
me a forehead=wall session on down the road. :-)
On Aug 11, 2011 2:31 PM, jcbollinger john.bollin...@stjude.org wrote:


 On Aug 11, 10:54 am, Stefan Schulte stefan.schu...@taunusstein.net
 wrote:
 On Thu, Aug 11, 2011 at 08:30:37AM -0700, Aaron Grewell wrote:
  It's fine, just make sure class2 requires class1.  That's what requires
are
  for.

 Unfortunately it still doesnt worked. Changed class2 to

 class mod2::class2 {
   file { $mod1::class1::message:
 ensure  = file,
 require = Class['mod1::class1'],
   }
 }

 Manifest is still

 class { 'mod2::class2': }
 class { 'mod1::class1': message = 'Hallo Welt'}

 What I get is

 warning: Scope(Class[Mod2::Class2]): Could not look up qualified
 variable 'mod1::class1::message'; class mod1::class1 has not been
 evaluated at /tmp/modules/mod2/manifests/class2.pp:2


 I must say I'm not surprised that one didn't work. Indeed, I would
 have been surprised if it had. The require is inside a scope defined
 by the variable in question, and that scope can't be defined in the
 first place.

 I think I know what's going on. Basically, 'require' and its friends
 are the the wrong tool for the job: they establish order relationships
 for determining the order in which resources are *applied* by the
 agent, but they not necessarily the order in which resources are
 evaluated during catalog compilation by the master.

 Were class1 not parameterized, I would recommend that class2 simply
 'include' it, and I am confident that would make it all good. But you
 cannot do that with a parameterized class (as far as I am aware), so I
 think that leaves you up a creek.


 John
 Parameterized Classes -- Finding new ways to break your manifests
 since 2010!

 --
 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: Creating manifests automatically from an existing configuration?

2011-08-11 Thread Eric Shamow
John,

I suspect you're right. User requirements FTW.

-Eric

-- 
Join us for PuppetConf (http://www.bit.ly/puppetconfsig), September 22nd and 
23rd in Portland, OR.

Eric Shamow
Professional Services
http://puppetlabs.com/
(c)631.871.6441

On Thursday, August 11, 2011 at 2:45 PM, jcbollinger wrote:

 
 
 On Aug 11, 11:52 am, Eric Shamow e...@puppetlabs.com 
 (http://puppetlabs.com) wrote:
  This could also be a place for the use of exported resources. End result is 
  similar to puppet resource but can change dynamically, which is nice. 
 
 If the OP already had Puppet manifests for the machine he wanted to
 clone, then he would not need to go through this exercise in the first
 place. He could more or less just assign all the same classes to the
 new node that are assigned to the existing one. That would be a lot
 easier than exporting all of one node's resources and collecting them
 on the other, or using 'puppet resource' to analyze the original
 machine.
 
 I interpreted the OP's use of configuration differently: I think he
 means what we more typically might describe as state (indeed, he
 later uses that term himself). He's looking for tools with which to
 create Puppet manifests describing the existing machine, which he will
 then apply to the new one. Exported resources are clearly no help
 there, because there are no existing resource declaration to export.
 
 
 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 
 (mailto:puppet-users@googlegroups.com).
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com 
 (mailto:puppet-users+unsubscr...@googlegroups.com).
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.


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



Re: [Puppet Users] Re: Creating manifests automatically from an existing configuration?

2011-08-11 Thread Spiral Syzygy
Thanks for your input folks. I have successfully run the manifests we
have with out trouble. I'm looking forward to simplifying my job with
this great tool, along with a few other side projects. Puppet is the
first CMS I've laid hands on and so far, I'm stoked. :)

On Thu, Aug 11, 2011 at 3:23 PM, Eric Shamow e...@puppetlabs.com wrote:
 John,

 I suspect you're right. User requirements FTW.

 -Eric

 --
 Join us for PuppetConf (http://www.bit.ly/puppetconfsig), September 22nd and 
 23rd in Portland, OR.

 Eric Shamow
 Professional Services
 http://puppetlabs.com/
 (c)631.871.6441

 On Thursday, August 11, 2011 at 2:45 PM, jcbollinger wrote:



 On Aug 11, 11:52 am, Eric Shamow e...@puppetlabs.com 
 (http://puppetlabs.com) wrote:
  This could also be a place for the use of exported resources. End result 
  is similar to puppet resource but can change dynamically, which is nice.

 If the OP already had Puppet manifests for the machine he wanted to
 clone, then he would not need to go through this exercise in the first
 place. He could more or less just assign all the same classes to the
 new node that are assigned to the existing one. That would be a lot
 easier than exporting all of one node's resources and collecting them
 on the other, or using 'puppet resource' to analyze the original
 machine.

 I interpreted the OP's use of configuration differently: I think he
 means what we more typically might describe as state (indeed, he
 later uses that term himself). He's looking for tools with which to
 create Puppet manifests describing the existing machine, which he will
 then apply to the new one. Exported resources are clearly no help
 there, because there are no existing resource declaration to export.


 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 
 (mailto:puppet-users@googlegroups.com).
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com 
 (mailto:puppet-users+unsubscr...@googlegroups.com).
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.


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



-- 
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] Vanishing facts

2011-08-11 Thread Nan Liu
On Thu, Aug 11, 2011 at 4:59 PM, John T. Guthrie jguth...@book.com wrote:
 Hello all,

 I am running puppet 2.7.1 with mongrel and an apache proxy.  I have been
 seeing an issue where it appears that the puppetmaster is completely
 ignoring any facts that are sent to it.

 When a client connects, any configuration that relies on facts shows
 those variables as being empty strings.  (I have been testing this with
 a simple notify resource that prints out the IP address and the FQDN.
 Both of these are coming up as empty strings.)  If I check the list of
 facts for a node through the REST API, it comes up as an empty list.
 Moreover, /var/lib/puppet/facts is persistently empty.  This has been
 happening with every client that I have checked.

Can you show your puppet manifests? Are you using $::ipaddress $::fqdn?

 If run a packet capture on the puppetmaster paying attention to the
 puppetmaster ports, then I definitely see the puppetmaster receive the
 facts in b64_zlib_yaml format.  I can even decode the facts string and
 get the correct set of facts.  So the puppetmaster is definitely
 receiving the facts.  However, in the same packet capture, I see the
 puppetmaster return json for resources as if it had not received any
 facts at all.

 I have even gone so far as to blow away my entire /var/lib/puppet
 directory (except for the ssl), and try starting fresh to no avail.

 Does anyone have any suggestions for how I can fix this?  I am attaching
 my puppet.conf in case that will help.  Thanks in advance for any advice
 that anyone has.

Use this tip and see what puppet facts you are getting back on master:

http://www.puppetcookbook.com/posts/see-all-client-variables.html

The facts you get from the client should also reside in
$vardir/yaml/facts, and you can examine them to see what you have.

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] Vanishing facts

2011-08-11 Thread Ken Barber
Is your config facts_terminus=yaml for a reason? Usually its 'facter'.

ken.

On Thu, Aug 11, 2011 at 10:59 PM, John T. Guthrie jguth...@book.com wrote:
 Hello all,

 I am running puppet 2.7.1 with mongrel and an apache proxy.  I have been
 seeing an issue where it appears that the puppetmaster is completely
 ignoring any facts that are sent to it.

 When a client connects, any configuration that relies on facts shows
 those variables as being empty strings.  (I have been testing this with
 a simple notify resource that prints out the IP address and the FQDN.
 Both of these are coming up as empty strings.)  If I check the list of
 facts for a node through the REST API, it comes up as an empty list.
 Moreover, /var/lib/puppet/facts is persistently empty.  This has been
 happening with every client that I have checked.

 If run a packet capture on the puppetmaster paying attention to the
 puppetmaster ports, then I definitely see the puppetmaster receive the
 facts in b64_zlib_yaml format.  I can even decode the facts string and
 get the correct set of facts.  So the puppetmaster is definitely
 receiving the facts.  However, in the same packet capture, I see the
 puppetmaster return json for resources as if it had not received any
 facts at all.

 I have even gone so far as to blow away my entire /var/lib/puppet
 directory (except for the ssl), and try starting fresh to no avail.

 Does anyone have any suggestions for how I can fix this?  I am attaching
 my puppet.conf in case that will help.  Thanks in advance for any advice
 that anyone has.

 Thank you very much.

 John Guthrie
 jguth...@book.com


 This electronic mail message contains information that (a) is or
 may be CONFIDENTIAL, PROPRIETARY IN NATURE, OR OTHERWISE
 PROTECTED
 BY LAW FROM DISCLOSURE, and (b) is intended only for the use of
 the addressee(s) named herein.  If you are not an intended
 recipient, please contact the sender immediately and take the
 steps necessary to delete the message completely from your
 computer system.

 Not Intended as a Substitute for a Writing: Notwithstanding the
 Uniform Electronic Transaction Act or any other law of similar
 effect, absent an express statement to the contrary, this e-mail
 message, its contents, and any attachments hereto are not
 intended
 to represent an offer or acceptance to enter into a contract and
 are not otherwise intended to bind this sender,
 barnesandnoble.com
 llc, barnesandnoble.com inc. or any other person or entity.

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





-- 
Join us for PuppetConf, September 22nd and 23rd in Portland, OR:
http://bit.ly/puppetconfsig;

-- 
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] Distributing a PHP file as template fails

2011-08-11 Thread vagn scott

On 08/11/2011 04:42 AM, Tom De Vylder wrote:

# cat include/init.php
?php
 $dbhost = '%= app_dbhost %';
 $dbname = '%= app_dbname %';
 $dbuser = '%= app_dbuser %';
 $dbpass = '%= app_dbpass %';
?
   


Surely you mean (note the dash (-) ):

?php
$dbhost = '%= app_dbhost -%';
$dbname = '%= app_dbname -%';
$dbuser = '%= app_dbuser -%';
$dbpass = '%= app_dbpass -%';
?

--
vagn

--
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] Parse Puppet Manifests

2011-08-11 Thread Henrik Lindberg
Don't know exactly what you are looking for, but you may be interested 
in http://cloudsmith.github.com/geppetto/ which is tooling for puppet 
development - editor with syntax coloring, cross-reference checking, 
module-dependency checking, etc.


As Geppetto contains its own parser that creates a model of puppet (and 
modules) it is possible to answer all sorts of questions about a 
configuration. Maybe some of what you are looking for is already there, 
or could be easily added (I am all ears for suggestions - not to mention 
happy about contributions).


Regards
- henrik

On 8/11/11 9:32 PM, Andrew Thompson wrote:

I am looking for a method to parse the entire set of puppet manifests/
modules.  For example I want to see a list of all packages that I am
managing with puppet.  I have seen the compile option, but this only
gives me a particular node's point of view.  While I could just scrape
all of the manifest files for this information with grep, etc., there
must be something in the puppet code base I could plug into??

-Andrew




--
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: Passing hash as parameters to manifest

2011-08-11 Thread treydock
Looking up the use of create_resources which is mentioned in the bug
you linked, looks like it's available only in 2.7.x.  I'm currently
running 2.6.9, but may be worth upgrading for.

I tried you suggestion, but get this error...

err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Invalid tag dump_dir/backups/redmine-
sqldumpsdatabasesredminebackup_dir/var/www/rails/redmine at /etc/
puppet/modules/backuppc/manifests/definitions/sqldump.pp:11 on
node ...


Also I am not sure what you mean by functions that get an array of
first level hash keys.

Thanks
- Trey

On Aug 11, 5:59 pm, Nan Liu n...@puppetlabs.com wrote:
 On Thu, Aug 11, 2011 at 4:00 PM, treydock treyd...@gmail.com wrote:
  I have a module for backuppc, and am trying to pass a hash to a define
  to create a single script and the necessary directories.  What I can't
  seem to figure out how to do is have this hash's values be used to
  create files / directories and also populate a template.

  Here's the hash...

     $backuppc_db_dumps =  {
         redmine = {
                 'backup_dir'    = '/var/www/rails/redmine',
                 'databases'     = 'redmine',
                 'dump_dir'      = '/backups/misc-sqldumps',
         },
         general = {
                 'backup_dir'    = '/etc',
                 'databases'     = 'mysql',
                 'dump_dir'      = '/backups/misc-sqldumps',
         },
     }

  I have successfully used that to with a template to generate a script,
  but am unsure how to pass those values to a define in order to ensure
  the dump_dir exists.

  After the above variable I added

  backuppc::sqldump { $backuppc_db_dumps: }

 You are passing a hash as the resource title, a resource title is
 either a string or array of string.

  Here's the define ...

  define backuppc::sqldump () {

     file {
         $name[dump_dir]:
             ensure  = directory,
             owner   = 'root',
             group   = 'root',
             mode    = '0770',
     }
  }

  Is this something that's even possible?  The error I get doesn't make
  any sense to me...

 Not in the current form, what you are looking for is probably best
 described here:http://projects.puppetlabs.com/issues/8670

 However a small change should allow this to work. (disclaimer,
 untested, but I've done something similar).

 define backuppc::sqldump ($var) {
    $value = $var[$name]
     file {
         $value[dump_dir]:
             ensure  = directory,
             owner   = 'root',
             group   = 'root',
             mode    = '0770',
     }

 }

 backuppc::sqldump { ['redmine', 'general']:
   var =$backuppc_db_dumps,

 }

 If you have a functions that gets an array of the first level hash
 keys, you can use that instead of specifying redmine, general.

 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: Passing hash as parameters to manifest

2011-08-11 Thread Nan Liu
On Thu, Aug 11, 2011 at 7:19 PM, treydock treyd...@gmail.com wrote:
 Looking up the use of create_resources which is mentioned in the bug
 you linked, looks like it's available only in 2.7.x.  I'm currently
 running 2.6.9, but may be worth upgrading for.

Pretty sure you can be backport to 2.6 since it's just a function:

https://github.com/puppetlabs/puppetlabs-create_resources

 I tried you suggestion, but get this error...

 err: Could not retrieve catalog from remote server: Error 400 on
 SERVER: Invalid tag dump_dir/backups/redmine-
 sqldumpsdatabasesredminebackup_dir/var/www/rails/redmine at /etc/
 puppet/modules/backuppc/manifests/definitions/sqldump.pp:11 on
 node ...

Can't say for sure without more code, but this simple example should
demonstrate how this works:

$myhash = {
  var1 = {
message = 'hi'
  },
  var2 = {
message = 'bye'
  }
}

define my_notify ($var) {
  notify { $name:
message = $var[$name]['message']
  }
}

my_notify { ['var1', 'var2']:
  var = $myhash
}

 Also I am not sure what you mean by functions that get an array of
 first level hash keys.

I mean if you need this to work with any hash without manually
providing an array of resource titles write a custom puppet function
that returns hash keys as a custom puppet function.

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.