ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
827 stars 1.53k forks source link

lvol: Idempotency issue due to LVM2-2.03.17 std message #7182

Closed j3ffrw closed 11 months ago

j3ffrw commented 1 year ago

Summary

lvol is failing on re-runs due to lvm2 previous stderr messages are now in stdout

# Older version
$ lvm version
  LVM version:     2.03.14(2)-RHEL8 (2021-10-20)
  Library version: 1.02.181-RHEL8 (2021-10-20)
  Driver version:  4.43.0

$lvextend -l 90%VG /dev/vg.log/lvlog 2>stderr
$cat stderr 
  New size (11520 extents) matches existing size (11520 extents).

# Newer version
$ lvextend --version
  LVM version:     2.03.17(2) (2022-11-10)
  Library version: 1.02.187 (2022-11-10)
  Driver version:  4.47.0  

$ lvextend -l 90%VG /dev/vg.log/lvlog 2>stderr
  New size (11520 extents) matches existing size (11520 extents).
$ cat stderr 
  No size change.

Issue Type

Bug Report

Component Name

lvol, lvextend/lvresive

Ansible Version

$ ansible --version
ansible [core 2.15.2]
  config file = None
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.5 (main, Aug  2 2023, 22:53:26) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)] (/usr/bin/python3.10)
  jinja version = 3.1.2
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
# /usr/share/ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 7.1.0

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = None

OS / Environment

NAME="Fedora Linux" VERSION="36 (Thirty Six)" ID=fedora VERSION_ID=36 VERSION_CODENAME="" PLATFORM_ID="platform:f36" PRETTY_NAME="Fedora Linux 36 (Thirty Six)" ANSI_COLOR="0;38;2;60;110;180" LOGO=fedora-logo-icon CPE_NAME="cpe:/o:fedoraproject:fedora:36" HOME_URL="https://fedoraproject.org/" DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f36/system-administrators-guide/" SUPPORT_URL="https://ask.fedoraproject.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=36 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=36 PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" SUPPORT_END=2023-05-16

Steps to Reproduce


- hosts: foo.example.com
  tasks:
    - name: Create a logical volume the size of all remaining space in VG
      community.general.lvol:
        vg: vg_data
        lv: test
        size: 100%FREE

Expected Results

I expect re-running the same play would result in no change

Actual Results

  "rc": 5,
  "err": "  No size change.\n",
  "msg": "Unable to resize lvdata to 90%VG",

Code of Conduct

ansibullbot commented 1 year ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 1 year ago

cc @abulimov @jhoekx @unkaputtbar112 @zigaSRC click here for bot help

russoz commented 11 months ago

hi @j3ffrw , could you please confirm the code in the PR (mentioned above) solves the issue? TIA