So the idea of integrating perl application install come into my mind in natural way.perl Build.PL ./Build ./Build installdeps ./Build test ./Build install
With cpan cookbook one may do standard perl build/test/install idioms using chef. Here I am putting some use cases, just to give some sense of what it is. If you like it, you may learn more on http://community.opscode.com/cookbooks/cpan.
The same thing with your perl5lib paths taking into account ('/home/user/alex/perl5lib/'):remote_file '/tmp/app-0.0.1.tag.gz' source 'http://local.server/app-0.0.1.tag.gz' end execute 'cd /tmp/ && tar -xzf app.tag.gz' cpan_client 'my application' do user 'root' group 'root' install_type 'application' action 'install' install_base '/path/to/your/application/home' cwd '/tmp/app-0.0.1' end
If you need just installing arbitrary cpan module, here some examples to start. Install by given link:cpan_client 'my application' do user 'root' group 'root' install_type 'application' action 'install' install_base '/path/to/your/application/home' cwd '/tmp/app-0.0.1' inc %w{ /home/user/alex/perl5lib/ } end
Or just rely on your cpan mirrors:cpan_client "http://search.cpan.org/CPAN/authors/id/M/MA/MARKSTOS/CGI. +pm-3.59.tar.gz" do user 'root' group 'root' module_name 'CGI' action 'install' end
With cpan cookbooks you may even play with version requirements. Require minimal version:cpan_client 'CGI' do user 'root' group 'root' install_type 'cpan_module' action 'install' end
Do not install if already installed:cpan_client 'CGI' do user 'root' group 'root' version '3.55' install_type 'cpan_module' action 'install' end
Try to upgrade to highest possible version:cpan_client 'CGI' do user 'root' group 'root' version '0' install_type 'cpan_module' action 'install' end
If you install by distributive, you may even require concrete version:cpan_client 'CGI' do user 'root' group 'root' install_type 'cpan_module' action 'install' end
Other examples to check out is on http://community.opscode.com/cookbooks/cpan.cpan_client 'http://search.cpan.org/CPAN/authors/id/M/MA/MARKSTOS/CGI. +pm-3.59.tar.gz' do user 'root' group 'root' module_name 'CGI' version '=3.59' action 'install' end
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: chef cpan cookbook
by Tux (Canon) on Mar 25, 2013 at 16:04 UTC | |
by melezhik (Monk) on Mar 26, 2013 at 07:37 UTC | |
by Tux (Canon) on Mar 26, 2013 at 09:54 UTC | |
by melezhik (Monk) on Mar 26, 2013 at 12:31 UTC | |
|
Re: chef cpan cookbook
by hoppfrosch (Scribe) on Oct 21, 2015 at 08:23 UTC | |
by Corion (Patriarch) on Oct 21, 2015 at 08:31 UTC | |
by hoppfrosch (Scribe) on Oct 21, 2015 at 08:40 UTC | |
by Corion (Patriarch) on Oct 21, 2015 at 08:46 UTC | |
by hoppfrosch (Scribe) on Oct 21, 2015 at 09:52 UTC |