Skip to content

Commit b25772e

Browse files
committed
allow secret use with usage property
1 parent 497acd1 commit b25772e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Role Variables
103103
`libvirt_volume_default_device` are valid here. Default is
104104
`libvirt_volume_default_type`.
105105
- `capacity`: volume capacity, can be suffixed with k, M, G, T, P or E when type is `network` or MB,GB,TB, etc when type is `disk` (required when type is `disk` or `network`)
106-
- `auth`: Authentication details should they be required. If auth is required, `name`, `type`, `token` will need to be supplied.
106+
- `auth`: Authentication details should they be required. If auth is required, `name`, `type`, and `token` or `usage` will need to be supplied. `token` and `usage` should not be both supplied.
107107
- `source`: Where the remote volume comes from when type is `network`. `protocol`, `name`, `hostname` and `port` should be supplied.
108108
- `format`: Format of the volume. All options for
109109
`libvirt_volume_default_format` are valid here. Default is

templates/vm.xml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
{% elif volume.type is defined and volume.type == 'network' %}
4444
{% if volume.auth.name is defined %}
4545
<auth username='{{ volume.auth.name }}'>
46-
<secret type='{{ volume.auth.type }}' uuid='{{ volume.auth.token }}'/>
46+
<secret type='{{ volume.auth.type }}' {% if volume.auth.token is defined and volume.auth.token is not none %} uuid='{{ volume.auth.token }}' {% else %} usage='{{ volume.auth.usage }}' {% endif %}/>
4747
</auth>
4848
{% endif %} {# End volume.auth.name check #}
4949
{% if volume.source.name is defined %}

0 commit comments

Comments
 (0)