github.com/openshift/installer@v1.4.17/upi/ovirt/create-templates-and-vms.yml (about)

     1  ---
     2  - hosts: localhost
     3    connection: local
     4    gather_facts: false
     5  
     6    tasks:
     7    - import_tasks: common-auth.yml
     8  
     9    - name: Get templates info
    10      ovirt_template_info:
    11        auth: "{{ ovirt_auth }}"
    12        pattern: name={{ item.template }} and cluster={{ item.cluster }}
    13      register: templates_info
    14      loop:
    15      - "{{ control_plane }}"
    16      - "{{ compute }}"
    17  
    18    - name: Templates list
    19      set_fact:
    20        templates_list: >-
    21          {{
    22            templates_list | default([]) +
    23              item.ovirt_templates | map(attribute='name') | list
    24          }}
    25      with_items: "{{ templates_info.results }}"
    26  
    27    - name: Create rhcos template
    28      when: templates_list | length < 2
    29      block:
    30      - name: Check local image existance
    31        stat:
    32          get_mime: no
    33          get_checksum: no
    34          get_attributes: no
    35          path: "{{ rhcos.local_image_path }}"
    36        register: image_stats
    37        loop:
    38        - "{{ rhcos.local_cmp_image_path }}"
    39        - "{{ rhcos.local_image_path }}"
    40  
    41      - name: Download RHCOS image
    42        when: not image_stats.results[1].stat.exists
    43        get_url:
    44          url: "{{ rhcos.image_url }}"
    45          dest: "{{ rhcos.local_cmp_image_path}}"
    46          force: no
    47  
    48      - name: Extract RHCOS image
    49        shell: "gunzip -c {{ rhcos.local_cmp_image_path }} > {{ rhcos.local_image_path }}"
    50        when: not image_stats.results[0].stat.exists
    51  
    52      - name: Create templates
    53        include_role:
    54          name: ovirt.ovirt.image_template
    55        vars:
    56          qcow_url: "file://{{ rhcos.local_image_path }}"
    57          image_path: "{{ rhcos.local_image_path }}"
    58          template_cluster: "{{ item.cluster }}"
    59          template_name: "{{ item.disks.0.name }}"
    60          template_memory_guaranteed: "{{ item.memory_guaranteed | default(omit) }}"
    61          template_disk_storage: "{{ item.disks.0.storage_domain }}"
    62          template_disk_size: "{{ item.disks.0.size }}"
    63          template_disk_interface: "{{ item.disks.0.interface }}"
    64          template_operating_system: "{{ item.operating_system }}"
    65          template_seal: no
    66        loop:
    67        - "{{ control_plane }}"
    68        - "{{ compute }}"
    69        when: item.template not in templates_list
    70  
    71    - name: Create VMs infra
    72      include_role:
    73        name: ovirt.ovirt.vm_infra