Skip to content

Commit 3463ee5

Browse files
committed
Allow cdrom device types for volumes
1 parent e828b37 commit 3463ee5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ Role Variables
6060
- `pool`: Name or UUID of the storage pool from which the volume should be
6161
allocated.
6262
- `name`: Name to associate with the volume being created.
63-
- `capacity`: volume capacity (can be suffixed with M,G,T or MB,GB,TB, etc)
64-
- `device`: `disk`
63+
- `device`: `disk` or `cdrom`
64+
- `capacity`: volume capacity (can be suffixed with M,G,T or MB,GB,TB, etc) (required when type is `disk`)
6565
- `format`: options include `raw`, `qcow2`, `vmdk`. See `man virsh` for the
6666
full range. Default is `qcow2`
6767
- `image`: (optional) a URL to an image with which the volume is initalised (full copy).

tasks/volumes.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
-b {{ item.backing_image }}
2727
{% endif %}
2828
with_items: "{{ volumes }}"
29+
when: "{{ item.device == 'disk' }}"
2930
environment: "{{ libvirt_vm_script_env }}"
3031
register: volume_result
3132
changed_when:

0 commit comments

Comments
 (0)