Skip to content

Commit f4bb37a

Browse files
committed
allow use of list of ceph monitor
1 parent b25772e commit f4bb37a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Role Variables
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`)
106106
- `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.
107-
- `source`: Where the remote volume comes from when type is `network`. `protocol`, `name`, `hostname` and `port` should be supplied.
107+
- `source`: Where the remote volume comes from when type is `network`. `protocol`, `name`, and `hostname` or `hosts_list` should be supplied. `hostname` and `hosts_list` should not be both supplied. `port` is optional.
108108
- `format`: Format of the volume. All options for
109109
`libvirt_volume_default_format` are valid here. Default is
110110
`libvirt_volume_default_format`.

templates/vm.xml.j2

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@
4848
{% endif %} {# End volume.auth.name check #}
4949
{% if volume.source.name is defined %}
5050
<source protocol='{{ volume.source.protocol }}' name='{{ volume.source.name }}'>
51-
<host name='{{ volume.source.hostname }}' port='{{ volume.source.port }}'/>
51+
{% if volume.source.hosts_list is defined and volume.source.hosts_list is not none %}
52+
{% for host in volume.source.hosts_list %}
53+
<host name='{{ host }}' {% if volume.source.port is defined and volume.source.port is not none %} port='{{ volume.source.port }}' {% endif %}/>
54+
{% endfor %}
55+
{% else %}
56+
<host name='{{ volume.source.hostname }}' {% if volume.source.port is defined and volume.source.port is not none %} port='{{ volume.source.port }}' {% endif %}/>
57+
{% endif %}
5258
</source>
5359
{% endif %} {# End volume.source.name check #}
5460
{% else %} {# End elif volume.type is defined #}

0 commit comments

Comments
 (0)