main.yaml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. # Note: OpenShift repositories under CentOS may be shipped through the
  30. # "centos-release-openshift-origin" package which configures the repository.
  31. # This task matches the file names provided by the package so that they are
  32. # not installed twice in different files and remains idempotent.
  33. - name: Configure origin repositories and gpg keys if needed
  34. copy:
  35. src: "{{ item.src }}"
  36. dest: "{{ item.dest }}"
  37. with_items:
  38. - src: origin/gpg_keys/openshift-ansible-CentOS-SIG-PaaS
  39. dest: /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-PaaS
  40. - src: origin/repos/openshift-ansible-centos-paas-sig.repo
  41. dest: /etc/yum.repos.d/CentOS-OpenShift-Origin.repo
  42. notify: refresh cache
  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: Enable centos-openshift-origin-testing repository
  49. command: yum-config-manager --enable centos-openshift-origin-testing
  50. when: openshift_repos_enable_testing | bool
  51. - name: Ensure clean repo cache in the event repos have been changed manually
  52. debug:
  53. msg: "First run of openshift_repos"
  54. changed_when: true
  55. notify: refresh cache
  56. - name: Record that openshift_repos already ran
  57. set_fact:
  58. r_openshift_repos_has_run: True
  59. # Force running ALL handlers now, because we expect repo cache to be cleared
  60. # if changes have been made.
  61. - meta: flush_handlers