summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2016-05-26 14:30:37 -0300
committerDevan Goodwin <dgoodwin@redhat.com>2016-05-26 14:30:37 -0300
commit14b23a8b14636407143375cbac71b090663cee77 (patch)
treed81974e9cd0d4e2a2cef4b2bfef697835a0179aa
parentc45ccc0ee879e93a4fd4304b4848595fa27014c5 (diff)
downloadopenshift-14b23a8b14636407143375cbac71b090663cee77.tar.gz
openshift-14b23a8b14636407143375cbac71b090663cee77.tar.bz2
openshift-14b23a8b14636407143375cbac71b090663cee77.tar.xz
openshift-14b23a8b14636407143375cbac71b090663cee77.zip
Get rpm installations functional again.
-rw-r--r--filter_plugins/oo_filters.py6
-rw-r--r--playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml2
-rw-r--r--playbooks/common/openshift-master/config.yml14
-rw-r--r--roles/openshift_common/meta/main.yml2
-rw-r--r--roles/openshift_common/tasks/main.yml11
-rw-r--r--roles/openshift_docker/tasks/main.yml28
-rw-r--r--roles/openshift_master_ca/tasks/main.yml5
7 files changed, 45 insertions, 23 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
index e7409bf22..554ef440f 100644
--- a/filter_plugins/oo_filters.py
+++ b/filter_plugins/oo_filters.py
@@ -885,11 +885,11 @@ class FilterModule(object):
# TODO: Do we need to make this actually convert v1.2.0-rc1 into 1.2.0-0.rc1
# We'd need to be really strict about how we build the RPM Version+Release
if version.startswith("v"):
- version = version.replace("v", "")
+ version = version[1:]
version = version.split('-')[0]
- if include_dash:
- version = "-" + version
+ if include_dash and not version.startswith("-"):
+ version = "-" + version
return version
diff --git a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml
index dd9843290..84b7c817b 100644
--- a/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml
+++ b/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/pre.yml
@@ -125,6 +125,8 @@
register: g_rpm_versions_result
when: not openshift.common.is_containerized | bool
+ - debug: var=g_rpm_versions_result
+
- set_fact:
g_aos_versions: "{{ g_rpm_versions_result.stdout | from_yaml }}"
when: not openshift.common.is_containerized | bool
diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml
index 97a7db9a1..063d86f60 100644
--- a/playbooks/common/openshift-master/config.yml
+++ b/playbooks/common/openshift-master/config.yml
@@ -158,7 +158,6 @@
# Must be run before generating master certs which involved openshift_cli role and needs
# to pull down the correct docker container:
-# TODO: Handle rpm installs here
- name: Determine openshift_version to install on first master
hosts: oo_first_master
any_errors_fatal: true
@@ -170,14 +169,21 @@
set_fact:
openshift_version: "{{ openshift_release }}"
when: openshift.common.is_containerized | bool and openshift_release is defined
- - name: Determine version to configure if containerized and image tag specified
+# TODO: what should we do for rpm installs and openshift_release here?
+ - name: Determine container version to configure when openshift_image_tag specified
set_fact:
openshift_version: "{{ openshift_image_tag.split('v',1)[1] }}"
when: openshift.common.is_containerized | bool and openshift_image_tag is defined
- - name: Determine version to configure if already installed
+ - name: Determine rpm version to configure when openshift_pkg_version specified
+ set_fact:
+ # Expects a leading "-" in inventory, strip it off here, and ignore a trailing release,
+ # openshift_version should always just be "3.2" or "3.2.0.44"
+ openshift_version: "{{ openshift_pkg_version[1:].split('-')[0] }}"
+ when: not openshift.common.is_containerized | bool and openshift_pkg_version is defined
+ - name: Use openshift.common.version fact as version to configure if already installed
set_fact:
openshift_version: "{{ openshift.common.version }}"
- when: openshift.common.is_containerized | bool and openshift.common.version is defined
+ when: openshift.common.version is defined
- debug: var=openshift_version
- name: Determine if master certificates need to be generated
diff --git a/roles/openshift_common/meta/main.yml b/roles/openshift_common/meta/main.yml
index f1cf3e161..d3f8a343f 100644
--- a/roles/openshift_common/meta/main.yml
+++ b/roles/openshift_common/meta/main.yml
@@ -13,4 +13,4 @@ galaxy_info:
- cloud
dependencies:
- role: openshift_facts
-- role: openshift_repos
+- role: openshift_docker
diff --git a/roles/openshift_common/tasks/main.yml b/roles/openshift_common/tasks/main.yml
index 4ec255dbc..d548daae6 100644
--- a/roles/openshift_common/tasks/main.yml
+++ b/roles/openshift_common/tasks/main.yml
@@ -29,17 +29,6 @@
data_dir: "{{ openshift_data_dir | default(None) }}"
use_dnsmasq: "{{ openshift_use_dnsmasq | default(None) }}"
-# Using oo_image_tag_to_rpm_version here is a workaround for how
-# openshift_version is set. That value is computed based on either RPM
-# versions or image tags. openshift_common's usage requires that it be a RPM
-# version and openshift_cli expects it to be an image tag.
-- name: Install the base package for versioning
- action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }} state=present"
- when: not openshift.common.is_containerized | bool
-
-- name: Set version facts
- openshift_facts:
-
# For enterprise versions < 3.1 and origin versions < 1.1 we want to set the
# hostname by default.
- set_fact:
diff --git a/roles/openshift_docker/tasks/main.yml b/roles/openshift_docker/tasks/main.yml
index 1791d20c0..c7b8f504a 100644
--- a/roles/openshift_docker/tasks/main.yml
+++ b/roles/openshift_docker/tasks/main.yml
@@ -2,12 +2,34 @@
# It's important that we don't explicitly pull this image here. Otherwise we
# could result in upgrading a preinstalled environment. We'll have to set
# openshift_image_tag correctly for upgrades.
+
+# Determine openshift_version if none is set for this host, or if a generic "3.2"
+# is set, determine the more specific version number by either installing the latest
+# rpm, or pulling the v3.2 container and checking the resulting versions.
+
- set_fact:
is_containerized: "{{ openshift.common.is_containerized | default(False) | bool }}"
-# If no openshift_version provided, figure out what to use:
-# TODO: May want to move this to another role.
-- name: Lookup latest OpenShift version if none specified
+- debug: var=openshift_version
+
+# RPM openshift_version setup:
+- debug: msg="{{ openshift_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }}"
+- name: Lookup latest OpenShift rpm version if none specified
+ action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }} state=present"
+ when: not is_containerized | bool and openshift_version is not defined
+
+- name: Reload facts to pick up version
+ openshift_facts:
+ when: not is_containerized | bool and openshift_version is not defined
+
+- set_fact:
+ openshift_version: "{{ openshift.common.version }}"
+ when: not is_containerized | bool and openshift_version is not defined
+
+# TODO: What to do if openshift_version = 3.2 for rpm based installs?
+
+# Containerized openshift_version setup:
+- name: Lookup latest containerized OpenShift version if none specified
command: >
docker run --rm {{ openshift.common.cli_image }}:latest version
register: cli_image_version
diff --git a/roles/openshift_master_ca/tasks/main.yml b/roles/openshift_master_ca/tasks/main.yml
index 4b7ef1d84..613aecc38 100644
--- a/roles/openshift_master_ca/tasks/main.yml
+++ b/roles/openshift_master_ca/tasks/main.yml
@@ -1,6 +1,9 @@
---
+
+- debug: msg="{{ openshift_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }}"
+
- name: Install the base package for admin tooling
- action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version }} state=present"
+ action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }} state=present"
when: not openshift.common.is_containerized | bool
register: install_result