fix installation with --template option and get public ip.

Fix installation when pass --template option.
Fix function which returns public ip using opendns.com