main.yaml 2.2 KB

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