Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Release of kubevirt will now have a j2 template so we should always u…
Browse files Browse the repository at this point in the history
…se it (#316)

(cherry picked from commit 61500fc)
  • Loading branch information
Ryan Hallisey authored Jul 6, 2018
1 parent 216fea4 commit 288439d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions roles/kubevirt/tasks/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
path: "{{ kubevirt_template_dir }}/kubevirt.yaml.j2"
register: byo_template

- name: Check for offline v{{ version }} templates in {{ offline_template_dir }}
- name: Check for kubevirt.yaml.j2 version v{{ version }} in {{ offline_template_dir }}
stat:
path: "{{ offline_template_dir }}/v{{ version }}/kubevirt.yaml"
path: "{{ offline_template_dir }}/v{{ version }}/kubevirt.yaml.j2"
register: offline_templates
when: byo_template.stat.exists == False

Expand All @@ -39,11 +39,11 @@
dest: "{{ kubevirt_template_dir }}/kubevirt.yaml.j2"
when: byo_template.stat.exists == False and offline_templates.stat.exists == False

- name: Copy offline templates to /tmp
copy:
src: "{{ offline_template_dir }}/v{{ version }}/kubevirt.yaml"
- name: Render offline template
template:
src: "{{ offline_template_dir }}/v{{ version }}/kubevirt.yaml.j2"
dest: "/tmp/kubevirt.yaml"
when: offline_templates.changed and offline_templates.stat.exists == True
when: offline_templates.stat.exists == True

- name: Render KubeVirt Yaml
template:
Expand Down Expand Up @@ -85,12 +85,12 @@
- name: Set the default VM templates URL
set_fact:
templates_url: "https://raw.githubusercontent.com/kubevirt/kubevirt/v{{ version }}/cluster/examples"
when: version[2] | int > 6
when: "{{ '0.6.0' is version(version, '<') }}"

- name: Set the default VM templates URL
set_fact:
templates_url: "https://raw.githubusercontent.com/kubevirt/kubevirt/v{{ version }}/cluster"
when: version[2] | int < 7
when: "{{ '0.6.0' is version(version, '>=') }}"

- name: Download KubeVirt default VM templates
get_url:
Expand Down

0 comments on commit 288439d

Please sign in to comment.