I'm following this document to install ansible: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-14-04

I'm try to add ansible to my ubuntu repositories list but this is what happens:

me@mydev:~/Documents$ sudo apt-add-repository ppa:ansible/ansible
Cannot add PPA: 'ppa:~ansible/ubuntu/ansible'.
ERROR: '~ansible' user or team does not exist.

I've also tried to just clone the repo (following these instructions: http://docs.ansible.com/ansible/intro_installation.html) But that fails with the following:

me@mydev:~/Documents/ansible$ git clone git://github.com/ansible/ansible.git --recursive
Cloning into 'ansible'...
fatal: unable to connect to github.com:
github.com[0:]: errno=Connection timed out

me@mydev:~/Documents/ansible$ ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=56 time=23.4 ms
64 bytes from icmp_seq=2 ttl=56 time=23.5 ms
--- ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 23.466/23.511/23.557/0.159 ms

As you can see, I'm getting a connection timeout error. I tried pinging the server and it seems to be able to communicate with my box. Not sure what else I could try.



I am behind a proxy. I ran this command to identify my proxy server:

me@mydev:~/Documents/ansible$ export http_proxy=

and then to test, I ran:

sudo apt-get update

and it ran fine.

  • Are you behind a proxy? – Pilot6 Feb 24 '16 at 21:59
  • @Pilot6 yes, I am behind a proxy. To test whether i'm getting out to the www, I just did an "sudo apt-get update" and it was able to update with no errors. is that an inaccurate test? – Happydevdays Feb 25 '16 at 13:34
  • 1
    Possible duplicate of Configure proxy for APT? – Pilot6 Feb 25 '16 at 13:50

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.

| improve this answer | |

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.

 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)
| improve this answer | |
  • any suggestions on how to go about testing what the issue might be? – Happydevdays Feb 25 '16 at 13:42
  • hmm I see you use a proxy, That is the most likely culprit – Rinzwind Feb 25 '16 at 13:47
  • please see my Edit 1. i've added some details about how I'm setting up the proxy. maybe that's where my problem lies? – Happydevdays Feb 25 '16 at 13:48

I had the same issue and the following worked for me.

# Make sure the source list directory exists
sudo mkdir -p /etc/apt/sources.list.d

# Adde the Ansible sources.
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu wily main" | sudo tee -a /etc/apt/sources.list.d/ansible.list
echo "deb-src http://ppa.launchpad.net/ansible/ansible/ubuntu wily main" | sudo tee -a /etc/apt/sources.list.d/ansible.list

# Install Ansible
sudo apt-get update
sudo apt-get install ansible

If you're on another release you might have to change the wily to match. Check at the Ansible Launchpad page for that.

| improve this answer | |

It's possible that your PROXY and Firewall doesn't allow you to connect via SSH.

You could try HTTPS what is most used protocol for firewalls and proxies:

git clone https://github.com/ansible/ansible.git --recursive 
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.