Bug 1638325

Summary: ceph-validate : osd_auto_discovery - first letter lower case boolean values are not accepted
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Yogesh Mane <ymane>
Component: Ceph-AnsibleAssignee: Andrew Schoen <aschoen>
Status: CLOSED ERRATA QA Contact: Vasishta <vashastr>
Severity: high Docs Contact:
Priority: high    
Version: 3.2CC: anharris, aschoen, ceph-eng-bugs, gmeno, hnallurv, nthomas, rperiyas, sankarshan, shan, vashastr
Target Milestone: rc   
Target Release: 3.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: RHEL: ceph-ansible-3.2.0-0.1.rc2.el7cp Ubuntu: ceph-ansible_3.2.0~rc2-2redhat1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-03 19:02:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1630975    
Attachments:
Description Flags
ansible.log file none

Description Yogesh Mane 2018-10-11 10:47:42 UTC
Created attachment 1492859 [details]
ansible.log file

Description of problem:

osd_auto_discovery is not working


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.Added osd_auto_discovery:true in hosts file
2.executed playbook
3.

Actual results:

[ERROR]: [magna111] Validation failed for variable: osd_auto_discovery

 [ERROR]: [magna111] Given value for osd_auto_discovery: true

 [ERROR]: [magna111] Reason: not of type boolean

fatal: [magna111]: FAILED! => {
    "changed": false, 
    "msg": "[magna111] Validation failed for variable: osd_auto_discovery\n[magna111] Reason: not of type boolean\n[magna111] Given value for osd_auto_discovery: true", 
    "stderr_lines": [
        "[magna111] Validation failed for variable: osd_auto_discovery"
    ]
}



Expected results:

No error

Additional info:

Comment 4 Vasishta 2018-10-30 14:19:42 UTC
Hi,

It can be observed that natario.validate was not considering 'true' as a valid value for dmcrypt and osd_auto_discovery and other flags. I feel that it would be better if we support flags to be set as 'true' or 'false' also.

As I very simple method plugins/actions/validate.py can be modified as in -

https://github.com/ceph/ceph-ansible/compare/master...VasishtaShastry:ceph_val_accept_small_case_bool

It seemed to be working.

Regards,
Vasishta Shastry
QE, Ceph

Comment 5 Andrew Schoen 2018-10-30 18:48:09 UTC
Vasishta,

I've made an upstream pull request from your branch. This solution looks good to me.

Thanks,
Andrew

Comment 6 Sébastien Han 2018-10-31 08:14:18 UTC
Put it in back to assigned. Only use POST when the patch has been backported.

Comment 11 Vasishta 2018-11-30 03:18:43 UTC
Working fine for both osd_auto_discovery and dmcrypt using ceph-ansible-3.2.0-0.1.rc4.el7cp.noarch .



$ cat /etc/ansible/hosts
.....

[osds]
abc24 osd_auto_discovery='true'
abc07 dmcrypt='true' devices="['/dev/sdb']"
abc32 devices="['/dev/sdb','/dev/sdc']"


....

Moving to VERIFIED state.


Regards,
Vasishta shastry
QE, Ceph

Comment 13 errata-xmlrpc 2019-01-03 19:02:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0020