Bug 1536533

Summary: VDO Ansible module does not return "changed" status after having disabling or enabling dedupe or compression.
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.5CC: awalsh, jkrysl, limershe
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 6.1.0.142 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 09:38:49 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 15:44:11 UTC
Description of problem:
After having fixed the problems that were preventing the VDO Ansible module from interacting with VDO (bug 1536214 and bug 1536522), I found that the module was able to successfully change the enabled / disabled state of deduplication and/or compression, but the "changed" status was not being returned.  This is incorrect; if the playbook successfully finishes changing something, it should show a "changed" return status for that task.

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

How reproducible:
100%

Steps to Reproduce:
1. Install the vdo.py ansible module to the Ansible ".../modules/system" subdirectory of the system to run VDO, and a control system.
2. Copy one of the example playbooks from the /usr/share/doc/vdo/examples/ansible directory of the system with VDO to the control system, and create a playbook that uses a local username, acts on a block device existing on the system, and has various other parameters.  

Recommended sequence: use /usr/share/doc/vdo/examples/ansible/test_vdocreate.yml as a base for a creation playbook, /usr/share/doc/vdo/examples/ansible/test_vdoremove.yml as a base for a removal playbook.

3. Create a copy of the modified "test_vdocreate.yml", with the following additional lines:

- test_vdocreate_yescompress.yml: "compression: enabled"
- test_vdocreate_nocompress.yml: "compression: disabled"
- test_vdocreate_yesdedupe.yml: "deduplication: enabled"
- test_vdocreate_nodedupe.yml: "deduplication: disabled"

4. On the control system, after passwordless ssh has been established, execute "ansible-playbook <playbook_filename.yml>".  Run the "test_vdocreate.yml" equivalent script to create the VDO volume, and then run "test_vdocreate_nodedupe.yml" to disable deduplication.

Actual results:
The Deduplication or Compression status is successfully modified (when checked with "vdo status", but the ansible-playbook play recap shows "ok=2 changed=0".

Expected results:
The Deduplication or Compression status is successfully modified (when checked with "vdo status", but the ansible-playbook play recap shows "ok=2 changed=1".

Additional info:

Comment 2 Bryan Gurney 2018-01-19 20:35:33 UTC
It turns out that this bug only appears for the Ansible upstream version of the module, which is otherwise fixed to work with VDO 6.1.0.114.  Therefore, this bug will apply to 7.6.

There is a similar bug for a VDO module without the Ansible upstream changes, which is detailed in BZ 1536635 ("VDO Ansible module always returns "changed" status after having disabling or enabling dedupe or compression, regardless of outcome.").  The ultimate fix is similar in code structure.

Comment 6 Jakub Krysl 2018-09-18 14:17:29 UTC
# rpm -qa vdo
vdo-6.1.1.120-3.el7.x86_64

$ ansible-playbook BZ1536533.yaml

PLAY [vdoClients] *************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************************************************************************************************************
ok: [storageqe-74.*]

TASK [Create VDO volume vdo1] *************************************************************************************************************************************************************************************
changed: [storageqe-74.*]

TASK [test_vdocreate_yescompress] *********************************************************************************************************************************************************************************
ok: [storageqe-74.*]

TASK [test_vdocreate_nocompress] **********************************************************************************************************************************************************************************
changed: [storageqe-74.*]

TASK [test_vdocreate_yesdedupe] ***********************************************************************************************************************************************************************************
ok: [storageqe-74.*]

TASK [test_vdocreate_nodedupe] ************************************************************************************************************************************************************************************
changed: [storageqe-74.*]

TASK [Remove VDo volume vdo1] *************************************************************************************************************************************************************************************
changed: [storageqe-74.*]

PLAY RECAP ********************************************************************************************************************************************************************************************************
storageqe-74.* : ok=7    changed=4    unreachable=0    failed=0

Comment 8 errata-xmlrpc 2018-10-30 09:38:49 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-2018:3094