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.

69 lines
1.5 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: Force binaries directory for Container Linux by CoreOS
  10. set_fact:
  11. bin_dir: "/opt/bin"
  12. tags:
  13. - facts
  14. - name: Bootstrap | Run bootstrap.sh
  15. script: bootstrap.sh
  16. when: need_bootstrap.rc != 0
  17. - set_fact:
  18. ansible_python_interpreter: "{{ bin_dir }}/python"
  19. tags:
  20. - facts
  21. - name: Bootstrap | Check if we need to install pip
  22. shell: "pip --version"
  23. register: need_pip
  24. failed_when: false
  25. changed_when: false
  26. check_mode: no
  27. tags:
  28. - facts
  29. environment:
  30. PATH: "{{ ansible_env.PATH }}:{{ bin_dir }}"
  31. - name: Bootstrap | Copy get-pip.py
  32. copy:
  33. src: get-pip.py
  34. dest: ~/get-pip.py
  35. when: need_pip.rc != 0
  36. - name: Bootstrap | Install pip
  37. shell: "{{ansible_python_interpreter}} ~/get-pip.py"
  38. when: need_pip.rc != 0
  39. - name: Bootstrap | Remove get-pip.py
  40. file:
  41. path: ~/get-pip.py
  42. state: absent
  43. when: need_pip.rc != 0
  44. - name: Bootstrap | Install pip launcher
  45. copy:
  46. src: runner
  47. dest: "{{ bin_dir }}/pip"
  48. mode: 0755
  49. when: need_pip.rc != 0
  50. - name: Install required python modules
  51. pip:
  52. name: "{{ item }}"
  53. with_items: "{{pip_python_coreos_modules}}"
  54. environment:
  55. PATH: "{{ ansible_env.PATH }}:{{ bin_dir }}"
  56. - name: Bootstrap | Disable auto-upgrade
  57. shell: "systemctl stop locksmithd.service && systemctl mask --now locksmithd.service"
  58. when:
  59. - not coreos_auto_upgrade