aix_inittab – Manages the inittab on AIX

Synopsis

  • Manages the inittab on AIX.

Requirements

The below requirements are needed on the host that executes this module.

  • itertools

Parameters

Parameter Choices/Defaults Comments
action
string / required
    Choices:
  • boot
  • bootwait
  • hold
  • initdefault
  • off
  • once
  • ondemand
  • powerfail
  • powerwait
  • respawn
  • sysinit
  • wait
Action what the init has to do with this entry.
command
string / required
What command has to run.
insertafter
string
After which inittabline should the new entry inserted.
name
string / required
Name of the inittab entry.

aliases: service
runlevel
string / required
Runlevel of the entry.
state
string
    Choices:
  • absent
  • present ←
Whether the entry should be present or absent in the inittab file.

Notes

Note

  • The changes are persistent across reboots.

  • You need root rights to read or adjust the inittab with the lsitab, chitab, mkitab or rmitab commands.

  • Tested on AIX 7.1.

Examples

# Add service startmyservice to the inittab, directly after service existingservice.
- name: Add startmyservice to inittab
  aix_inittab:
    name: startmyservice
    runlevel: 4
    action: once
    command: echo hello
    insertafter: existingservice
    state: present
  become: yes

# Change inittab entry startmyservice to runlevel "2" and processaction "wait".
- name: Change startmyservice to inittab
  aix_inittab:
    name: startmyservice
    runlevel: 2
    action: wait
    command: echo hello
    state: present
  become: yes

- name: Remove startmyservice from inittab
  aix_inittab:
    name: startmyservice
    runlevel: 2
    action: wait
    command: echo hello
    state: absent
  become: yes

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
changed
boolean
always
Whether the inittab changed or not

Sample:
True
msg
string
changed
Action done with the inittab entry

Sample:
changed inittab entry startmyservice
name
string
always
Name of the adjusted inittab entry

Sample:
startmyservice


Status

Authors

  • Joris Weijters (@molekuul)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.