1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +01:00

ovirt: update of upi playbook files (guaranteed memory added,

ovirt.ovirt collection role updated and check for template added)
This commit is contained in:
Guilherme De Oliveira Santos
2021-07-22 12:01:49 +02:00
parent b4ee16ee5f
commit a7a2d5b9cf
2 changed files with 52 additions and 45 deletions

View File

@@ -6,28 +6,6 @@
tasks:
- import_tasks: common-auth.yml
- name: Check local image existance
stat:
get_mime: no
get_checksum: no
get_attributes: no
path: "{{ rhcos.local_image_path }}"
register: image_stats
loop:
- "{{ rhcos.local_cmp_image_path }}"
- "{{ rhcos.local_image_path }}"
- name: Download RHCOS image
get_url:
url: "{{ rhcos.image_url }}"
dest: "{{ rhcos.local_cmp_image_path}}"
force: no
when: not image_stats.results[1].stat.exists
- name: Extract RHCOS image
shell: "gunzip -c {{ rhcos.local_cmp_image_path }} > {{ rhcos.local_image_path }}"
when: not image_stats.results[0].stat.exists
- name: Get templates info
ovirt_template_info:
auth: "{{ ovirt_auth }}"
@@ -46,23 +24,50 @@
}}
with_items: "{{ templates_info.results }}"
- name: Create templates
include_role:
name: ovirt.image-template
vars:
qcow_url: "file://{{ rhcos.local_image_path }}"
image_path: "{{ rhcos.local_image_path }}"
template_cluster: "{{ item.cluster }}"
template_name: "{{ item.template }}"
template_memory_guaranteed: "{{ item.memory_guaranteed | default(omit) }}"
template_disk_storage: "{{ item.disks.0.storage_domain }}"
template_operating_system: "{{ item.operating_system }}"
template_seal: no
loop:
- "{{ control_plane }}"
- "{{ compute }}"
when: item.template not in templates_list
- name: Create rhcos template
when: templates_list | length < 2
block:
- name: Check local image existance
stat:
get_mime: no
get_checksum: no
get_attributes: no
path: "{{ rhcos.local_image_path }}"
register: image_stats
loop:
- "{{ rhcos.local_cmp_image_path }}"
- "{{ rhcos.local_image_path }}"
- name: Download RHCOS image
when: not image_stats.results[1].stat.exists
get_url:
url: "{{ rhcos.image_url }}"
dest: "{{ rhcos.local_cmp_image_path}}"
force: no
- name: Extract RHCOS image
shell: "gunzip -c {{ rhcos.local_cmp_image_path }} > {{ rhcos.local_image_path }}"
when: not image_stats.results[0].stat.exists
- name: Create templates
include_role:
name: ovirt.ovirt.image_template
vars:
qcow_url: "file://{{ rhcos.local_image_path }}"
image_path: "{{ rhcos.local_image_path }}"
template_cluster: "{{ item.cluster }}"
template_name: "{{ item.disks.0.name }}"
template_memory_guaranteed: "{{ item.memory_guaranteed | default(omit) }}"
template_disk_storage: "{{ item.disks.0.storage_domain }}"
template_disk_size: "{{ item.disks.0.size }}"
template_disk_interface: "{{ item.disks.0.interface }}"
template_operating_system: "{{ item.operating_system }}"
template_seal: no
loop:
- "{{ control_plane }}"
- "{{ compute }}"
when: item.template not in templates_list
- name: Create VMs infra
include_role:
name: ovirt.vm-infra
name: ovirt.ovirt.vm_infra

View File

@@ -14,9 +14,10 @@ all:
control_plane:
cluster: "{{ ovirt_cluster }}"
memory: 16GiB
sockets: 4
cores: 1
memory: 12GiB
guarantee_memory: 12GiB
sockets: 1
cores: 4
template: rhcos_tpl
operating_system: "rhcos_x64"
type: high_performance
@@ -37,9 +38,10 @@ all:
compute:
cluster: "{{ ovirt_cluster }}"
memory: 16GiB
sockets: 4
cores: 1
memory: 12GiB
guarantee_memory: 12GiB
sockets: 1
cores: 4
template: worker_rhcos_tpl
operating_system: "rhcos_x64"
type: high_performance