Browse Source

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.
Tomas Sedovic 7 years ago
parent
commit
be5ef95fbb
1 changed files with 7 additions and 1 deletions
  1. 7 1
      roles/rhel_subscribe/tasks/enterprise.yml

+ 7 - 1
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