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.

45 lines
1.2 KiB

  1. ---
  2. # Some Fedora 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. environment: {}
  9. tags:
  10. - facts
  11. - name: Check if a proxy is set in /etc/dnf/dnf.conf
  12. raw: grep -qs 'proxy=' /etc/dnf/dnf.conf
  13. register: need_http_proxy
  14. failed_when: false
  15. changed_when: false
  16. # This command should always run, even in check mode
  17. check_mode: false
  18. environment: {}
  19. when:
  20. - http_proxy is defined
  21. - name: Add http_proxy to /etc/dnf/dnf.conf if http_proxy is defined
  22. raw: echo 'proxy={{ http_proxy }}' >> /etc/dnf/dnf.conf
  23. become: true
  24. environment: {}
  25. when:
  26. - http_proxy is defined
  27. - need_http_proxy.rc != 0
  28. - name: Install python3 on fedora
  29. raw: "dnf install --assumeyes --quiet python3"
  30. become: true
  31. environment: {}
  32. when:
  33. - need_bootstrap.rc != 0
  34. # libselinux-python3 is required on SELinux enabled hosts
  35. # See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements
  36. - name: Install libselinux-python3
  37. package:
  38. name: libselinux-python3
  39. state: present
  40. become: true