IBM / ansible-power-aix

Developer contributions for Ansible Automation on Power
https://ibm.github.io/ansible-power-aix/
GNU General Public License v3.0
81 stars 95 forks source link

Filesystems module runs 'chfs' when attributes are specified, even if already set to the correct values #580

Open SaltyAlan opened 3 days ago

SaltyAlan commented 3 days ago

Filesystems module runs 'chfs' when attributes are specified, even if already set to the correct values.

If I specify any attribute other than size, for example: attributes: log=INLINE or attributes: options=noatime

whenever the playbook is run, the module performs a chfs to set the attribute regardless of the existing filesystem having that attribute already set.

To Reproduce Specify any attribute when using the filesystem module, other than size. I have seen this behaviour with options=noatime and log=INLINE. When only size is specified, the module correctly reports nothing to change.

Expected behavior No action taken when filesystems already have the required attributes, not running chfs every time.

Screenshots Code:

- name: Create /opt/snow filesystem
  ibm.power_aix.filesystem:
    device: snow
    filesystem: /opt/snow
    attributes: size=1G,log=INLINE
    auto_mount: yes
    fs_type: jfs2
    state: present

Modification every time playbook is run:

changed: [<snip>] => {"changed": true, "cmd": "chfs -a log=INLINE  /opt/snow", "msg": "Modification of filesystem /opt/snow completed", "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

Excerpt of /etc/filesystems showing log=INLINE already set:

/opt/snow:
        dev             = /dev/snow
        vfs             = jfs2
        log             = INLINE
        mount           = true
        options         = noatime,rw
        account         = false

lsfs output showing inline log already set:

# lsfs -q /opt/snow
Name            Nodename   Mount Pt               VFS   Size    Options    Auto Accounting
/dev/snow       --         /opt/snow              jfs2  2097152 noatime,rw yes  no
  (lv size: 2097152, fs size: 2097152, block size: 4096, sparse files: yes, inline log: yes, inline log size: 8, EAformat: v1, Quota: no, DMAPI: no, VIX: yes, EFS: no, ISNAPSHOT: no, MAXEXT: 0, MountGuard: no, LFF: no)

# lsfs -l /opt/snow
Name            Nodename   Mount Pt               VFS   Size    Options    Auto Accounting
/dev/snow       --         /opt/snow              jfs2  2097152 noatime,rw yes  no

Environment (please complete the following information):

Additional context If only the size attribute is set, the module makes no changes, as expected:

ok: [<snip>] => {"changed": false, "cmd": "", "msg": "No modification is required, exiting!", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
schamola commented 1 day ago

HI @SaltyAlan Thanks for reporting this issue. We will look into it, and get back to you!