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.

55 lines
1.1 KiB

  1. ---
  2. - name: Bootstrap | Check if bootstrap is needed
  3. raw: stat /opt/bin/.bootstrapped
  4. register: need_bootstrap
  5. failed_when: false
  6. changed_when: false
  7. tags:
  8. - facts
  9. - name: Bootstrap | Run bootstrap.sh
  10. script: bootstrap.sh
  11. when: need_bootstrap.rc != 0
  12. - set_fact:
  13. ansible_python_interpreter: "/opt/bin/python"
  14. tags:
  15. - facts
  16. - name: Bootstrap | Check if we need to install pip
  17. shell: "{{ansible_python_interpreter}} -m pip --version"
  18. register: need_pip
  19. failed_when: false
  20. changed_when: false
  21. check_mode: no
  22. when: need_bootstrap.rc != 0
  23. tags:
  24. - facts
  25. - name: Bootstrap | Copy get-pip.py
  26. copy:
  27. src: get-pip.py
  28. dest: ~/get-pip.py
  29. when: need_pip != 0
  30. - name: Bootstrap | Install pip
  31. shell: "{{ansible_python_interpreter}} ~/get-pip.py"
  32. when: need_pip != 0
  33. - name: Bootstrap | Remove get-pip.py
  34. file:
  35. path: ~/get-pip.py
  36. state: absent
  37. when: need_pip != 0
  38. - name: Bootstrap | Install pip launcher
  39. copy:
  40. src: runner
  41. dest: /opt/bin/pip
  42. mode: 0755
  43. when: need_pip != 0
  44. - name: Install required python modules
  45. pip:
  46. name: "{{ item }}"
  47. with_items: "{{pip_python_coreos_modules}}"