initialize_openshift_version.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. ---
  2. # NOTE: requires openshift_facts be run
  3. - name: Verify compatible yum/subscription-manager combination
  4. hosts: 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. # Consider the repoquery module for this work
  12. - name: Check for bad combinations of yum and subscription-manager
  13. command: >
  14. {{ repoquery_cmd }} --installed --qf '%{version}' "yum"
  15. register: yum_ver_test
  16. changed_when: false
  17. when: not openshift.common.is_atomic | bool
  18. - fail:
  19. msg: Incompatible versions of yum and subscription-manager found. You may need to update yum and yum-utils.
  20. 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
  21. - name: Determine openshift_version to configure on first master
  22. hosts: oo_first_master
  23. roles:
  24. - openshift_version
  25. # NOTE: We set this even on etcd hosts as they may also later run as masters,
  26. # and we don't want to install wrong version of docker and have to downgrade
  27. # later.
  28. - name: Set openshift_version for all hosts
  29. hosts: oo_all_hosts:!oo_first_master
  30. vars:
  31. openshift_version: "{{ hostvars[groups.oo_first_master.0].openshift_version }}"
  32. roles:
  33. - openshift_version