Skip to content

Conversation

@inxonic
Copy link
Contributor

@inxonic inxonic commented Oct 10, 2018

SUMMARY

This enables Ansible to gather filesystem sizes on AIX.

On Linux these facts are gathered by function get_mount_size that uses os.statvfs.
Since AIX has the statvfs system call too, we can make use of that.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
  • module_utils/facts/hardware/aix.py
ADDITIONAL INFORMATION
        "ansible_mounts": [
            {
                "device": "/dev/hd4",
                "fstype": "jfs2",
                "mount": "/",
                "options": "rw,log=/dev/hd8",
                "time": "Mar 17 13:28"
            },

With patch:

        "ansible_mounts": [
            {
                "block_available": 210984,
                "block_size": 4096,
                "block_total": 327680,
                "block_used": 116696,
                "device": "/dev/hd4",
                "fstype": "jfs2",
                "inode_available": 188816,
                "inode_total": 201845,
                "inode_used": 13029,
                "mount": "/",
                "options": "rw,log=/dev/hd8",
                "size_available": 864190464,
                "size_total": 1342177280,
                "time": "Mar 17 13:28"
            },

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. labels Oct 10, 2018
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Oct 11, 2018
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Oct 25, 2018
@maxamillion
Copy link
Contributor

@inxonic thank you for the submission! We unfortunately don't have any AIX systems in our CI environment so I'm unable to test this. Is it safe you say you verified this works? Does it require any specific (potentially more recent) release of AIX or something else that might need to be added to the docs section?

@inxonic
Copy link
Contributor Author

inxonic commented Nov 6, 2018

@maxamillion thanks for your feedback. We run that code even on production systems regularily and didn't see any negative impact. While I have to admit that I couldn't test on too many different versions/technologie levels/service packs, I can confirm that it runs on 7.1 TL4, which is the oldest under general support. Also there is no change on the statvfs calls and structures throughout the versions (statvfs 7.2, statvfs 7.1, statvfs.h 7.2, statvfs.h 7.2) and Python declares this function to be available on UNIX with no exception. Furthermore the get_mount_size function (not modified by this PR) silently ignores any OS errors, so the chance to break other functionality is quite low.

@maxamillion
Copy link
Contributor

rebuild_merge

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. community_review In order to be merged, this PR must follow the community review workflow. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. community_review In order to be merged, this PR must follow the community review workflow. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Nov 6, 2018
@ansibot ansibot merged commit 58ae93d into ansible:devel Nov 7, 2018
@inxonic inxonic deleted the aix_statvfs branch November 23, 2018 23:30
mjmayer pushed a commit to mjmayer/ansible that referenced this pull request Nov 30, 2018
Tomorrow9 pushed a commit to Tomorrow9/ansible that referenced this pull request Dec 4, 2018
@dagwieers dagwieers added the aix AIX community label Jan 8, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

affects_2.8 This issue/PR affects Ansible v2.8 aix AIX community community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants