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.

48 lines
1.2 KiB

  1. ---
  2. # CentOS ships with python installed
  3. - name: Check if this is an atomic host
  4. stat:
  5. path: /run/ostree-booted
  6. register: ostree
  7. - name: Store the fact if this is an atomic host
  8. set_fact:
  9. is_atomic: "{{ ostree.stat.exists }}"
  10. - name: Check presence of fastestmirror.conf
  11. stat:
  12. path: /etc/yum/pluginconf.d/fastestmirror.conf
  13. register: fastestmirror
  14. # the fastestmirror plugin can actually slow down Ansible deployments
  15. - name: Disable fastestmirror plugin if requested
  16. lineinfile:
  17. dest: /etc/yum/pluginconf.d/fastestmirror.conf
  18. regexp: "^enabled=.*"
  19. line: "enabled=0"
  20. state: present
  21. become: true
  22. when:
  23. - fastestmirror.stat.exists
  24. - not centos_fastestmirror_enabled
  25. - name: Add proxy to /etc/yum.conf if http_proxy is defined
  26. lineinfile:
  27. path: "/etc/yum.conf"
  28. line: "proxy={{ http_proxy }}"
  29. create: true
  30. state: present
  31. become: true
  32. when:
  33. - http_proxy is defined
  34. # libselinux-python 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-python
  37. package:
  38. name: libselinux-python
  39. state: present
  40. become: true
  41. when:
  42. - not is_atomic