summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-cluster/upgrades/pre/validate_excluder.yml
blob: 6de1ed06170e348a3b7864a65795b387add1522c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
# input variables:
# - repoquery_cmd
# - excluder
# - openshift_upgrade_target
- block:
  - name: Get available excluder version
    command: >
      {{ repoquery_cmd }} --qf '%{version}' "{{ excluder }}"
    register: excluder_version
    failed_when: false
    changed_when: false

  - name: Docker excluder version detected
    debug:
      msg: "{{ excluder }}: {{ excluder_version.stdout }}"

  - name: Printing upgrade target version
    debug:
      msg: "{{ openshift_upgrade_target }}"

  - name: Check the available {{ excluder }} version is at most of the upgrade target version
    fail:
      msg: "Available {{ excluder }} version {{ excluder_version.stdout }} is higher than the upgrade target version"
    when:
    - "{{ excluder_version.stdout != '' }}"
    - "{{ excluder_version.stdout.split('.')[0:2] | join('.') | version_compare(openshift_upgrade_target.split('.')[0:2] | join('.'), '>', strict=True) }}"
  when:
  - not openshift.common.is_atomic | bool