- name: Install Python 3 pip package: name: - python3-pip - python3-setuptools - python3-wheel state: present become: yes - name: Install Python 2 pip yum: name: - python-pip - python-setuptools - python-virtualenv - python-wheel state: present enablerepo: epel become: yes when: ensure_pip_from_packages_with_python2 or ansible_python.version.major == 2