From: Guillaume Abrioux Date: Thu, 28 Oct 2021 12:10:26 +0000 (+0200) Subject: cephadm: use public_network when adding hosts X-Git-Tag: v5.0.12~33 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d06c856fca3177f96b05ef75398894dd43804a29;p=ceph-ansible.git cephadm: use public_network when adding hosts 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 (cherry picked from commit 2f34531304cc1f7a718118ca1931ea600e59ea7e) --- diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index 1a6470c98..7c40ec4b5 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -269,7 +269,7 @@ delegate_to: '{{ groups[mon_group_name][0] }}' - name: manage nodes with cephadm - command: "{{ ceph_cmd }} orch host add {{ ansible_facts['hostname'] }} {{ 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] }}'