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