initialize_openshift_version.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ---
  2. # NOTE: requires openshift_facts be run
  3. - name: Verify compatible yum/subscription-manager combination
  4. hosts: l_oo_all_hosts
  5. gather_facts: no
  6. tasks:
  7. # See:
  8. # https://bugzilla.redhat.com/show_bug.cgi?id=1395047
  9. # https://bugzilla.redhat.com/show_bug.cgi?id=1282961
  10. # https://github.com/openshift/openshift-ansible/issues/1138
  11. - name: Check for bad combinations of yum and subscription-manager
  12. command: >
  13. {{ repoquery_cmd }} --installed --qf '%{version}' "yum"
  14. register: yum_ver_test
  15. changed_when: false
  16. when: not openshift.common.is_atomic | bool
  17. - fail:
  18. msg: Incompatible versions of yum and subscription-manager found. You may need to update yum and yum-utils.
  19. when: "not openshift.common.is_atomic | bool and 'Plugin \"search-disabled-repos\" requires API 2.7. Supported API is 2.6.' in yum_ver_test.stdout"
  20. # TODO(jchaloup): find a different way how to make repoquery --qf '%version` atomic-openshift work without disabling the excluders
  21. - include: disable_excluder.yml
  22. vars:
  23. # the excluders needs to be disabled no matter what status says
  24. with_status_check: false
  25. # Only openshift excluder needs to be temporarily disabled
  26. # So ignore the docker one
  27. enable_docker_excluder: false
  28. tags:
  29. - always
  30. when: openshift_upgrade_target is not defined
  31. - name: Determine openshift_version to configure on first master
  32. hosts: oo_first_master
  33. roles:
  34. - openshift_version
  35. # NOTE: We set this even on etcd hosts as they may also later run as masters,
  36. # and we don't want to install wrong version of docker and have to downgrade
  37. # later.
  38. - name: Set openshift_version for all hosts
  39. hosts: oo_all_hosts:!oo_first_master
  40. vars:
  41. openshift_version: "{{ hostvars[groups.oo_first_master.0].openshift_version }}"
  42. roles:
  43. - openshift_version
  44. # Re-enable excluders if they are meant to be enabled (and only during installation, upgrade disables the excluders before this play)
  45. - include: reset_excluder.yml
  46. vars:
  47. # Only openshift excluder needs to be re-enabled
  48. # So ignore the docker one
  49. enable_docker_excluder: false
  50. tags:
  51. - always
  52. when: openshift_upgrade_target is not defined