I am trying to install a few packages on centos guest (which was spun through vagrant) through Ansible playbook. This is the snippet where I try to install
- 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
This is the error I receive. It's failing to get '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"]}
I believe everything on your list is available from the default RHEL/CentOS repo except for python-pip, which I think you have to get from EPEL. Do you have the EPEL repo configured and enabled on the remote system?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With