summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2016-05-20 15:14:28 -0300
committerDevan Goodwin <dgoodwin@redhat.com>2016-05-25 10:28:32 -0300
commitc45562e0e03e03c82bfcf60d4b3f8b7793133301 (patch)
tree5fe68e26ac01ebb58b30c0b116d213623f10a610 /roles
parentdcb7289d9cf28b155aebb3b4ab820db2033c1b35 (diff)
downloadopenshift-c45562e0e03e03c82bfcf60d4b3f8b7793133301.tar.gz
openshift-c45562e0e03e03c82bfcf60d4b3f8b7793133301.tar.bz2
openshift-c45562e0e03e03c82bfcf60d4b3f8b7793133301.tar.xz
openshift-c45562e0e03e03c82bfcf60d4b3f8b7793133301.zip
Set openshift_version in config playbooks for first master.
Starting to remove openshift.docker.openshift_version fact usage. openshift_version should no longer contain a leading 'v' for containerized installs, just a version number.
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_cli/defaults/main.yml1
-rw-r--r--roles/openshift_cli/tasks/main.yml5
-rw-r--r--roles/openshift_cli/templates/openshift.j24
-rw-r--r--roles/openshift_docker/tasks/main.yml2
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py12
-rw-r--r--roles/openshift_master/tasks/main.yml2
6 files changed, 10 insertions, 16 deletions
diff --git a/roles/openshift_cli/defaults/main.yml b/roles/openshift_cli/defaults/main.yml
index 7baa87ab8..ed97d539c 100644
--- a/roles/openshift_cli/defaults/main.yml
+++ b/roles/openshift_cli/defaults/main.yml
@@ -1,2 +1 @@
---
-openshift_version: "{{ openshift_image_tag | default(openshift.docker.openshift_image_tag | default('')) }}"
diff --git a/roles/openshift_cli/tasks/main.yml b/roles/openshift_cli/tasks/main.yml
index a2be95eac..95711f95d 100644
--- a/roles/openshift_cli/tasks/main.yml
+++ b/roles/openshift_cli/tasks/main.yml
@@ -1,9 +1,6 @@
---
- debug: var=openshift_version
-- debug: var=openshift_release
-- debug: var=openshift_image_tag
- debug: var=openshift.common
-- debug: var=openshift.docker
- name: Install clients
action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-clients state=present"
@@ -11,7 +8,7 @@
- name: Pull CLI Image
command: >
- docker pull {{ openshift.common.cli_image }}:{{ openshift_version }}
+ docker pull {{ openshift.common.cli_image }}:v{{ openshift_version }}
when: openshift.common.is_containerized | bool
- name: Create /usr/local/bin/openshift cli wrapper
diff --git a/roles/openshift_cli/templates/openshift.j2 b/roles/openshift_cli/templates/openshift.j2
index 437e08aab..501796b0b 100644
--- a/roles/openshift_cli/templates/openshift.j2
+++ b/roles/openshift_cli/templates/openshift.j2
@@ -5,14 +5,14 @@ fi
cmd=`basename $0`
user=`id -u`
group=`id -g`
-image_tag={{ openshift_version }}
+image_tag=v{{ openshift_version }}
>&2 echo """
================================================================================
ATTENTION: You are running ${cmd} via a wrapper around 'docker run {{ openshift.common.cli_image }}:${image_tag}'.
This wrapper is intended only to be used to bootstrap an environment. Please
install client tools on another host once you have granted cluster-admin
-privileges to a user.
+privileges to a user.
{% if openshift.common.deployment_type in ['openshift-enterprise','atomic-enterprise'] %}
See https://docs.openshift.com/enterprise/latest/cli_reference/get_started_cli.html
{% else %}
diff --git a/roles/openshift_docker/tasks/main.yml b/roles/openshift_docker/tasks/main.yml
index cff1c6bb4..79efb193b 100644
--- a/roles/openshift_docker/tasks/main.yml
+++ b/roles/openshift_docker/tasks/main.yml
@@ -17,6 +17,8 @@
register: cli_image_version
when: is_containerized | bool and openshift_image_tag is not defined and (upgrading | bool or not has_image_tag_fact | bool)
+- debug: var=cli_image_version
+
# Use the pre-existing image tag from system facts if present, and we're not upgrading.
# Ignores explicit openshift_image_tag if it's in the inventory, as this isn't an upgrade.
- set_fact:
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index b13343776..6127948bf 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -1133,15 +1133,9 @@ def get_openshift_version(facts):
if os.path.isfile('/usr/bin/openshift'):
_, output, _ = module.run_command(['/usr/bin/openshift', 'version'])
version = parse_openshift_version(output)
-
- # openshift_facts runs before openshift_docker_facts. However, it will be
- # called again and set properly throughout the playbook run. This could be
- # refactored to simply set the openshift.common.version in the
- # openshift_docker_facts role but it would take reworking some assumptions
- # on how get_openshift_version is called.
- if 'is_containerized' in facts['common'] and safe_get_bool(facts['common']['is_containerized']):
- if 'docker' in facts and 'openshift_version' in facts['docker']:
- version = facts['docker']['openshift_version']
+ elif os.path.isfile('/usr/local/bin/openshift'):
+ _, output, _ = module.run_command(['/usr/local/bin/openshift', 'version'])
+ version = parse_openshift_version(output)
return version
diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml
index 56ce0e396..0cbb49758 100644
--- a/roles/openshift_master/tasks/main.yml
+++ b/roles/openshift_master/tasks/main.yml
@@ -1,6 +1,8 @@
---
# TODO: add ability to configure certificates given either a local file to
# point to or certificate contents, set in default cert locations.
+- debug: var=openshift_version
+- fail:
# Authentication Variable Validation
# TODO: validate the different identity provider kinds as well