]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
cephadm: use public_network when adding hosts
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 28 Oct 2021 12:10:26 +0000 (14:10 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 28 Oct 2021 14:37:22 +0000 (16:37 +0200)
When adding host, using ansible_facts['default_ipv4']['address'] might
not be the desired network, we shouldn't enforce the subnet with the
default route.
Let's use the public_network instead.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2006415
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/cephadm-adopt.yml

index 23556245cd6ebc190f036f8d59d2198a645fbf07..06ce50da5b0aa584d85eec80df84fe64ac7511ff 100644 (file)
       when: is_hci | bool
 
     - name: manage nodes with cephadm
-      command: "{{ ceph_cmd }} orch host add {{ ansible_facts['nodename'] }} {{ ansible_facts['default_ipv4']['address'] }} {{ group_names | join(' ') }}"
+      command: "{{ ceph_cmd }} orch host add {{ ansible_facts['nodename'] }} {{ ansible_facts['all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) }} {{ group_names | join(' ') }}"
       changed_when: false
       delegate_to: '{{ groups[mon_group_name][0] }}'