AIX

 View Only

Ansible inittab module error

  • 1.  Ansible inittab module error

    Posted Fri November 04, 2022 04:54 AM
    Good morning,

    Before I consider raising a bug report for this, would be good to know if this works for anyone else. This Ansible stanza (have tried different quoting as well):

      - nameAdd service to inittab
        whenansible_os_family == "AIX"  
        ibm.power_aix.inittab:
          nameservice
          runlevel"2"
          actiononce
          command"/home/service/agent start >/dev/console 2>&1"
          insertafterctrmc
          statepresent
        becomeyes

    fails with:

    fatal: [server]: FAILED! => {
    "changed": false,
    "invocation": {
    "module_args": {
    "action": "once",
    "command": "/home/service/agent start >/dev/console 2>&1",
    "insertafter": "ctrmc",
    "name": "service",
    "runlevel": "2",
    "state": "present"
    }
    },
    "msg": "\\nFailed to create entry in inittab file: service",
    "rc": 1,
    "stderr": "mkitab: 0481-203 Cannot specify more than one parameter.\\nUsage:\\tmkitab [-i ident] \\"ident:runlevel:action:command\\"\\n",
    "stderr_lines": [
    "mkitab: 0481-203 Cannot specify more than one parameter.",
    "Usage:\\tmkitab [-i ident] \\"ident:runlevel:action:command\\""
    ],
    "stdout": "",
    "stdout_lines": []

    Regards,
    Henrik  Morsing

    ------------------------------
    Henrik Morsing
    ------------------------------