Skip to content

Commit 31e7652

Browse files
committed
Allow created pool directory to be different than XML
1 parent 7a99665 commit 31e7652

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ should be a dict containing the following items:
2020
deprecated and will be removed in a future release.
2121
- `capacity` The capacity, in bytes, of the pool. (optional)
2222
- `path` The absolute path to the pool's backing directory.
23+
- `path`: The absolute path to the pool's backing directory, as configured in
24+
the pool definition.
25+
- `host_path`: The absolute path to the pool's backing directory, that will be
26+
created on the host. Optional, defaults to the same as `pool.path`.
2327
- `mode` The access mode of the pool. N.B.: This should be specified as an
2428
integer **without** a leading zero; for example: `mode: 755`. (only `dir`)
2529
- `owner` The owner of the pool. (only `dir`)

defaults/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
# supported. 'lvm2' is supported as an alias for 'logical', but this
77
# alias is deprecated and will be removed in a future release.
88
# capacity: The capacity, in bytes, of the pool.
9-
# path: The absolute path to the pool's backing directory.
9+
# path: The absolute path to the pool's backing directory, as configured in the
10+
# pool definition.
11+
# host_path: The absolute path to the pool's backing directory, that will be
12+
# created on the host. Optional, defaults to the same as 'pool.path'.
1013
# mode: The access mode of the pool.
1114
# owner: The owner of the pool.
1215
# group: The group of the pool.

tasks/pools.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- name: Ensure libvirt dir storage pool directories exist
33
file:
4-
path: "{{ item.path }}"
4+
path: "{{ item.host_path | default(item.path) }}"
55
owner: "{{ item.owner }}"
66
group: "{{ item.group }}"
77
mode: "{{ item.mode|int(base=8) }}"

0 commit comments

Comments
 (0)