Karl W. Lewis
2008-Dec-12 13:12 UTC
[Puppet Users] Help with Puppet and Multi-line Records, Sybase Interfaces files
Greetings, all, I''ve looked around some at the puppet code, and naturally tried google, but I don''t see a solution to my configuration problem. (I''m an absolute ruby noob, however, so the answer may be starting at me; I just don''t see it.) I''d like to use puppet to maintain the configuration of the Sybase Interfaces file on a number of my servers. The format of an interfaces entry is like so: SybaseInstance master tcp ether 10.255.1.14 5000 query tcp ether 10.255.1.14 5000 The variable parts being the Instance Name, the IP Address, and the port. The file is just a plain, old text file. All the examples I can find show how to manage a file where the records are a single line long, and it isn''t clear to me how to cope with a three, (or four, if you wanted to count the optional blank line following), line record. I believe I need to implement a type and a provider in order to accomplish managing these files, but I''m coming up short in being able to deal with a file formatted this way. If anyone had any insights, or even actual *code*, they''d be willing to share I''d be most appreciative. Thanks, Karl --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Nigel Kersten
2008-Dec-12 14:08 UTC
[Puppet Users] Re: Help with Puppet and Multi-line Records, Sybase Interfaces files
Karl, have a look at templating. http://reductivelabs.com/trac/puppet/wiki/PuppetTemplating If you make all of these variables facts, then you can use them inside an erb template to construct the file, so long as you''re happy to be managing the whole file. On Fri, Dec 12, 2008 at 5:12 AM, Karl W. Lewis <karl.w.lewis@gmail.com> wrote:> Greetings, all, > > I''ve looked around some at the puppet code, and naturally tried google, but > I don''t see a solution to my configuration problem. (I''m an absolute ruby > noob, however, so the answer may be starting at me; I just don''t see it.) > > I''d like to use puppet to maintain the configuration of the Sybase > Interfaces file on a number of my servers. > > The format of an interfaces entry is like so: > > SybaseInstance > master tcp ether 10.255.1.14 5000 > query tcp ether 10.255.1.14 5000 > > The variable parts being the Instance Name, the IP Address, and the port. > The file is just a plain, old text file. > > All the examples I can find show how to manage a file where the records are > a single line long, and it isn''t clear to me how to cope with a three, (or > four, if you wanted to count the optional blank line following), line > record. > > I believe I need to implement a type and a provider in order to accomplish > managing these files, but I''m coming up short in being able to deal with a > file formatted this way. If anyone had any insights, or even actual *code*, > they''d be willing to share I''d be most appreciative. > > Thanks, > > Karl > > > >-- Nigel Kersten Systems Administrator Tech Lead - MacOps --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
James Turnbull
2008-Dec-12 14:10 UTC
[Puppet Users] Re: Help with Puppet and Multi-line Records, Sybase Interfaces files
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Karl W. Lewis wrote:> Greetings, all, > > I''ve looked around some at the puppet code, and naturally tried google, > but I don''t see a solution to my configuration problem. (I''m an > absolute ruby noob, however, so the answer may be starting at me; I just > don''t see it.) > > I''d like to use puppet to maintain the configuration of the Sybase > Interfaces file on a number of my servers. > > The format of an interfaces entry is like so: > > SybaseInstance > master tcp ether 10.255.1.14 5000 > query tcp ether 10.255.1.14 5000 > > The variable parts being the Instance Name, the IP Address, and the > port. The file is just a plain, old text file. >Then how about a template? http://reductivelabs.com/trac/puppet/wiki/PuppetTemplating Regards James Turnbull - -- 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 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJQnDA9hTGvAxC30ARAviJAJ9Q+dLzeDVxJf5Pg9UJK5Q2qkFuHgCdEhDW FY+BNG4QnAwIDhpn0Ahgp9U=trWf -----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-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Karl W. Lewis
2008-Dec-12 16:41 UTC
[Puppet Users] Re: Help with Puppet and Multi-line Records, Sybase Interfaces files
On Fri, Dec 12, 2008 at 9:08 AM, Nigel Kersten <nigelk@google.com> wrote:> > Karl, have a look at templating. > > http://reductivelabs.com/trac/puppet/wiki/PuppetTemplating > > If you make all of these variables facts, then you can use them inside > an erb template to construct the file, so long as you''re happy to be > managing the whole file. > > > On Fri, Dec 12, 2008 at 5:12 AM, Karl W. Lewis <karl.w.lewis@gmail.com> > wrote: > > Greetings, all, > > > > I''ve looked around some at the puppet code, and naturally tried google, > but > > I don''t see a solution to my configuration problem. (I''m an absolute > ruby > > noob, however, so the answer may be starting at me; I just don''t see it.) > > > > I''d like to use puppet to maintain the configuration of the Sybase > > Interfaces file on a number of my servers. > > > > The format of an interfaces entry is like so: > > > > SybaseInstance > > master tcp ether 10.255.1.14 5000 > > query tcp ether 10.255.1.14 5000 > > > > The variable parts being the Instance Name, the IP Address, and the port. > > The file is just a plain, old text file. > > > > All the examples I can find show how to manage a file where the records > are > > a single line long, and it isn''t clear to me how to cope with a three, > (or > > four, if you wanted to count the optional blank line following), line > > record. > > > > I believe I need to implement a type and a provider in order to > accomplish > > managing these files, but I''m coming up short in being able to deal with > a > > file formatted this way. If anyone had any insights, or even actual > *code*, > > they''d be willing to share I''d be most appreciative. > > > > Thanks, > > > > Karl > > > > > > > > > > > -- > Nigel Kersten > Systems Administrator > Tech Lead - MacOps > > > >Mr. Kersten, Mr. Turnbull, Thank you, I am now studying templating in hopes that I can use that to make this work. I can manage the whole file, although I confess, I was rather hoping that I could deal with it like the hosts file and add entries one at a time based upon the type of server being configured. (I mean, how cool is the hosts function in puppet? That right there sells the project.) It occurs to me, too, then that I could use templates to manage individual entries as separate files, and have an exec resource that will put ''em all together. Thank you very kindly. As an aside, I bought a copy, a couple of years ago now, I think, of Pro Nagios 2.0 and then implemented Nagios here at work. Rather more recently I purchased a copy of Pulling Strings with Puppet, (it''s even now sitting on my associate''s desk), and I am starting to implement puppet here. Even a casual observer might detect a pattern. Be well, KWL --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---