blob: 9ff13d35c8c49a927eec700c6682c99dc1237785 (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
---
# Determine the openshift_version to configure if none has been specified or set previously.
# Block attempts to install origin without specifying some kind of version information.
# This is because the latest tags for origin are usually alpha builds, which should not
# be used by default. Users must indicate what they want.
- fail:
msg: "Must specify openshift_release, openshift_image_tag, or openshift_pkg_version in inventory to install origin. (suggestion: add openshift_release=\"1.2\" to inventory)"
when: openshift.common.deployment_type == 'origin' and openshift_release is not defined and openshift_pkg_version is not defined and openshift_image_tag is not defined
- set_fact:
is_containerized: "{{ openshift.common.is_containerized | default(False) | bool }}"
# Make sure we copy this to a fact if given a var:
- set_fact:
openshift_version: "{{ openshift_version }}"
when: openshift_version is defined
# Protect the installed version by default unless explicitly told not to, or given an
# openshift_version already.
- name: Use openshift.common.version fact as version to configure if already installed
set_fact:
openshift_version: "{{ openshift.common.version }}"
when: openshift.common.version is defined and openshift_version is not defined and openshift_protect_installed_version
- debug: var=is_containerized
- debug: var=openshift_version
- debug: msg="{{ openshift_version is defined }}"
- debug: var=openshift_release
- debug: var=openshift_pkg_version
- debug: var=openshift_image_tag
- debug: var=openshift.common.version
- name: Set openshift_version for rpm installation
include: set_version_rpm.yml
when: not is_containerized | bool
- name: Set openshift_version for containerized installation
include: set_version_containerized.yml
when: is_containerized | bool
# At this point we know openshift_version is set appropriately. Now we set
# openshift_image_tag and openshift_pkg_version, so all roles can always assume
# each of this variables *will* be set correctly and can use them per their
# intended purpose.
- set_fact:
openshift_image_tag: v{{ openshift_version }}
when: openshift_image_tag is not defined
- set_fact:
openshift_pkg_version: -{{ openshift_version }}
when: openshift_pkg_version is not defined
- debug: var=openshift_version
- debug: var=openshift_pkg_version
- debug: var=openshift_image_tag
- fail: openshift_version role was unable to set openshift_version
when: openshift_version is not defined
- fail: openshift_version role was unable to set openshift_image_tag
when: openshift_image_tag is not defined
- fail: openshift_version role was unable to set openshift_pkg_version
when: openshift_pkg_version is not defined
|