073cfb2a33
During configuration file generation one uses local variable api_interface that reference remote host. Instead we should use hostvars to find out correct interface name for each host mentioned in configuration. Change-Id: I9f64fdf2cd18bcc0bbf1c4193349186d9a7658bc Closes-Bug: #1650195
15 lines
400 B
Django/Jinja
15 lines
400 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]['storage_interface']]['ipv4']['address'] }}:{{ mongodb_port }}"
|
|
}{% if not loop.last %},{% endif %}
|
|
{% endfor %}
|
|
]
|
|
}
|
|
))
|