Hi guys, Has anyone yet tackled installing CPAN packages through puppet? I need some that aren''t available as separate debs, so if anyone has an idea how best to do this, I''d like feedback. Thanks, Thijs
On Dec 24, 2006, at 12:13 PM, Thijs Oppermann wrote:> Hi guys, > > Has anyone yet tackled installing CPAN packages through puppet? I need > some that aren''t available as separate debs, so if anyone has an idea > how best to do this, I''d like feedback.You''d need to write a cpan package provider. I''m kinda surprised no one else has written one, but it should be pretty easy -- you''ll just need to wrap the query, install, and uninstall commands (and probably the command that queries to determine the latest available version). I''ll be releasing as soon as I possibly can, so if you get the provider in soon it''ll be in the next, imminent release. -- Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. -- Susan Ertz --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
I''m not sure if I''m up to writing a provider yet. I''ve been tinkering with this today and I''m stumped by a question that I''ve run into before (but at the time I sidestepped it). The question is: is it possible to read in the results of a command executed by the underlying OS into a variable? I''d like to do something like: $cpanloc = "$( ls /usr/src/TermReadkey*.tar.gz )" Which would give me the location where the package was untarred (using some imagination, this wouldn''t be in the manifest as such). Is this possible or am I barking up the wrong tree (probably)? Thijs On 24/12/06, Luke Kanies <luke@madstop.com> wrote:> On Dec 24, 2006, at 12:13 PM, Thijs Oppermann wrote: > > > Hi guys, > > > > Has anyone yet tackled installing CPAN packages through puppet? I need > > some that aren''t available as separate debs, so if anyone has an idea > > how best to do this, I''d like feedback. > > You''d need to write a cpan package provider. I''m kinda surprised no > one else has written one, but it should be pretty easy -- you''ll just > need to wrap the query, install, and uninstall commands (and probably > the command that queries to determine the latest available version). > > I''ll be releasing as soon as I possibly can, so if you get the > provider in soon it''ll be in the next, imminent release. > > -- > Millions long for immortality who do not know what to do with > themselves on a rainy Sunday afternoon. -- Susan Ertz > --------------------------------------------------------------------- > 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 24, 2006, at 3:15 PM, Thijs Oppermann wrote:> I''m not sure if I''m up to writing a provider yet. I''ve been tinkering > with this today and I''m stumped by a question that I''ve run into > before (but at the time I sidestepped it). The question is: is it > possible to read in the results of a command executed by the > underlying OS into a variable?Yes, but only by setting up the command as a fact on the client. You cannot do this in real-time during compilation.> I''d like to do something like: > > $cpanloc = "$( ls /usr/src/TermReadkey*.tar.gz )" > > Which would give me the location where the package was untarred (using > some imagination, this wouldn''t be in the manifest as such). > > Is this possible or am I barking up the wrong tree (probably)?Hmm. At this point, I''d say the best options are to use a builtin type that just calls cpan directly using exec, or convince someone to write a provider. It really would surprise you how easy they are to write. Can you come up with the cpan shell commands you''d use to do the following: query: Determine whether a given package is installed, and possibly what version it is install: Install a specified package by name. Optionally, accept a ''source'' file that contains the actual package, rather than retrieving it from the ''net. uninstall: Uninstall a specified package list: List all installed packages Optional: latest: Determine the lastest available version of a package (for determining whether the package should be upgraded). If you can come up with these shell commands, then you''re 9/10s of the way there. All you need to do then is parse the output of the query, list, and latest commands, which is generally not too difficult. If you can post this information to the list, preferably along with a package we can use for testing (ideally it would be a package unlikely to be installed anywhere), I expect someone could hack out a provider pretty quickly. -- I cannot and will not cut my conscience to fit this year''s fashions. -- Lillian Hellman --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com