066173bec0
Closes-Bug: #1605457 Change-Id: I1a8e746f79f4dfcc5a43e736c3461b316db3f593
15 lines
382 B
Django/Jinja
15 lines
382 B
Django/Jinja
printjson(rs.initiate(
|
|
{
|
|
"_id" : "{{ mongodb_replication_set_name }}",
|
|
"version" : 1,
|
|
"members" : [
|
|
{% for host in groups["mongodb"] %}
|
|
{
|
|
"_id" : {{ loop.index }},
|
|
"host" : "{{ hostvars[host]['ansible_' + storage_interface]['ipv4']['address'] }}:{{ mongodb_port }}"
|
|
}{% if not loop.last %},{% endif %}
|
|
{% endfor %}
|
|
]
|
|
}
|
|
))
|