我正在尝试通过 Ansible 剧本在 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"]}
最佳答案
我相信您列表中的所有内容都可以从默认的 RHEL/CentOS 存储库中获得,除了 python-pip,我认为您必须从 EPEL 获得它。您是否在远程系统上配置并启用了 EPEL 存储库?
关于python - ansible 剧本 : No package matching 'python-pip' found available -on centos guest 出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47797231/