]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
mon: use `_current_monitor_address` in systemd unit file
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 15 Oct 2018 13:25:24 +0000 (15:25 +0200)
committerSébastien Han <seb@redhat.com>
Wed, 31 Oct 2018 13:16:10 +0000 (14:16 +0100)
Let's avoid a jinja loop and use `_current_monitor_address` to get the
monitor address.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-mon/templates/ceph-mon.service.j2

index 15c97825157b05079a1d07f34fa57116c432a55a..608c0b70f7d889addf2ed55ced38ad2504849127 100644 (file)
@@ -30,11 +30,7 @@ ExecStart=/usr/bin/docker run --rm --name ceph-mon-%i \
   --net=host \
 {% endif -%}
   -e IP_VERSION={{ ip_version[-1:] }} \
-{% for host in _monitor_addresses %}
-{% if host.name == inventory_hostname %}
--e MON_IP={{ host.addr }} \
-{% endif %}
-{% endfor %}
+  -e MON_IP={{ _current_monitor_address }} \
   -e CLUSTER={{ cluster }} \
   -e FSID={{ fsid }} \
   -e CEPH_PUBLIC_NETWORK={{ public_network | regex_replace(' ', '') }} \