I''ve been hacking at puppet for the past week or two, and came up with some great stuff, but I''m wondering if there''s a way to tie it all together To create a virtual machine for our company''s QA environment, I''m currently doing 3 things: #create a vm node vmsvr2 inherits default { include vmserver vmserver::vm { "rhel4-agt64-1": disk_size => "8Gb", ensure => running, mac_ext => "06:1c", } ... } #create a cobbler system definition node cobbler inherits default { include cobbler ... cobbler::system { "rh4-agt64-1": mac => "00:50:56:00:06:1c", profile => "rhel4-agent64", ip => "10.100.6.172"; } } #create a node: node rh4-agt-1 { clarity::agent { "4.0.0-1": oracle => "10.0.0.3" } } Which is incredible! We had a guy on staff who was doing only these things almost full time, so puppet''s allowed him to do bigger and better things (like take Christmas break off :) Still, I wish I could do something like: qa_node ( "rh4-agt-1": clarity => "4.0.0-1", oracle => "10.0.0.3", mac => "00:50:56:00:06:1c", profile => "rhel4-agent64", ip => "10.100.6.172", disk_size => "8gb" } In my dream world, this would tell the cobbler system about the neew system, the vmware server about the new VM, and create a puppet node Is such a thing possible? Eugene Ventimiglia Director of Systems GridApp Systems e: eventi@gridapp.com o: 646 452 4081 _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
I''d imagine it is. What you probably need to do is create one or more defines that put your system together, so that you can just call one define with all the necessary information, which then parcels that out to other defines to do the real work. It depends on your specific needs how that will look, but you should probably start at [1]. And then look around in the growing collection of published modules and recipes, for example here: [2]. Hope that helps a bit. Thijs [1] http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#definitions [2] http://reductivelabs.com/trac/puppet/wiki/PuppetModules On Dec 26, 2007 7:49 PM, Eugene Ventimiglia <eventi@gridapp.com> wrote:> > > I''ve been hacking at puppet for the past week or two, and came up with some > great stuff, but I''m wondering if there''s a way to tie it all together > > To create a virtual machine for our company''s QA environment, I''m currently > doing 3 things: > > #create a vm > node vmsvr2 inherits default { > include vmserver > vmserver::vm { > "rhel4-agt64-1": > disk_size => "8Gb", > ensure => running, > mac_ext => "06:1c", > } > ... > } > > #create a cobbler system definition > node cobbler inherits default { > include cobbler > ... > cobbler::system { > "rh4-agt64-1": > mac => "00:50:56:00:06:1c", > profile => "rhel4-agent64", > ip => "10.100.6.172"; > } > } > > #create a node: > node rh4-agt-1 { > clarity::agent { "4.0.0-1": > oracle => "10.0.0.3" > } > } > > Which is incredible! We had a guy on staff who was doing only these things > almost full time, so puppet''s allowed him to do bigger and better things > (like take Christmas break off :) > > Still, I wish I could do something like: > > qa_node ( "rh4-agt-1": > clarity => "4.0.0-1", > oracle => "10.0.0.3", > mac => "00:50:56:00:06:1c", > profile => "rhel4-agent64", > ip => "10.100.6.172", > disk_size => "8gb" > } > > In my dream world, this would tell the cobbler system about the neew system, > the vmware server about the new VM, and create a puppet node > > Is such a thing possible? > > > > Eugene Ventimiglia > Director of Systems > GridApp Systems > e: eventi@gridapp.com > o: 646 452 4081 > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users > >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thijs Oppermann wrote:> that will look, but you should probably start at [1]. And then look > around in the growing collection of published modules and recipes, for > example here: [2].And it''d be great if you added your recipes and definitions to the wiki when done. Puppet is particularly useful in managing large numbers of virtual machines and your experiences will be valuable to other users. Regards James Turnbull - -- James Turnbull (james@lovedthanlost.net) - -- Author of: - - Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) - - Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) - - Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHc7Jo9hTGvAxC30ARAuikAKCrUzL1bD6uDXxb0/6vJsxwCgMbfgCgiiE1 9WqsyCox9ZV8XaXuBrvF5rw=vf+/ -----END PGP SIGNATURE-----
My problem is that the vm needs to be instantiated in one of the vmservers, the cobbler system needs to be instantiated in the cobbler server, and the node definitions need to be instantiated in the puppet server... So presumably, I could set up all the nodes in the define, but then I could only add systems to the cobbler server via the define -----Original Message----- From: puppet-users-bounces@madstop.com [mailto:puppet-users-bounces@madstop.com] On Behalf Of Thijs Oppermann Sent: Thursday, December 27, 2007 7:42 AM To: Puppet User Discussion Subject: Re: [Puppet-users] Thank you puppet!! I''d imagine it is. What you probably need to do is create one or more defines that put your system together, so that you can just call one define with all the necessary information, which then parcels that out to other defines to do the real work. It depends on your specific needs how that will look, but you should probably start at [1]. And then look around in the growing collection of published modules and recipes, for example here: [2]. Hope that helps a bit. Thijs [1] http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#definitions [2] http://reductivelabs.com/trac/puppet/wiki/PuppetModules On Dec 26, 2007 7:49 PM, Eugene Ventimiglia <eventi@gridapp.com> wrote:> > > I''ve been hacking at puppet for the past week or two, and came up with> some great stuff, but I''m wondering if there''s a way to tie it all > together > > To create a virtual machine for our company''s QA environment, I''m > currently doing 3 things: > > #create a vm > node vmsvr2 inherits default { > include vmserver > vmserver::vm { > "rhel4-agt64-1": > disk_size => "8Gb", > ensure => running, > mac_ext => "06:1c", > } > ... > } > > #create a cobbler system definition > node cobbler inherits default { > include cobbler > ... > cobbler::system { > "rh4-agt64-1": > mac => "00:50:56:00:06:1c", > profile => "rhel4-agent64", > ip => "10.100.6.172"; > } > } > > #create a node: > node rh4-agt-1 { > clarity::agent { "4.0.0-1": > oracle => "10.0.0.3" > } > } > > Which is incredible! We had a guy on staff who was doing only these > things almost full time, so puppet''s allowed him to do bigger and > better things (like take Christmas break off :) > > Still, I wish I could do something like: > > qa_node ( "rh4-agt-1": > clarity => "4.0.0-1", > oracle => "10.0.0.3", > mac => "00:50:56:00:06:1c", > profile => "rhel4-agent64", > ip => "10.100.6.172", > disk_size => "8gb" > } > > In my dream world, this would tell the cobbler system about the neew > system, the vmware server about the new VM, and create a puppet node > > Is such a thing possible? > > > > Eugene Ventimiglia > Director of Systems > GridApp Systems > e: eventi@gridapp.com > o: 646 452 4081 > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users > >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Dec 27, 2007, at 10:15 AM, Eugene Ventimiglia wrote:> My problem is that the vm needs to be instantiated in one of the > vmservers, the cobbler system needs to be instantiated in the cobbler > server, and the node definitions need to be instantiated in the puppet > server... > > So presumably, I could set up all the nodes in the define, but then I > could only add systems to the cobbler server via the defineThere are basically two ways to do this: 1) Create classes that generate different resources for different types of hosts. E.g., it''ll generate cobbler configs on the cobbler server and vm configs on the vm server. You''d do this with a case statement in the class. 2) Use exported resources. This isn''t currently ideal for what you want, since you''re creating resources related to hosts that don''t yet exist, which doesn''t work all that well in Puppet just yet. Basically, the area you''re in isn''t as easy in Puppet as I''d like; there are ways to get what you want, but they might not be worth it just yet. -- Writing is not necessarily something to be ashamed of, but do it in private and wash your hands afterwards. --Robert Heinlein --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 27 December 2007, Eugene Ventimiglia wrote:> My problem is that the vm needs to be instantiated in one of the > vmservers, the cobbler system needs to be instantiated in the cobbler > server, and the node definitions need to be instantiated in the puppet > server... > > So presumably, I could set up all the nodes in the define, but then I > could only add systems to the cobbler server via the defineI have solved a similar problem for provisioning virtual servers in my hosting solution. Start here: http://git.black.co.at/?p=module-hosting;a=blob;f=manifests/init.pp;h=317f15e33d127d49217e11effad65402a57c6893;hb=HEAD Regards and good luck, DavidS> > > -----Original Message----- > From: puppet-users-bounces@madstop.com > [mailto:puppet-users-bounces@madstop.com] On Behalf Of Thijs Oppermann > Sent: Thursday, December 27, 2007 7:42 AM > To: Puppet User Discussion > Subject: Re: [Puppet-users] Thank you puppet!! > > I''d imagine it is. > > What you probably need to do is create one or more defines that put your > system together, so that you can just call one define with all the > necessary information, which then parcels that out to other defines to > do the real work. It depends on your specific needs how that will look, > but you should probably start at [1]. And then look around in the > growing collection of published modules and recipes, for example here: > [2]. > > Hope that helps a bit. > > Thijs > > [1] > http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#definitions > [2] http://reductivelabs.com/trac/puppet/wiki/PuppetModules > > On Dec 26, 2007 7:49 PM, Eugene Ventimiglia <eventi@gridapp.com> wrote: > > I''ve been hacking at puppet for the past week or two, and came up with > > > > some great stuff, but I''m wondering if there''s a way to tie it all > > together > > > > To create a virtual machine for our company''s QA environment, I''m > > currently doing 3 things: > > > > #create a vm > > node vmsvr2 inherits default { > > include vmserver > > vmserver::vm { > > "rhel4-agt64-1": > > disk_size => "8Gb", > > ensure => running, > > mac_ext => "06:1c", > > } > > ... > > } > > > > #create a cobbler system definition > > node cobbler inherits default { > > include cobbler > > ... > > cobbler::system { > > "rh4-agt64-1": > > mac => "00:50:56:00:06:1c", > > profile => "rhel4-agent64", > > ip => "10.100.6.172"; > > } > > } > > > > #create a node: > > node rh4-agt-1 { > > clarity::agent { "4.0.0-1": > > oracle => "10.0.0.3" > > } > > } > > > > Which is incredible! We had a guy on staff who was doing only these > > things almost full time, so puppet''s allowed him to do bigger and > > better things (like take Christmas break off :) > > > > Still, I wish I could do something like: > > > > qa_node ( "rh4-agt-1": > > clarity => "4.0.0-1", > > oracle => "10.0.0.3", > > mac => "00:50:56:00:06:1c", > > profile => "rhel4-agent64", > > ip => "10.100.6.172", > > disk_size => "8gb" > > } > > > > In my dream world, this would tell the cobbler system about the neew > > system, the vmware server about the new VM, and create a puppet node > > > > Is such a thing possible? > > > > > > > > Eugene Ventimiglia > > Director of Systems > > GridApp Systems > > e: eventi@gridapp.com > > o: 646 452 4081 > > > > _______________________________________________ > > Puppet-users mailing list > > Puppet-users@madstop.com > > https://mail.madstop.com/mailman/listinfo/puppet-users > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users- -- The primary freedom of open source is not the freedom from cost, but the free- dom to shape software to do what you want. This freedom is /never/ exercised without cost, but is available /at all/ only by accepting the very different costs associated with open source, costs not in money, but in time and effort. - -- http://www.schierer.org/~luke/log/20070710-1129/on-forks-and-forking -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHc+Y6/Pp1N6Uzh0URApOuAJ4/AB9fRKw5caBNBYzElbom0tAeKwCeL6/L 6O/ZvOktv2fgzIFiV1zPRhI=WtIh -----END PGP SIGNATURE-----
Option 1 seems promising... If I read you correctly, this is how it would look... what would be the value of $VASISDIS nodes.pp: node vmserver { include qanodes ... } node puppet { include qanodes ... } qanodes.pp: class qanodes { qa_node ( "rh4-agt-1": clarity => "4.0.0-1", oracle => "10.0.0.3", mac => "00:50:56:00:06:1c", profile => "rhel4-agent64", ip => "10.100.6.172", disk_size => "8gb" } ... } qanodes::qa_node { case $VASISDIS { vmserver: { vmware::vm { $name: ... } puppet: { node { $name: ... } } cobbler: { cobbler::system { $name: ... } } } ... } -----Original Message----- From: puppet-users-bounces@madstop.com [mailto:puppet-users-bounces@madstop.com] On Behalf Of Luke Kanies Sent: Thursday, December 27, 2007 12:07 PM To: Puppet User Discussion Subject: Re: [Puppet-users] Thank you puppet!! On Dec 27, 2007, at 10:15 AM, Eugene Ventimiglia wrote:> My problem is that the vm needs to be instantiated in one of the > vmservers, the cobbler system needs to be instantiated in the cobbler > server, and the node definitions need to be instantiated in the puppet> server... > > So presumably, I could set up all the nodes in the define, but then I > could only add systems to the cobbler server via the defineThere are basically two ways to do this: 1) Create classes that generate different resources for different types of hosts. E.g., it''ll generate cobbler configs on the cobbler server and vm configs on the vm server. You''d do this with a case statement in the class. 2) Use exported resources. This isn''t currently ideal for what you want, since you''re creating resources related to hosts that don''t yet exist, which doesn''t work all that well in Puppet just yet. Basically, the area you''re in isn''t as easy in Puppet as I''d like; there are ways to get what you want, but they might not be worth it just yet. -- Writing is not necessarily something to be ashamed of, but do it in private and wash your hands afterwards. --Robert Heinlein --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Dec 27, 2007, at 3:26 PM, Eugene Ventimiglia wrote:> Option 1 seems promising... > > If I read you correctly, this is how it would look... what would be > the > value of $VASISDIS[snip] Basically, except you can''t use ''node'' in the case statement, just use another defined type. -- Some people are afraid of heights. I''m afraid of widths. -- Stephen Wright --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com