Skip to content

Commit

Permalink
cephadm: use public_network when adding hosts
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit 2f34531)
  • Loading branch information
guits committed Nov 8, 2021
1 parent 5f7ad18 commit d06c856
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion infrastructure-playbooks/cephadm-adopt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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] }}'

Expand Down

0 comments on commit d06c856

Please sign in to comment.