8fc8d327b3
MongoDB cluster only uses api_interface. Change-Id: If24a1c9bd685b268068cb676a28316636af52b78 Closes-Bug: #1626339
15 lines
396 B
Django/Jinja
15 lines
396 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_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ mongodb_port }}"
|
|
}{% if not loop.last %},{% endif %}
|
|
{% endfor %}
|
|
]
|
|
}
|
|
))
|