Description of problem: ------------------------ When 'semanage' binary tool is not available in the system,and gdeploy while executing the config script which has a 'selinux' section set to 'yes', should throw proper error message. Currently gdeploy doesn't throw any warning and silently exits, which the user will take as success. But in reality, the correct selinux labels are not set on the gluster bricks, if semanage tool is not available. Version-Release number of selected component (if applicable): ------------------------------------------------------------- gdeploy-2.0-16 How reproducible: ----------------- Always Steps to Reproduce: ------------------- 1. Make sure to remove - 'policycoreutils-python' package which supplies 'semanage' tool. Note: When I installed RHEL 7.2 from iso, I never had policycoreutils-python package installed 2. Create a config file with [selinux] section set to 'yes [hosts] ... [pv] ... [vg] ... [lv1] ... [lv2] ... [selinux] yes 3. Execute the script Actual results: --------------- gdeploy completes successfully Expected results: ----------------- As the config file has requirement to selinux labels to set on bricks, if 'semanage' tool is not available, then gdeploy should complain about it and should not complete silently
Fixed in commit: https://github.com/gluster/gdeploy/commit/7082fd44acde6fe144e4c920bbf92da6abbf7810
Tested with gdeploy-2.0.1-2.el7rhgs When 'semanage' command is not available, gdeploy throws relevant errors and doesn't fail quietly as it used to do earlier. Errors are as follows : "failed: [dhcp37-172.lab.eng.blr.redhat.com] (item={u'device': u'/dev/GLUSTER_vg1/GLUSTER_lv1', u'path': u'/gluster/brick1'}) => {"changed": true, "cmd": "semanage fcontext -a -t glusterd_brick_t /gluster/brick1", "delta": "0:00:00.002824", "end": "2016-10-25 20:12:25.106210", "failed": true, "item": {"device": "/dev/GLUSTER_vg1/GLUSTER_lv1", "path": "/gluster/brick1"}, "rc": 127, "start": "2016-10-25 20:12:25.103386", "stderr": "/bin/sh: semanage: command not found", "stdout": "", "stdout_lines": [], "warnings": []}"
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://rhn.redhat.com/errata/RHSA-2017-0260.html