From: Guillaume Abrioux Date: Tue, 7 Apr 2020 12:57:47 +0000 (+0200) Subject: add-osd: fix fact gathering in add-osd X-Git-Tag: v3.2.41~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=724620ed3dc76bc8dbddb50538ff64b82b3025a7;p=ceph-ansible.git add-osd: fix fact gathering in add-osd This commit makes this playbook gathering facts from all other nodes but clients. When collocating OSDs on other nodes it can fail like following: ``` fatal: [vm252-11]: FAILED! => { "msg": "'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_hostname'" } ``` In that case, a fact from a RGW node is called when rendering the `ceph.conf.j2` but it fails because facts are gathered only from mon and osd nodes. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1806765 Signed-off-by: Guillaume Abrioux --- diff --git a/infrastructure-playbooks/add-osd.yml b/infrastructure-playbooks/add-osd.yml index 7e2d8ff3c..4aa7bf6a1 100644 --- a/infrastructure-playbooks/add-osd.yml +++ b/infrastructure-playbooks/add-osd.yml @@ -35,9 +35,7 @@ setup: delegate_to: "{{ item }}" delegate_facts: True - with_items: - - "{{ groups['mons'] }}" - - "{{ groups['osds'] }}" + with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}" run_once: True when: - delegate_facts_host | bool @@ -65,9 +63,7 @@ setup: delegate_to: "{{ item }}" delegate_facts: True - with_items: - - "{{ groups['mons'] }}" - - "{{ groups['osds'] }}" + with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}" run_once: True when: - delegate_facts_host | bool @@ -77,12 +73,6 @@ set_fact: add_osd: True - - name: set noup flag - command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd set noup" - delegate_to: "{{ groups['mons'][0] }}" - run_once: True - changed_when: False - roles: - role: ceph-defaults - role: ceph-handler @@ -93,11 +83,4 @@ - role: ceph-common when: not containerized_deployment | bool - role: ceph-config - - role: ceph-osd - - post_tasks: - - name: unset noup flag - command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup" - delegate_to: "{{ groups['mons'][0] }}" - run_once: True - changed_when: False \ No newline at end of file + - role: ceph-osd \ No newline at end of file