Re: [Puppet Users] parsing puppet YAML

2010-05-22 Thread Ohad Levy
Hi Luke,

Thats a dump of a ruby object in yaml, meaning that if you would like to
restore the object (and its methods) you would need to run it in ruby and
load the puppet libraries.

what are you trying to achieve? there are a few examples out there already.

Ohad

On Sat, May 22, 2010 at 12:44 PM, Baker, Luke Jefferson 
bake...@missouri.edu wrote:

  Hey there,



 I’ve playing with parsing some of the yaml data that puppet creates. Has
 anyone had luck doing this with python or the like? It seems that in every
 yaml file, there is a comment at the top of the file like this..



 --- !ruby/object:Puppet::Node



 Which doesn’t make may yaml parsers happy.. where am I going wrong?



 --Luke Baker



 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.compuppet-users%2bunsubscr...@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-us...@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] Best-practice way of handling IP addresses

2010-05-22 Thread andreash
Hi,

naturally, there are many places in a typical puppet manifest where
one needs to use IP addresses:

* network config
* Listen directives in server daemons
* hosts file
* ...

I was wondering if there is some 'best practice' way of specifying the
IP addresses of all the hosts in one place and then using these
variables whenever necessary? (BTW, are there global variables in
puppet?)

Thanks for your insight,

Andreas

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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] Meet Luke in London

2010-05-22 Thread R.I.Pienaar
Hello,

Luke will be in london on Monday so a great chance for a meet.

We'll meet after 6:30 at 
http://www.viewlondon.co.uk/pubsandbars/de-hems-review-11170.html

If there are any London Puppet people who dont know or arent on the list for 
the London Devops group you should sign up to that as we have regular london 
meets where lots of Puppet users go to as well.

http://londondevops.org

-- 
R.I.Pienaar

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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] parsing puppet YAML

2010-05-22 Thread Nigel Kersten
You can load it in Python, you just need to do a bit more extra work first.

I can get you an example on Monday or whenever Comcast fix my home internet
connection...

On Sat, May 22, 2010 at 12:43 AM, Ohad Levy ohadl...@gmail.com wrote:

 Hi Luke,

 Thats a dump of a ruby object in yaml, meaning that if you would like to
 restore the object (and its methods) you would need to run it in ruby and
 load the puppet libraries.

 what are you trying to achieve? there are a few examples out there already.

 Ohad


 On Sat, May 22, 2010 at 12:44 PM, Baker, Luke Jefferson 
 bake...@missouri.edu wrote:

  Hey there,



 I’ve playing with parsing some of the yaml data that puppet creates. Has
 anyone had luck doing this with python or the like? It seems that in every
 yaml file, there is a comment at the top of the file like this..



 --- !ruby/object:Puppet::Node



 Which doesn’t make may yaml parsers happy.. where am I going wrong?



 --Luke Baker



 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.compuppet-users%2bunsubscr...@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-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.compuppet-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.




-- 
nigel

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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 anyone using a tool to diagram their manifests?

2010-05-22 Thread Trevor Vaughan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Well, it turns out that 0.25 completely broke my code (no big surprise).

I was using the 'classes' method off of the parser, but I'll have to
re-write it all now since the parser appears to have been heavily modified..

Basically, it just used the puppet parser to dig through the manifest
path on your system and create a dot diagram using the RGL library of
all classes, inheritance trees, defines, and arguments to the defines.

It worked reasonably well, but has gotten crufty without use.

When I have time (not this weekend), I'll try to polish it back up for
0.25 and actually stick it out for the world to use/break/whatever.

Trevor

On 05/21/2010 12:24 PM, Trevor Vaughan wrote:
 I've got some code at home that I think does what you want.
 
 I'll try to find time to dust it off over the weekend and post it to
 the list (no promises though).
 
 Trevor
 
 On Thu, May 20, 2010 at 10:34 PM, windowsrefund windowsref...@gmail.com 
 wrote:
 Despite taking great care to keep my manifests clean and logical, my
 code is growing both in size and complexity. That said, I'm starting
 to wonder if there are any tools I can use that would run through my
 entire tree and display some user friendly map showing the
 relationships between all the classes, and definitions. Any leads
 would be appreciated.

 Best,
 Adam

 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-us...@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.


 
 
 

- -- 
Trevor Vaughan
 Vice President, Onyx Point, Inc.
 email: tvaug...@onyxpoint.com
 phone: 410-541-ONYX (6699)
 pgp: 0x6C701E94

- -- This account not approved for unencrypted sensitive information --
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iEUEARECAAYFAkv4AEsACgkQyWMIJmxwHpTCIgCXXFMGhbOXG531iVDqpkdzTO4H
2ACeN//hghZnex+GGGnl0jqoz9mAPBc=
=OIjC
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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.

attachment: tvaughan.vcf

Re: [Puppet Users] parsing puppet YAML

2010-05-22 Thread Nigel Kersten
On Fri, May 21, 2010 at 9:44 PM, Baker, Luke Jefferson bake...@missouri.edu
 wrote:

  Hey there,



 I’ve playing with parsing some of the yaml data that puppet creates. Has
 anyone had luck doing this with python or the like? It seems that in every
 yaml file, there is a comment at the top of the file like this..



 --- !ruby/object:Puppet::Node



 Which doesn’t make may yaml parsers happy.. where am I going wrong?



Hopefully this is enough to get you started. I've been meaning to write up a
blog post on this, so I might try and get that done soon.

You need to set up some stub objects so Python knows what to do with them,
like:

class PuppetReport(yaml.YAMLObject):
  yaml_tag = u'!ruby/object:Puppet::Transaction::Report'
  def __init__(self, host, logs, metrics, records, time):
self.host = host
self.logs = logs
self.metrics = metrics
self.records = records
self.time = time


class PuppetLog(yaml.YAMLObject):
  yaml_tag = u'!ruby/object:Puppet::Util::Log'
  def __init__(self, source, message, tags, time, level):
self.source = source
self.message = message
self.tags = tags
self.time = time
self.level = level


class PuppetMetric(yaml.YAMLObject):
  yaml_tag = u'!ruby/object:Puppet::Util::Metric'
  def __init__(self, values, name, label):
self.values = values
self.name = name
self.label = label


Then when you read the yaml file, Python will
consider !ruby/object:Puppet::Util::Metric to be a PuppetMetric class.

This may not be complete even for these objects, but I tend to just iterate
until I've got all the data I need.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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] Best-practice way of handling IP addresses

2010-05-22 Thread Benoit Cattié

Hi,

You can get the ipadress with facter (and use it in your puppet classes, 
templates ...)


Benoit

Le 22/05/2010 11:08, andreash a écrit :

Hi,

naturally, there are many places in a typical puppet manifest where
one needs to use IP addresses:

* network config
* Listen directives in server daemons
* hosts file
* ...

I was wondering if there is some 'best practice' way of specifying the
IP addresses of all the hosts in one place and then using these
variables whenever necessary? (BTW, are there global variables in
puppet?)

Thanks for your insight,

Andreas

   


--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To post to this group, send email to puppet-us...@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: Best-practice way of handling IP addresses

2010-05-22 Thread andreash
Hi,

thanks for your input. I had already thought about that, but initially
wanted to be able to set the ip addresses using puppet. Or is that a
bad idea?

Cheers,

Andreas.

On 22 Mai, 20:42, Benoit Cattié pup...@benoit.cattie.net wrote:
 Hi,

 You can get the ipadress with facter (and use it in your puppet classes,
 templates ...)

 Benoit

 Le 22/05/2010 11:08, andreash a écrit :



  Hi,

  naturally, there are many places in a typical puppet manifest where
  one needs to use IP addresses:

  * network config
  * Listen directives in server daemons
  * hosts file
  * ...

  I was wondering if there is some 'best practice' way of specifying the
  IP addresses of all the hosts in one place and then using these
  variables whenever necessary? (BTW, are there global variables in
  puppet?)

  Thanks for your insight,

  Andreas

 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-us...@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://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-us...@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] Default value for arguments of a definition

2010-05-22 Thread mathie
For example, I'm trying to define a function to setup the firewall
config

define fnConfig($pInterface,$pPorts) {
  file { /etc/apf/conf.apf:
content = template(apf.conf.erb),
notify = Service[apf],
  }
}

However, if I don't specify anything, I would like it to automatically
set $pInterface='eth0' and $pPorts='22,80' by default. If there
something in Puppet like this?

define fnConfig($pInterface='eth0',$pPorts='22,80') {

}

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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] Default value for arguments of a definition

2010-05-22 Thread Dan Bode
On Sat, May 22, 2010 at 2:12 PM, mathie adsp...@gmail.com wrote:

 For example, I'm trying to define a function to setup the firewall
 config

 define fnConfig($pInterface,$pPorts) {
  file { /etc/apf/conf.apf:
content = template(apf.conf.erb),
notify = Service[apf],
  }
 }

 However, if I don't specify anything, I would like it to automatically
 set $pInterface='eth0' and $pPorts='22,80' by default. If there
 something in Puppet like this?


that's exactly how it works.



 define fnConfig($pInterface='eth0',$pPorts='22,80') {
 
 }

 Thanks

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.compuppet-users%2bunsubscr...@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-us...@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: Best-practice way of handling IP addresses

2010-05-22 Thread Patrick
It's usually much easier to use DHCP for desktops, and some servers.  Also, the 
computer will (usually) need an ip address before the first puppet run.

On May 22, 2010, at 1:59 PM, andreash wrote:

 Hi,
 
 thanks for your input. I had already thought about that, but initially
 wanted to be able to set the ip addresses using puppet. Or is that a
 bad idea?
 
 Cheers,
 
 Andreas.
 
 On 22 Mai, 20:42, Benoit Cattié pup...@benoit.cattie.net wrote:
 Hi,
 
 You can get the ipadress with facter (and use it in your puppet classes,
 templates ...)
 
 Benoit
 
 Le 22/05/2010 11:08, andreash a écrit :
 
 
 
 Hi,
 
 naturally, there are many places in a typical puppet manifest where
 one needs to use IP addresses:
 
 * network config
 * Listen directives in server daemons
 * hosts file
 * ...
 
 I was wondering if there is some 'best practice' way of specifying the
 IP addresses of all the hosts in one place and then using these
 variables whenever necessary? (BTW, are there global variables in
 puppet?)
 
 Thanks for your insight,
 
 Andreas
 
 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-us...@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group 
 athttp://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-us...@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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Puppet Dashboard error.

2010-05-22 Thread Marley Bacelar
Hi i have the running i both sides, client and server sides the puppet
0.25.4

Get this error on server side:

puppetmasterd[5363]: Report puppet_dashboard failed: wrong Content-Length
format

And receive this error on my client side:
warning: Value of 'preferred_serialization_format' (pson) is invalid for
report, user default (b64_zlib_yaml)

I am getting any reports on my /var/lib/puppet/reports.


-- 
Marley Bacelar
Project Fedora Ambassador
VCP, VSP. VTSP., ITILF, IBM 000-076, IBM 000-330, IBM 000-331
marleybace...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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.