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.

71 lines
1.6 KiB

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