verify_excluder.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. ---
  2. # input variables:
  3. # - excluder
  4. - name: Get available excluder version
  5. repoquery:
  6. name: "{{ excluder }}{{ '-' ~ r_openshift_excluder_upgrade_target.split('.')[0:2] | join('.') ~ '*' if r_openshift_excluder_upgrade_target is defined else '' }}"
  7. ignore_excluders: true
  8. register: repoquery_out
  9. - name: Fail when excluder package is not found
  10. fail:
  11. msg: "Package {{ excluder }} not found"
  12. when: not repoquery_out.results.package_found
  13. - name: Set fact excluder_version
  14. set_fact:
  15. excluder_version: "{{ repoquery_out.results.versions.available_versions.0 }}"
  16. - name: "{{ excluder }} version detected"
  17. debug:
  18. msg: "{{ excluder }}: {{ excluder_version }}"
  19. - name: Printing upgrade target version
  20. debug:
  21. msg: "{{ r_openshift_excluder_upgrade_target }}"
  22. - name: Check the available {{ excluder }} version is at most of the upgrade target version
  23. fail:
  24. msg: "Available {{ excluder }} version {{ excluder_version }} is higher than the upgrade target version"
  25. when:
  26. - excluder_version != ''
  27. - excluder_version.split('.')[0:2] | join('.') is version(r_openshift_excluder_upgrade_target.split('.')[0:2] | join('.'), '>', strict=True)