I added the -E switch to my sudo command and it worked. Try:

sudo -E apt-add-repository ppa:ansible/ansible

This moves (or copies) your environment variables, including http_proxy into the sudo context.


Either there was a problem on the launchpad or you are having connection problems. It added without a problem:

$sudo apt-add-repository ppa:ansible/ansible
[sudo] password for rinzwind: 
 Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.

http://ansible.com/
 More info: https://launchpad.net/~ansible/+archive/ubuntu/ansible
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpjhg3_1oq/secring.gpg' created
gpg: keyring `/tmp/tmpjhg3_1oq/pubring.gpg' created
gpg: requesting key 7BB9C367 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpjhg3_1oq/trustdb.gpg: trustdb created
gpg: key 7BB9C367: public key "Launchpad PPA for Ansible, Inc." imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK