From be5ef95fbb204470887887bf849a01e90b3d6d29 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Tue, 5 Dec 2017 15:45:45 +0100 Subject: 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. --- roles/rhel_subscribe/tasks/enterprise.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'roles/rhel_subscribe/tasks') 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 -- cgit v1.2.3