main.yaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ---
  2. # TODO: This needs to be removed and placed into a role
  3. - name: Ensure libselinux-python is installed
  4. package:
  5. name: libselinux-python
  6. 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 and rhsub_pass is defined) or (rhsub_ak is defined and rhsub_orgid is defined)
  37. - include_tasks: centos_repos.yml
  38. when:
  39. - ansible_os_family == "RedHat"
  40. - ansible_distribution != "Fedora"
  41. - openshift_deployment_type == 'origin'
  42. - openshift_enable_origin_repo | default(true) | bool
  43. - name: Ensure clean repo cache in the event repos have been changed manually
  44. debug:
  45. msg: "First run of openshift_repos"
  46. changed_when: true
  47. notify: refresh cache
  48. - name: Record that openshift_repos already ran
  49. set_fact:
  50. r_openshift_repos_has_run: True
  51. # Force running ALL handlers now, because we expect repo cache to be cleared
  52. # if changes have been made.
  53. - meta: flush_handlers