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.

54 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. tags:
  23. - facts
  24. - name: Bootstrap | Copy get-pip.py
  25. copy:
  26. src: get-pip.py
  27. dest: ~/get-pip.py
  28. when: need_pip.rc != 0
  29. - name: Bootstrap | Install pip
  30. shell: "{{ansible_python_interpreter}} ~/get-pip.py"
  31. when: need_pip.rc != 0
  32. - name: Bootstrap | Remove get-pip.py
  33. file:
  34. path: ~/get-pip.py
  35. state: absent
  36. when: need_pip.rc != 0
  37. - name: Bootstrap | Install pip launcher
  38. copy:
  39. src: runner
  40. dest: /opt/bin/pip
  41. mode: 0755
  42. when: need_pip.rc != 0
  43. - name: Install required python modules
  44. pip:
  45. name: "{{ item }}"
  46. with_items: "{{pip_python_coreos_modules}}"