rpm_upgrade.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ---
  2. # When we update package "a-${version}" and a requires b >= ${version} if we
  3. # don't specify the version of b yum will choose the latest version of b
  4. # available and the whole set of dependencies end up at the latest version.
  5. # Since the package module, unlike the yum module, doesn't flatten a list
  6. # of packages into one transaction we need to do that explicitly. The ansible
  7. # core team tells us not to rely on yum module transaction flattening anyway.
  8. # TODO: If the sdn package isn't already installed this will install it, we
  9. # should fix that
  10. - name: Upgrade master packages - yum
  11. command:
  12. yum install -y {{ master_pkgs | join(' ') }} \
  13. {{ ' --exclude *' ~ openshift_service_type ~ '*3.9*' if openshift_upgrade_target | version_compare('3.9','<') else '' }}
  14. vars:
  15. master_pkgs:
  16. - "{{ openshift_service_type }}{{ openshift_pkg_version | default('') }}"
  17. - "{{ openshift_service_type }}-master{{ openshift_pkg_version | default('') }}"
  18. - "{{ openshift_service_type }}-node{{ openshift_pkg_version | default('') }}"
  19. - "{{ openshift_service_type }}-clients{{ openshift_pkg_version | default('') }}"
  20. register: result
  21. until: result is succeeded
  22. when: ansible_pkg_mgr == 'yum'
  23. - name: Upgrade master packages - dnf
  24. dnf:
  25. name: "{{ master_pkgs | join(',') }}"
  26. state: present
  27. vars:
  28. master_pkgs:
  29. - "{{ openshift_service_type }}{{ openshift_pkg_version }}"
  30. - "{{ openshift_service_type }}-master{{ openshift_pkg_version }}"
  31. - "{{ openshift_service_type }}-node{{ openshift_pkg_version }}"
  32. - "{{ openshift_service_type }}-clients{{ openshift_pkg_version }}"
  33. register: result
  34. until: result is succeeded
  35. when: ansible_pkg_mgr == 'dnf'