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

时间:2014-03-08 01:38:38

标签: python linux ubuntu ansible

我正在python 2.7.3

ansible安装ubuntu 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,如何获得

1 个答案:

答案 0 :(得分:2)

您尝试使用的PPA没有Python 2.7.3。在撰写本文时,它只有2.7.2和2.7.6 如果你想要Python 2.7.3,它会出现在标准precise-updates repo http://packages.ubuntu.com/precise-updates/python-all

如果您仍想使用该PPA,在使用apt_repository之前,您应该使用apt_key模块添加该PPA的签名密钥。 更新您的playbook,以便在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”,请另外命名。您可能想要修复它。