summaryrefslogtreecommitdiffstats
path: root/roles/openshift_logging_elasticsearch/tasks/determine_version.yaml
blob: 1a952b5cf92057f96b49afd6078a438ea2b35259 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
# debating making this a module instead?
- fail:
    msg: Missing version to install provided by 'openshift_logging_image_version'
  when: not openshift_logging_image_version or openshift_logging_image_version == ''

- set_fact:
    es_version: "{{ __latest_es_version }}"
  when: openshift_logging_image_version == 'latest'

- debug: var=openshift_logging_image_version

# should we just assume that we will have the correct major version?
- set_fact: es_version="{{ openshift_logging_image_version | regex_replace('^v?(?P<major>\d)\.(?P<minor>\d).*$', '3_\\g<minor>') }}"
  when: openshift_logging_image_version != 'latest'

- fail:
    msg: Invalid version specified for Elasticsearch
  when: es_version not in __allowed_es_versions