summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Sedovic <tomas@sedovic.cz>2017-12-05 15:45:45 +0100
committerTomas Sedovic <tomas@sedovic.cz>2017-12-05 19:31:38 +0100
commitbe5ef95fbb204470887887bf849a01e90b3d6d29 (patch)
tree7534696ec7b7905b1596fa6c3a2c4ec15f71e7e4
parent01fc87d824ea5bc96f29abee3aa27bb027f8bf5f (diff)
downloadopenshift-be5ef95fbb204470887887bf849a01e90b3d6d29.tar.gz
openshift-be5ef95fbb204470887887bf849a01e90b3d6d29.tar.bz2
openshift-be5ef95fbb204470887887bf849a01e90b3d6d29.tar.xz
openshift-be5ef95fbb204470887887bf849a01e90b3d6d29.zip
Get the correct value out of openshift_release
The `openshift_release` contents can come in the form of `v3.6.0` which we need to turn to `3.6` to get the right repo name.
-rw-r--r--roles/rhel_subscribe/tasks/enterprise.yml8
1 files changed, 7 insertions, 1 deletions
diff --git a/roles/rhel_subscribe/tasks/enterprise.yml b/roles/rhel_subscribe/tasks/enterprise.yml
index 48b04b209..8acdfb969 100644
--- a/roles/rhel_subscribe/tasks/enterprise.yml
+++ b/roles/rhel_subscribe/tasks/enterprise.yml
@@ -1,4 +1,10 @@
---
+- set_fact:
+ openshift_release: "{{ openshift_release[1:] }}"
+ when:
+ - openshift_release is defined
+ - openshift_release[0] == 'v'
+
- name: Disable all repositories
command: subscription-manager repos --disable="*"
@@ -6,7 +12,7 @@
command: subscription-manager repos \
--enable="rhel-7-server-rpms" \
--enable="rhel-7-server-extras-rpms" \
- --enable="rhel-7-server-ose-{{ openshift_release }}-rpms" \
+ --enable="rhel-7-server-ose-{{ (openshift_release | default('')).split('.')[0:2] | join('.') }}-rpms" \
--enable="rhel-7-fast-datapath-rpms"
register: subscribe_repos
until: subscribe_repos | succeeded