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.

56 lines
1.5 KiB

  1. ---
  2. # raw: cat /etc/issue.net | grep '{{ bootstrap_versions }}'
  3. - name: Bootstrap | Check if bootstrap is needed
  4. raw: which "{{ item }}"
  5. register: need_bootstrap
  6. failed_when: false
  7. changed_when: false
  8. with_items:
  9. - python
  10. - pip
  11. - dbus-daemon
  12. environment: {}
  13. tags: facts
  14. - name: Check http::proxy in /etc/apt/apt.conf
  15. raw: grep -qsi 'Acquire::http::Proxy' /etc/apt/apt.conf
  16. register: need_http_proxy
  17. failed_when: false
  18. changed_when: false
  19. environment: {}
  20. tags: facts
  21. - name: Add http_proxy to /etc/apt/apt.conf if http_proxy is defined
  22. raw: echo 'Acquire::http::Proxy "{{http_proxy}}";' >> /etc/apt/apt.conf
  23. environment: {}
  24. when:
  25. - need_http_proxy.rc != 0
  26. - http_proxy is defined
  27. - name: Check https::proxy in /etc/apt/apt.conf
  28. raw: grep -qsi 'Acquire::https::Proxy' /etc/apt/apt.conf
  29. register: need_https_proxy
  30. failed_when: false
  31. changed_when: false
  32. environment: {}
  33. tags: facts
  34. - name: Add https_proxy to /etc/apt/apt.conf if https_proxy is defined
  35. raw: echo 'Acquire::https::proxy "{{https_proxy}}";' >> /etc/apt/apt.conf
  36. environment: {}
  37. when:
  38. - need_https_proxy.rc != 0
  39. - https_proxy is defined
  40. - name: Bootstrap | Install python 2.x, pip, and dbus
  41. raw:
  42. apt-get update && \
  43. DEBIAN_FRONTEND=noninteractive apt-get install -y python-minimal python-pip dbus
  44. environment: {}
  45. when:
  46. need_bootstrap.results | map(attribute='rc') | sort | last | bool
  47. - set_fact:
  48. ansible_python_interpreter: "/usr/bin/python"
  49. tags: facts