]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
defaults: add a fact '_current_monitor_address'
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 15 Oct 2018 13:22:40 +0000 (15:22 +0200)
committerSébastien Han <seb@redhat.com>
Wed, 31 Oct 2018 13:16:10 +0000 (14:16 +0100)
So we don't have to loop over `_monitor_addresses` when we need the
monitor address of the current node being played.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-defaults/tasks/set_monitor_address.yml

index 799abd2f12cbd4aa7e023e18dd59d36e5d6f86f3..271f5cf224d3b34079648dd39bafcf9089297d4e 100644 (file)
     - ip_version == 'ipv6'
     - hostvars[item]['monitor_address_block'] | default('subnet')  == 'subnet'
     - hostvars[item]['monitor_address'] | default('0.0.0.0') == '0.0.0.0'
-    - hostvars[item]['monitor_interface'] | default('interface') != 'interface'
\ No newline at end of file
+    - hostvars[item]['monitor_interface'] | default('interface') != 'interface'
+
+- name: set_fact _current_monitor_address
+  set_fact:
+    _current_monitor_address: "{{ item.addr }}"
+  with_items: "{{ _monitor_addresses }}"
+  when: inventory_hostname == item.name
\ No newline at end of file