main.yaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. - when: not openshift_is_atomic
  3. block:
  4. # TODO: This needs to be removed and placed into a role
  5. - name: Ensure libselinux-python is installed
  6. package: name=libselinux-python state=present
  7. register: result
  8. until: result is succeeded
  9. - name: Remove openshift_additional.repo file
  10. file:
  11. dest: /etc/yum.repos.d/openshift_additional.repo
  12. state: absent
  13. - name: Create any additional repos that are defined
  14. yum_repository:
  15. description: "{{ item.description | default(item.name | default(item.id)) }}"
  16. name: "{{ item.name | default(item.id) }}"
  17. baseurl: "{{ item.baseurl }}"
  18. gpgkey: "{{ item.gpgkey | default(omit)}}"
  19. gpgcheck: "{{ item.gpgcheck | default(1) }}"
  20. sslverify: "{{ item.sslverify | default(1) }}"
  21. sslclientkey: "{{ item.sslclientkey | default(omit) }}"
  22. sslclientcert: "{{ item.sslclientcert | default(omit) }}"
  23. sslcacert: "{{ item.sslcacert | default(omit) }}"
  24. file: "{{ item.name }}"
  25. enabled: "{{ item.enabled | default('no')}}"
  26. with_items: "{{ openshift_additional_repos }}"
  27. when: openshift_additional_repos | length > 0
  28. notify: refresh cache
  29. # Singleton block
  30. - when: r_openshift_repos_has_run is not defined
  31. block:
  32. - include_tasks: rhel_repos.yml
  33. when:
  34. - ansible_distribution == 'RedHat'
  35. - openshift_deployment_type == 'openshift-enterprise'
  36. - rhsub_user is defined
  37. - rhsub_pass is defined
  38. - include_tasks: centos_repos.yml
  39. when:
  40. - ansible_os_family == "RedHat"
  41. - ansible_distribution != "Fedora"
  42. - openshift_deployment_type == 'origin'
  43. - openshift_enable_origin_repo | default(true) | bool
  44. - name: Ensure clean repo cache in the event repos have been changed manually
  45. debug:
  46. msg: "First run of openshift_repos"
  47. changed_when: true
  48. notify: refresh cache
  49. - name: Record that openshift_repos already ran
  50. set_fact:
  51. r_openshift_repos_has_run: True
  52. # Force running ALL handlers now, because we expect repo cache to be cleared
  53. # if changes have been made.
  54. - meta: flush_handlers