Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

at: add support for AIX #99

Merged
merged 1 commit into from
Sep 25, 2020
Merged

at: add support for AIX #99

merged 1 commit into from
Sep 25, 2020

Conversation

dberg1
Copy link

@dberg1 dberg1 commented Sep 25, 2020

SUMMARY

The at module does not work correctly on AIX.
Trying to remove a job fails with a syntax error.
Setting the unique attribute to yes also fails.
AIX uses -lv options to cat a job (instead of -c for Linux) and -r to remove a job.
Linux supports both -r and -d, so use -r since it is what POSIX says.
See https://www.ibm.com/support/knowledgecenter/ssw_aix_72/a_commands/at.html and https://pubs.opengroup.org/onlinepubs/9699919799/utilities/at.html
Other systems like SunOS or the BSDs also appear to use -r to remove a job.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

at

ADDITIONAL INFORMATION

To recreate the issue, use the following playbook:

- hosts: aix
  gather_facts: no
  tasks:
  - at:
      command: "ls -d / > /dev/null"
      state: absent

This fails with:

fatal: [aix-host1]: FAILED! => {
    "changed": false,
    "cmd": "/usr/bin/at -c root.1599830992c0.a",
    "invocation": {
        "module_args": {
            "command": "ls -d / > /dev/null",
            "count": null,
            "script_file": null,
            "state": "absent",
            "unique": false,
            "units": null
        }
    },
    "msg": "at: syntax error",
    "rc": 1,
    "stderr": "at: syntax error\n",
    "stderr_lines": [
        "at: syntax error"
    ],
    "stdout": "",
    "stdout_lines": []
}

AIX uses -lv options to cat a job (instead of -c for Linux).
AIX uses -r to remove a job.
Linux supports both -r and -d, so use -r since it is what POSIX says.
@maxamillion
Copy link
Collaborator

I don't have a way to test this myself because I don't have access to an AIX system but the code change looks good, thank you for the contribution!

@maxamillion maxamillion added the gate Gate PR in Zuul CI (Obsolete: Please set "mergeit" instead of "gate") label Sep 25, 2020
@ansible-zuul ansible-zuul bot merged commit 77df4ba into ansible-collections:main Sep 25, 2020
@czi
Copy link

czi commented Sep 25, 2020

Thank you for this. Issue 62153 / bugfix 62154 got ignored by Redhat and closed with the move to ansible-posix. I'm glad to see this finally merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gate Gate PR in Zuul CI (Obsolete: Please set "mergeit" instead of "gate")
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants