Bug 1536515

Summary: VDO Ansible module does not meet upstream Ansible code conventions
Product: Red Hat Enterprise Linux 7 Reporter: Bryan Gurney <bgurney>
Component: vdoAssignee: Bryan Gurney <bgurney>
Status: CLOSED ERRATA QA Contact: Jakub Krysl <jkrysl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: awalsh, bgurney, corwin, jkrysl, limershe, pasik
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 6.1.2.39 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 13:08:04 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:

Description Bryan Gurney 2018-01-19 14:55:19 UTC
Description of problem:
In a (still pending) pull request to upstream Ansible (at https://github.com/ansible/ansible/pull/32267 ), the following issues were identified with the vdo.py Ansible module:

- If at all possible, options that appear to be boolean options should be boolean.  If there is a valid reason that said options should not be boolean, they should be documented in the "options" section of the DOCUMENTATION section.

- Any returned variables shall be documented in the RETURN section.  (The VDO module is using JSON variables for diagnostic, which are only visible in "ansible-playbook -vvv" execution.)  Using the "module.debug()" or "module.log()" function is strongly encouraged for module logging.

- In a November 20 update to the ansible-test suite, the "code-smell/no-underscore-variable.sh" test failed on numerous lines with the error "underscore used as a variable".

- Any items in the dictionary module_args that are "default=None", "type=str", or "required=false" are default values, and should not be specified in the definition of module_args.

Version-Release number of selected component (if applicable):
vdo-6.1.0.114-14.x86_64

Comment 2 Louis Imershein 2018-01-19 18:04:08 UTC
At this point it seems clear to me that we're not making it into the Ansible package for this release.  So I recommend we stick with having our module in the vdo rpm for now.  As such, these changes only need to be made to the upstream contribution and don't need to be in 7.5 - i.e. we need to fix this, but we don't need an exception for 7.5.

Comment 4 Bryan Gurney 2018-08-03 20:36:16 UTC
The pull request for the VDO Ansible module (referenced above) was accepted on January 31, 2018, and Ansible 2.5 ships with the VDO Ansible module.

Comment 6 corwin 2018-12-04 19:47:24 UTC
Bryan, has this been fixed?

Comment 7 Bryan Gurney 2018-12-06 03:12:01 UTC
No, this has not yet been fixed in the Ansible VDO module in the vdo package.  

However, Ansible 2.5 has been released since March 2018, therefore the version of the VDO module with these fixes is already present in Ansible.

Comment 11 Bryan Gurney 2019-03-19 20:09:42 UTC
Since the VDO Ansible module has been upstream, the vdo.py module will be removed from the VDO package.

It will be available in ansible 2.5 or greater.

Comment 16 Jakub Krysl 2019-05-29 11:36:49 UTC
# rpm -qa vdo
vdo-6.1.2.41-4.el7.x86_64

# rpm -ql vdo | grep ansible
/usr/share/doc/vdo/examples/ansible
/usr/share/doc/vdo/examples/ansible/README.txt
/usr/share/doc/vdo/examples/ansible/test_vdocreate.yml
/usr/share/doc/vdo/examples/ansible/test_vdocreate_alloptions.yml
/usr/share/doc/vdo/examples/ansible/test_vdoremove.yml

# cat /usr/share/doc/vdo/examples/ansible/README.txt 
This directory contains example playbooks for the "vdo" module in Ansible,
which can be used to create and remove VDO volumes, modify configuration
options, and start and stop VDO volumes.

The Ansible "vdo" module can be found in Ansible, version 2.5 or greater.
General information on Ansible can be found at http://docs.ansible.com/

To run a playbook:

1. On the control system, set up a passwordless SSH session via the
   "ssh-agent bash" and "ssh-add" commands.

2. Specify the managed hosts and groups by adding them to the
   /etc/ansible/hosts file on the control system.

3. Using the "hosts" value, construct a playbook detailing the desired state
   of the VDO volume.

4. When ready, execute "ansible-playbook <playbook.yml>".  For additional
   diagnostic output, run "ansible-playbook <playbook.yml> -vvvv".

So the vdo.py module is no longer shipper in vdo rpm and README.TXT contains info where to find it now.

Comment 18 errata-xmlrpc 2019-08-06 13:08:04 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:2233