From bca8ac39c2f04632fb7945bf73d3947b223e4bb9 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 10 Jul 2019 15:08:39 +0200 Subject: [PATCH] validate: improve message printed in check_devices.yml The message prints the whole content of the registered variable in the playbook, this is not needed and makes the message pretty unclear and unreadable. ``` "msg": "{'_ansible_parsed': True, 'changed': False, '_ansible_no_log': False, u'err': u'Error: Could not stat device /dev/sdf - No such file or directory.\\n', 'item': u'/dev/sdf', '_ansible_item_result': True, u'failed': False, '_ansible_item_label': u'/dev/sdf', u'msg': u\"Error while getting device information with parted script: '/sbin/parted -s -m /dev/sdf -- unit 'MiB' print'\", u'rc': 1, u'invocation': {u'module_args': {u'part_start': u'0%', u'part_end': u'100%', u'name': None, u'align': u'optimal', u'number': None, u'label': u'msdos', u'state': u'info', u'part_type': u'primary', u'flags': None, u'device': u'/dev/sdf', u'unit': u'MiB'}}, 'failed_when_result': False, '_ansible_ignore_errors': None, u'out': u''} is not a block special file!" ``` Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1719023 Signed-off-by: Guillaume Abrioux (cherry picked from commit e6dc3ebd8c8161e56c0a4a1fdb409272b9fd5342) --- roles/ceph-validate/tasks/check_devices.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/ceph-validate/tasks/check_devices.yml b/roles/ceph-validate/tasks/check_devices.yml index 8b3286c5e..69c2f8d36 100644 --- a/roles/ceph-validate/tasks/check_devices.yml +++ b/roles/ceph-validate/tasks/check_devices.yml @@ -12,6 +12,6 @@ - name: fail if one of the devices is not a device fail: - msg: "{{ item }} is not a block special file!" + msg: "{{ item.item }} is not a block special file!" when: item.rc is defined with_items: "{{ devices_parted.results }}"