main.yaml 1.8 KB

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