-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathovirt-mktemplate.yml
46 lines (42 loc) · 1.66 KB
/
ovirt-mktemplate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# ansible-galaxy install ovirt.image-template
# https://github.com/oVirt/ovirt-ansible-image-template.git
# RHEL-Requires: libselinux-python
# RHEL-Requires: sudo yum --enablerepo=rhel-7-server-rhv-4.2-manager-rpms install python-ovirt-engine-sdk4
#
# Fedora/Python3-Requires: dnf -y install gcc libxml2-devel python3-devel
# Fedora/Python3-Requires: pip install ovirt-engine-sdk-python==4.3
---
- name: Make oVirt template
hosts: localhost
connection: local
gather_facts: true
vars_files:
- "{{ ansible_domain }}/rhvm-vault.yml"
vars:
engine_url: "{{ rhvurl }}"
engine_user: "{{ rhvuser }}"
engine_password: "{{ rhvpass }}"
engine_cafile: /etc/pki/ovirt-engine/ca.pem
qcow_url: file:///data/rhel-8.2-x86_64-kvm.qcow2
#qcow_url: https://access.cdn.redhat.com/.../rhel-8.2-x86_64-kvm.qcow2...
template_seal: false
template_cluster: Default
template_name: rhel-8.2-cloud
template_operating_system: rhel_8x64
template_memory: 4GiB
template_cpu: 2
template_disk_interface: virtio_scsi
template_disk_size: 10GiB
template_disk_storage: nvmestore
tasks:
- assert:
that:
- "ansible_version.full is version('2.7', '>=')"
- "ansible_version.full is version('2.8', '<')"
fail_msg: |
ERROR: Found {{ ansible_version.full }}
Please use Ansible version 2.7 in order to interoperate with ovirtsdk4 (4.3)
# yum --enablerepo=rhel-7-server-rh-common-rpms install python-ovirt-engine-sdk4
# yum --disablerepo=rhel-7-server-ansible-2-rpms --enablerepo=rhel-7-server-ansible-2.7-rpms downgrade ansible
- include_role:
name: ovirt.image-template