--- - block: - name: Check if the pip downloader is already installed stat: path: '/usr/local/lib/get-pip.py' get_checksum: yes follow: no checksum_algorithm: sha256 register: get_pip_file - name: Install the get-pip.py pip downloader get_url: url={{ python_get_pip_url }} dest=/usr/local/lib/get-pip.py #checksum="sha256:{{ get_pip_file.stat.checksum }}" when: not get_pip_file.stat.exists - name: Install a script that fixes the broken trusty pip package copy: src=pip-fixer.sh dest=/usr/local/bin/python-pip-fixer mode=0755 owner=root group=root register: python_pip_fixer - name: Fix the trusty pip installation shell: /usr/local/bin/python-pip-fixer when: python_pip_fixer is changed or force_python_fix | bool - name: Install the python dev headers and other dev requirements apt: pkg={{ python_pip_dev_packages }} state={{ python_pkgs_state }} update_cache=yes cache_valid_time=1800 - name: Install a specific version of tornado to avoid breaking dependencies pip: name=tornado version=4.1 state=present - name: Install the latest six python package pip: name=six state=present - name: Install setuptools version 33.1.1 pip: name=setuptools version=33.1.1 state=present - name: Fix the ssl warnings installing some ssl libraries pip: name={{ python_pip_fix_ssl_warnings | default ([]) }} state={{ python_pkgs_state }} register: python_pip_env_workaround when: ansible_distribution_release == "trusty" tags: [ "python", 'py_env', 'ansible_setup' ]