From: Markos Chandras Date: Tue, 14 Aug 2018 06:52:04 +0000 (+0300) Subject: roles: ceph-defaults: Delegate cluster information task to monitor node X-Git-Tag: v3.1.0rc19~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b2de642c8e9fba1b01eaa4e11e6756959a0de073;p=ceph-ansible.git roles: ceph-defaults: Delegate cluster information task to monitor node Since commit f422efb1d6b56ce56a7d39a21736a471e4ed357 ("config: ensure rgw section has the correct name") we observe the following failures in new Ceph deployment with OpenStack-Ansible fatal: [aio1_ceph-rgw_container-fc588f0a]: FAILED! => {"changed": false, "cmd": "ceph --cluster ceph -s -f json", "msg": "[Errno 2] No such file or directory" This is because the task executes 'ceph' but at this point no package installation has happened. Packages are normally installed in the 'ceph-common' role which runs after the 'ceph-defaults' one. Since we are looking to obtain cluster information, the task should be delegated to a monitor node similar to other tasks in that role Signed-off-by: Markos Chandras (cherry picked from commit 37e50114dedf6a7aec0f1b2e1b9d2dd997a11d8e) --- diff --git a/roles/ceph-defaults/tasks/facts.yml b/roles/ceph-defaults/tasks/facts.yml index a8f11b47b..d4f347677 100644 --- a/roles/ceph-defaults/tasks/facts.yml +++ b/roles/ceph-defaults/tasks/facts.yml @@ -218,6 +218,14 @@ - block: - name: get current cluster status (if already running) command: "{{ docker_exec_cmd }} ceph --cluster {{ cluster }} -s -f json" + changed_when: false + failed_when: false + check_mode: no + run_once: true + delegate_to: "{{ groups[mon_group_name][0] }}" + when: + - not rolling_update + - groups.get(mon_group_name, []) | length > 0 register: ceph_current_status - name: set_fact ceph_current_status (convert to json)