@@ -19,6 +19,16 @@ Role Variables
1919- ` libvirt_vm_image_cache_path ` : The directory in which to cache downloaded
2020 images. Default is "/tmp/".
2121
22+ - ` libvirt_volume_default_images_path ` : Directory in which instance images are
23+ stored. Default is '/var/lib/libvirt/images'.
24+
25+ - ` libvirt_volume_default_type ` : What type of backing volume does the instance use? Default is ` volume ` .
26+
27+ - ` libvirt_volume_default_format ` : Format for volumes created by the role, Default is ` qcow2 ` .
28+
29+ - ` libvirt_volume_default_device ` : Control how device appears in guest OS. Defaults to ` disk ` .
30+
31+
2232- ` libvirt_vm_engine ` : virtualisation engine. If not set, the role will attempt
2333 to auto-detect the optimal engine to use.
2434
@@ -36,6 +46,9 @@ Role Variables
3646- ` libvirt_vm_virsh_default_env ` : Variables contained within this dictionary are
3747 added to the environment used when executing virsh commands.
3848
49+ - ` libvirt_vm_clock_offset ` . If defined the instances clock offset is set to
50+ the provided value. When undefined sync is set to ` localtime ` .
51+
3952- ` libvirt_vms ` : list of VMs to be created/destroyed. Each one may have the
4053 following attributes:
4154
@@ -55,11 +68,17 @@ Role Variables
5568 ` libvirt_vm_engine ` is ` kvm ` , otherwise ` host-model ` . Can be set to none
5669 to not configure a cpu mode.
5770
71+ - ` clock_offset ` : Overrides default set in ` libvirt_vm_clock_offset `
72+
73+ - ` enable_vnc ` : If true enables VNC listening on localhost for use with
74+ VirtManager and similar tools
75+
5876 - ` volumes ` : a list of volumes to attach to the VM. Each volume is
5977 defined with the following dict:
6078 - ` pool ` : Name or UUID of the storage pool from which the volume should be
6179 allocated.
62- - ` name ` : Name to associate with the volume being created.
80+ - ` name ` : Name to associate with the volume being created; For ` file ` type volumes include extension if you would like volumes created with one.
81+ - ` file_path ` : Where the image of ` file ` type volumes should be placed; defaults to ` libvirt_volume_default_images_path `
6382 - ` device ` : ` disk ` or ` cdrom `
6483 - ` capacity ` : volume capacity (can be suffixed with M,G,T or MB,GB,TB, etc) (required when type is ` disk ` )
6584 - ` format ` : options include ` raw ` , ` qcow2 ` , ` vmdk ` . See ` man virsh ` for the
@@ -80,6 +99,7 @@ Role Variables
8099 - ` network ` : Name of the network to which an interface should be
81100 attached. Must be specified if and only if the interface ` type ` is
82101 ` network ` .
102+ - ` mac ` : "Hardware" address of the virtual instance, if absent one is created
83103 - ` source ` : A dict defining the host interface to which this
84104 VM interface should be attached. Must be specified if and only if the
85105 interface ` type ` is ` direct ` . Includes the following attributes:
@@ -154,8 +174,18 @@ Example Playbook
154174 format: 'qcow2'
155175 capacity: '200GB'
156176 pool: 'my-pool'
177+ - name: 'filestore'
178+ type: 'file'
179+ file_path: '/srv/cloud/images'
180+ capacity: '900GB'
157181 interfaces:
158- - network: 'br-datacentre'
182+ - type: 'direct'
183+ source:
184+ dev: 'eth123'
185+ mode: 'private'
186+ - type: 'bridge'
187+ source:
188+ dev: 'br-datacentre'
159189
160190
161191Author Information
0 commit comments