upgrade_predicates.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. # Handle case where openshift_master_predicates is defined
  3. - when: openshift_master_scheduler_predicates | default(none) is not none
  4. block:
  5. - name: openshift_master_scheduler_predicates is defined
  6. debug:
  7. msg: "openshift_master_scheduler_predicates is defined"
  8. - name: openshift_master_scheduler_predicates is set to defaults from an earlier release
  9. debug:
  10. msg: "WARNING: openshift_master_scheduler_predicates is set to defaults from an earlier release of OpenShift current defaults are: {{ openshift_master_scheduler_default_predicates }}"
  11. when: openshift_master_scheduler_predicates in osm_older_predicates + osm_older_predicates_no_region + [osm_prev_predicates] + [osm_prev_predicates_no_region]
  12. - name: openshift_master_scheduler_predicates does not match current defaults
  13. debug:
  14. msg: "WARNING: openshift_master_scheduler_predicates does not match current defaults of: {{ openshift_master_scheduler_default_predicates }}"
  15. when: openshift_master_scheduler_predicates != openshift_master_scheduler_default_predicates
  16. # Handle cases where openshift_master_predicates is not defined
  17. - when: openshift_master_scheduler_predicates | default(none) is none
  18. block:
  19. - name: openshift_master_scheduler_predicates is not defined
  20. debug:
  21. msg: "openshift_master_scheduler_predicates is not defined"
  22. - name: existing scheduler config does not match previous known defaults
  23. debug:
  24. msg: "WARNING: existing scheduler config does not match previous known defaults automated upgrade of scheduler config is disabled.\nexisting scheduler predicates: {{ openshift_master_scheduler_current_predicates }}\ncurrent scheduler default predicates are: {{ openshift_master_scheduler_default_predicates }}"
  25. when:
  26. - openshift_master_scheduler_current_predicates != openshift_master_scheduler_default_predicates
  27. - openshift_master_scheduler_current_predicates not in osm_older_predicates + [osm_prev_predicates]
  28. - name: set_fact openshift_upgrade_scheduler_predicates 1
  29. set_fact:
  30. openshift_upgrade_scheduler_predicates: "{{ openshift_master_scheduler_default_predicates }}"
  31. when:
  32. - openshift_master_scheduler_current_predicates != openshift_master_scheduler_default_predicates
  33. - openshift_master_scheduler_current_predicates in osm_older_predicates + [osm_prev_predicates]
  34. - name: set_fact openshift_upgrade_scheduler_predicates 2
  35. set_fact:
  36. openshift_upgrade_scheduler_predicates: "{{ osm_default_predicates_no_region }}"
  37. when:
  38. - openshift_master_scheduler_current_predicates != osm_default_predicates_no_region
  39. - openshift_master_scheduler_current_predicates in osm_older_predicates_no_region + [osm_prev_predicates_no_region]