rpm_upgrade.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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_release | 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 }}-sdn-ovs{{ openshift_pkg_version | default('') }}"
  20. - "{{ openshift_service_type }}-clients{{ openshift_pkg_version | default('') }}"
  21. register: result
  22. until: result is succeeded
  23. when: ansible_pkg_mgr == 'yum'
  24. - name: Upgrade master packages - dnf
  25. dnf:
  26. name: "{{ master_pkgs | join(',') }}"
  27. state: present
  28. vars:
  29. master_pkgs:
  30. - "{{ openshift_service_type }}{{ openshift_pkg_version }}"
  31. - "{{ openshift_service_type }}-master{{ openshift_pkg_version }}"
  32. - "{{ openshift_service_type }}-node{{ openshift_pkg_version }}"
  33. - "{{ openshift_service_type }}-sdn-ovs{{ openshift_pkg_version }}"
  34. - "{{ openshift_service_type }}-clients{{ openshift_pkg_version }}"
  35. register: result
  36. until: result is succeeded
  37. when: ansible_pkg_mgr == 'dnf'