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.

81 lines
2.1 KiB

  1. ---
  2. # Some Debian based distros ship without Python installed
  3. - name: Check if bootstrap is needed
  4. raw: which python
  5. register: need_bootstrap
  6. failed_when: false
  7. changed_when: false
  8. # This command should always run, even in check mode
  9. check_mode: false
  10. environment: {}
  11. tags:
  12. - facts
  13. - name: Check http::proxy in apt configuration files
  14. raw: apt-config dump | grep -qsi 'Acquire::http::proxy'
  15. register: need_http_proxy
  16. failed_when: false
  17. changed_when: false
  18. # This command should always run, even in check mode
  19. check_mode: false
  20. environment: {}
  21. when:
  22. - http_proxy is defined
  23. - name: Add http_proxy to /etc/apt/apt.conf if http_proxy is defined
  24. raw: echo 'Acquire::http::proxy "{{ http_proxy }}";' >> /etc/apt/apt.conf
  25. become: true
  26. environment: {}
  27. when:
  28. - http_proxy is defined
  29. - need_http_proxy.rc != 0
  30. - name: Check https::proxy in apt configuration files
  31. raw: apt-config dump | grep -qsi 'Acquire::https::proxy'
  32. register: need_https_proxy
  33. failed_when: false
  34. changed_when: false
  35. # This command should always run, even in check mode
  36. check_mode: false
  37. environment: {}
  38. when:
  39. - https_proxy is defined
  40. - name: Add https_proxy to /etc/apt/apt.conf if https_proxy is defined
  41. raw: echo 'Acquire::https::proxy "{{ https_proxy }}";' >> /etc/apt/apt.conf
  42. become: true
  43. environment: {}
  44. when:
  45. - https_proxy is defined
  46. - need_https_proxy.rc != 0
  47. - name: Change Network Name Resolution configuration
  48. raw: sed -i 's/^DNSSEC=yes/DNSSEC=allow-downgrade/g' /etc/systemd/resolved.conf
  49. become: true
  50. environment: {}
  51. when:
  52. - '"bionic" in os_release.stdout'
  53. - name: Restart systemd-resolved service
  54. raw: systemctl restart systemd-resolved
  55. become: true
  56. environment: {}
  57. when:
  58. - '"bionic" in os_release.stdout'
  59. - name: Install python
  60. raw:
  61. apt-get update && \
  62. DEBIAN_FRONTEND=noninteractive apt-get install -y python-minimal
  63. become: true
  64. environment: {}
  65. when:
  66. - need_bootstrap.rc != 0
  67. # Workaround for https://github.com/ansible/ansible/issues/25543
  68. - name: Install dbus for the hostname module
  69. package:
  70. name: dbus
  71. state: present
  72. become: true