ansible playbook出错:没有包匹配' python-pip'发现可用-on centos客人

时间:2017-12-13 15:54:07

标签: python pip ansible

我正在尝试通过Ansible playbook在centos guest(通过vagrant旋转)上安装一些软件包。这是我尝试安装

的代码段
- name: Installing helpful tools and packages
   yum:
    pkg: "{{ item }}"
    state: present
  with_items:
    - ntp
    - tcpdump
    - policycoreutils-python
    - vim
    - vim-X11
    - yum-utils
    - deltarpm
    - git
    - ntp
    - python-pip
    - pip
  when:
    - ansible_os_family == "RedHat"

- name: Install shade using pip.
  #become: yes
  pip:
    name: "{{ item }}"
    state: present
  with_items:
    - pip
    - shade

这是我收到的错误。它未能获得' python-pip'

TASK [prep : Installing helpful tools and packages] 
****************************
failed: [default] (item=[u'ntp', u'tcpdump', u'policycoreutils-python',  
u'vim', u'vim-X11', u'yum-utils', u'deltarpm', u'git', u'ntp', 
u'python-devel', u'python-pip', u'pip']) => {"changed": false, 
"failed": true, "item": ["ntp", "tcpdump", "policycoreutils-python", 
"vim", "vim-X11", "yum-utils", "deltarpm", "git", "ntp", "python-
devel", "python-pip", "pip"], "msg": "No package matching 'python-pip' 
found available, installed or updated", "rc": 126, "results": ["yum-
utils-1.1.31-42.el7.noarch providing yum-utils is already installed", 
"deltarpm-3.6-3.el7.x86_64 providing deltarpm is already installed", 
"No package matching 'python-pip' found available, installed or 
updated"]}

1 个答案:

答案 0 :(得分:3)

我相信列表中的所有内容都可以从默认的RHEL / CentOS repo中获得,除了python-pip,我认为你必须从EPEL获得。您是否在远程系统上配置并启用了EPEL repo?