From ac0002ffeaccb2fc1dd5041832420fa0bc218900 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Thu, 13 Apr 2023 12:02:48 +0200 Subject: [PATCH] Fix cephadm OSD addition host delegation issues --- roles/cephadm/tasks/osds.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/cephadm/tasks/osds.yml b/roles/cephadm/tasks/osds.yml index b35a69e..1f0a438 100644 --- a/roles/cephadm/tasks/osds.yml +++ b/roles/cephadm/tasks/osds.yml @@ -11,3 +11,7 @@ delegate_to: "{{ omit if 'mons' in group_names else groups['mons'][0] }}" when: cephadm_osd_devices | length > 0 with_items: "{{ cephadm_osd_devices }}" + vars: + # NOTE: Without this, the delegate hosts's ansible_host variable will not + # be respected. + ansible_host: "{{ hostvars[inventory_hostname].ansible_host if 'mons' in group_names else hostvars[groups['mons'][0]].ansible_host }}"