You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.0 KiB

  1. ---
  2. - name: Python | Check if bootstrap is needed
  3. raw: stat {{ bin_dir}}/.bootstrapped
  4. register: need_bootstrap
  5. ignore_errors: True
  6. - name: Python | Run bootstrap.sh
  7. script: bootstrap.sh
  8. when: need_bootstrap | failed
  9. - set_fact:
  10. ansible_python_interpreter: "{{ bin_dir }}/python"
  11. - name: Python | Check if we need to install pip
  12. shell: "{{ansible_python_interpreter}} -m pip --version"
  13. register: need_pip
  14. ignore_errors: True
  15. changed_when: false
  16. when: need_bootstrap | failed
  17. - name: Python | Copy get-pip.py
  18. copy: src=get-pip.py dest=~/get-pip.py
  19. when: need_pip | failed
  20. - name: Python | Install pip
  21. shell: "{{ansible_python_interpreter}} ~/get-pip.py"
  22. when: need_pip | failed
  23. - name: Python | Remove get-pip.py
  24. file: path=~/get-pip.py state=absent
  25. when: need_pip | failed
  26. - name: Python | Install pip launcher
  27. copy: src=runner dest={{ bin_dir }}/pip mode=0755
  28. when: need_pip | failed
  29. - name: Install required python modules
  30. pip:
  31. name: "{{ item }}"
  32. with_items: pip_python_modules