Sparrowdo automation. Part 2. Dealing with http proxy servers.

This is a next post in Sparrowdo automation series.

The previous one was Installing CPAN packages.

Sometimes having internet restricted by http proxy usage could be a problem.

Recalling our latest post on installing CPAN packages, what if we have a server with http traffic only available under some http proxy server? Then we would fail to install any CPAN packages here, and would have a similar error from cpanm client:

$ cpanm CGI

! Finding CGI on cpanmetadb failed.
--> Working on CGI
Fetching http://www.cpan.org/authors/id/L/LE/LEEJO/CGI-4.31.tar.gz ... FAIL

Ok. Passing http proxy is possible when using sparrowdo. Let's get back to the cpan-package plugin.

$ cat sparrowfile

task_run  %(
  task => 'install CGI module',
  plugin => 'cpan-package',
  parameters => %(
    list => 'CGI',
    http_proxy =>  $Sparrowdo::HttpProxy,
    https_proxy => $Sparrowdo::HttpsProxy,
  ),
);

Now let's run sparrowdo with some http/https proxy server parameters:

$ sparrowdo --http_proxy=http://my.internal.proxy:3128 --https_proxy=http://my.internal.proxy:3128 --host=192.168.0.1

That is it. Now sparrowdo will succeed in installing CPAN module CGI on the target server with http proxy restricted internet.

Bye! And keep your eye on following sparrowdo tutorials ... Next I am going to talk about installing system packages using sparrowdo.

Leave a comment

About melezhik

user-pic Dev & Devops --- Then I beheld all the work of God, that a man cannot find out the work that is done under the sun: because though a man labour to seek it out, yet he shall not find it; yea further; though a wise man think to know it, yet shall he not be able to find it. (Ecclesiastes 8:17)