在 ubuntu 上安装 ansible

Hap*_*ays 7 repository proxy add-apt-repository software-installation

我正在按照此文档安装 ansible:https ://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-ubuntu-14-04

我正在尝试将 ansible 添加到我的 ubuntu 存储库列表中,但这就是发生的情况:

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.
me@mydev:~/Documents$ 
Run Code Online (Sandbox Code Playgroud)

我也试过克隆 repo(按照这些说明:http : //docs.ansible.com/ansible/intro_installation.html)但是失败了:

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: 192.30.252.131]: errno=Connection timed out

me@mydev:~/Documents/ansible$ ping 192.30.252.131
PING 192.30.252.131 (192.30.252.131) 56(84) bytes of data.
64 bytes from 192.30.252.131: icmp_seq=1 ttl=56 time=23.4 ms
64 bytes from 192.30.252.131: icmp_seq=2 ttl=56 time=23.5 ms
^C
--- 192.30.252.131 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
me@mydev:~/Documents/ansible$ 
Run Code Online (Sandbox Code Playgroud)

如您所见,我收到连接超时错误。我尝试 ping 服务器,它似乎能够与我的盒子通信。不知道我还能尝试什么。

谢谢。

编辑 1

我在代理后面。我运行这个命令来识别我的代理服务器:

me@mydev:~/Documents/ansible$ export http_proxy=http://10.20.30.40:8080
Run Code Online (Sandbox Code Playgroud)

然后为了测试,我跑了:

sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

它运行良好。

Rin*_*ind 1

启动板上出现问题或者您遇到连接问题。它添加没有问题:

\n\n
$sudo apt-add-repository ppa:ansible/ansible\n[sudo] password for rinzwind: \n 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\xe2\x80\x94 automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.\n\nhttp://ansible.com/\n More info: https://launchpad.net/~ansible/+archive/ubuntu/ansible\nPress [ENTER] to continue or ctrl-c to cancel adding it\n\ngpg: keyring `/tmp/tmpjhg3_1oq/secring.gpg\' created\ngpg: keyring `/tmp/tmpjhg3_1oq/pubring.gpg\' created\ngpg: requesting key 7BB9C367 from hkp server keyserver.ubuntu.com\ngpg: /tmp/tmpjhg3_1oq/trustdb.gpg: trustdb created\ngpg: key 7BB9C367: public key "Launchpad PPA for Ansible, Inc." imported\ngpg: Total number processed: 1\ngpg:               imported: 1  (RSA: 1)\nOK\n
Run Code Online (Sandbox Code Playgroud)\n


小智 0

我遇到了同样的问题,以下内容对我有用。

# 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
Run Code Online (Sandbox Code Playgroud)

如果您使用的是另一个版本,您可能需要更改wily以匹配。请查看Ansible Launchpad 页面