我如何安装python 2.7.3在ubuntu上使用ansible

我正在尝试安装python 2.7.3ubuntu 12

 - name: Add snake repository apt_repository: repo='ppa:fkrull/deadsnakes' state=present - name: Install postgresql apt: pkg=python2.7 state=present sudo: true remote_user: vagrant 

我得到这个错误

 TASK: [Add snake repository] ************************************************** failed: [192.168.0.28] => {"cmd": ["apt-key", "adv", "--recv-keys", "--keyserver", "hkp://keyserver.ubuntu.com:80", "FF3997E83CD969B409FB24BC5BB92C09DB82666C"], "failed": true, "rc": 2} stderr: gpg: requesting key DB82666C from hkp server keyserver.ubuntu.com gpg: no writable keyring found: eof gpg: error reading `[stream]': general error gpg: Total number processed: 0 stdout: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 FF3997E83CD969B409FB24BC5BB92C09DB82666C msg: gpg: requesting key DB82666C from hkp server keyserver.ubuntu.com gpg: no writable keyring found: eof gpg: error reading `[stream]': general error gpg: Total number processed: 0 FATAL: all hosts have already failed -- aborting 

什么是apt_key,如何得到它

您尝试使用的PPA没有Python 2.7.3。 在写这篇文章时,它只有2.7.2和2.7.6如果你想Python 2.7.3,它是在标准的precise-updates回购http://packages.ubuntu.com/precise-updates/python-all

如果您仍想使用该PPA,则在使用apt_repository之前,应使用apt_key模块添加该PPA的签名密钥。 在你的apt_repo块之前更新你的手册:

 - name: Add snake repo signing key apt_key: id=DB82666C url=http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x5BB92C09DB82666C state=present 

如果你的软件包安装块的名称是“Postgresql”,也可以命名。你可能想要解决这个问题。