main.yaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. - name: Remove openshift_additional.repo file
  12. file:
  13. dest: /etc/yum.repos.d/openshift_additional.repo
  14. state: absent
  15. - name: Create any additional repos that are defined
  16. yum_repository:
  17. description: "{{ item.description | default(item.name | default(item.id)) }}"
  18. name: "{{ item.name | default(item.id) }}"
  19. baseurl: "{{ item.baseurl }}"
  20. gpgkey: "{{ item.gpgkey | default(omit)}}"
  21. gpgcheck: "{{ item.gpgcheck | default(1) }}"
  22. sslverify: "{{ item.sslverify | default(1) }}"
  23. sslclientkey: "{{ item.sslclientkey | default(omit) }}"
  24. sslclientcert: "{{ item.sslclientcert | default(omit) }}"
  25. file: "{{ item.name }}"
  26. enabled: "{{ item.enabled | default('no')}}"
  27. with_items: "{{ openshift_additional_repos }}"
  28. when: openshift_additional_repos | length > 0
  29. notify: refresh cache
  30. # Singleton block
  31. - when: r_openshift_repos_has_run is not defined
  32. block:
  33. - include_tasks: centos_repos.yml
  34. when:
  35. - ansible_os_family == "RedHat"
  36. - ansible_distribution != "Fedora"
  37. - openshift_deployment_type == 'origin'
  38. - openshift_enable_origin_repo | default(true) | bool
  39. - name: Ensure clean repo cache in the event repos have been changed manually
  40. debug:
  41. msg: "First run of openshift_repos"
  42. changed_when: true
  43. notify: refresh cache
  44. - name: Record that openshift_repos already ran
  45. set_fact:
  46. r_openshift_repos_has_run: True
  47. # Force running ALL handlers now, because we expect repo cache to be cleared
  48. # if changes have been made.
  49. - meta: flush_handlers