Bug 2079645 - LVM: Running role in --check mode causes failure at TASK [linux-system-roles.storage : get required packages]
Summary: LVM: Running role in --check mode causes failure at TASK [linux-system-roles....
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rhel-system-roles
Version: 8.7
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Vojtech Trefny
QA Contact: CS System Management SST QE
URL:
Whiteboard: role:storage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-28 02:17 UTC by Rich Megginson
Modified: 2023-08-04 15:18 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github linux-system-roles storage issues 265 0 None open LVM: Running role in --check mode causes failure at TASK [linux-system-roles.storage : get required packages] 2022-04-28 02:17:00 UTC
Red Hat Issue Tracker RHELPLAN-120272 0 None None None 2022-04-28 02:28:09 UTC

Description Rich Megginson 2022-04-28 02:17:01 UTC
I was testing the role for the first time and wanted to run it in --check mode to verify the behaviour, but it would fail. Here is the error

TASK [linux-system-roles.storage : get required packages] *****************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NameError: name 'devices' is not defin
ed                                                                                                                                     
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/bblasco/.ansible
/tmp/ansible-tmp-1651110898.850052-489119-163256305427217/AnsiballZ_blivet.py\", line 102, in <module>\n    _ansiballz_main()\n  File \
"/home/bblasco/.ansible/tmp/ansible-tmp-1651110898.850052-489119-163256305427217/AnsiballZ_blivet.py\", line 94, in _ansiballz_main\n  
  invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/bblasco/.ansible/tmp/ansible-tmp-1651110898.850052-489119-1632
56305427217/AnsiballZ_blivet.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.blivet', init_globals=None
, run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.8/runpy.py\", line 207, in run_module\n    return _run_module_code(
code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.8/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mo
d_globals, init_globals,\n  File \"/usr/lib64/python3.8/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/a
nsible_blivet_payload_1xe7hh39/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 577, in <module>\n  File \"/tmp/ansible_bli
vet_payload_1xe7hh39/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 578, in BlivetDiskVolume\nNameError: name 'devices' i
s not defined\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}               

I googled the problem and came across this Red Hat KB article:
https://access.redhat.com/solutions/6726561

I am already using Python 3, and was using localhost with connection = local.

I tried to run the playbook in regular (not --check) mode, and it ran perfectly. Subsequent executions of the playbook in --check mode generate no errors either. I have reproduced the issue on two separate machines.
Steps to generate the error

    Create a playbook that uses this role
    Run in check mode - Result = error as per above
    Run same playbook in regular mode - Result = success
    Run in check mode again - Result = success

Environment info

OS: Fedora 32 (also reproducible on Fedora 35)
Ansible version: ansible-2.9.21-1.fc32.noarch AND ansible-2.9.27-1.fc35.noarch
Link to the playbook I am testing with:
https://github.com/benblasco/fedoralaptop/blob/master/nuc_storage_samsung.yml


Note You need to log in before you can comment on or make changes to this bug.