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.

90 lines
2.0 KiB

  1. ---
  2. - name: Check if atomic host
  3. stat:
  4. path: /run/ostree-booted
  5. register: ostree
  6. - set_fact:
  7. is_atomic: "{{ ostree.stat.exists }}"
  8. - name: Check presence of fastestmirror.conf
  9. stat:
  10. path: /etc/yum/pluginconf.d/fastestmirror.conf
  11. register: fastestmirror
  12. # fastestmirror plugin actually slows down Ansible deployments
  13. - name: Disable fastestmirror plugin
  14. lineinfile:
  15. dest: /etc/yum/pluginconf.d/fastestmirror.conf
  16. regexp: "^enabled=.*"
  17. line: "enabled=0"
  18. state: present
  19. become: true
  20. when: fastestmirror.stat.exists
  21. - name: Add proxy to /etc/yum.conf if http_proxy is defined
  22. lineinfile:
  23. path: "/etc/yum.conf"
  24. line: "proxy={{ http_proxy }}"
  25. create: yes
  26. state: present
  27. become: true
  28. when: http_proxy is defined
  29. - name: Install libselinux-python and yum-utils for bootstrap
  30. yum:
  31. name:
  32. - libselinux-python
  33. - yum-utils
  34. state: present
  35. become: true
  36. when:
  37. - not is_atomic
  38. - name: Check python-pip package
  39. yum:
  40. list=python-pip
  41. register: package_python_pip
  42. when:
  43. - not is_atomic
  44. - name: Install epel-release for bootstrap
  45. yum:
  46. name: epel-release
  47. state: present
  48. become: true
  49. when:
  50. - epel_enabled
  51. - not is_atomic
  52. - package_python_pip.results | length != 0
  53. - name: check python-httplib2 package
  54. yum:
  55. list: "python-httplib2"
  56. register: package_python_httplib2
  57. when:
  58. - not is_atomic
  59. - name: Configure extras repository if python-httplib2 not avaiable in current repos
  60. yum_repository:
  61. name: extras
  62. description: "CentOS-7 - Extras"
  63. state: present
  64. baseurl: "{{ extras_rh_repo_base_url }}"
  65. file: "extras"
  66. gpgcheck: yes
  67. gpgkey: "{{extras_rh_repo_gpgkey}}"
  68. keepcache: "{{ extras_rh_rpm_keepcache | default('1') }}"
  69. proxy: " {{ http_proxy | default('_none_') }}"
  70. when:
  71. - not is_atomic
  72. - package_python_httplib2.results | length == 0
  73. - name: Install pip for bootstrap
  74. yum:
  75. name: python-pip
  76. state: present
  77. become: true
  78. when:
  79. - not is_atomic
  80. - package_python_pip.results | length != 0